Skip to content

Follow running Assemblies in the MCP result widget - #590

Merged
kvz merged 1 commit into
mainfrom
widget-polls
Oct 19, 2026
Merged

kvz merged 1 commit into
mainfrom
widget-polls

Conversation

@kvz

@kvz kvz commented Oct 19, 2026

Copy link
Copy Markdown
Member

Why

The MCP Apps result widget only rendered the tool result it was opened with. When ChatGPT showed it for transloadit_create_assembly (or a Builtin shortcut) while the Assembly was still running, the card said "Processing · Result files appear when the Assembly completes" forever, even after the Assembly had finished (seen in production with 0.7.1 on 2026-10-19). Demos only looked right when the model happened to call transloadit_wait_for_assembly, which rendered a second widget. Users should see their results no matter how the model waits.

What

  • While the Assembly is uploading, executing or replaying (the same states the SDK's awaitAssemblyCompletion polls on), the widget calls the read-only transloadit_get_assembly_status through the host's tool bridge: MCP Apps tools/call when the host declares serverTools, otherwise ChatGPT's window.openai.callTool. It passes assembly_ssl_url (or the Assembly ID) from the result it already has, so no new data reaches the widget.
  • Checks back off from 2 s by 1.5x to every 10 s, for at most 15 minutes of waiting. Each call times out after 30 s. Checking stops on a terminal state (completed, failed, canceled, aborted), on ui/resource-teardown, and pauses while the document is hidden (it checks again soon after it is back in view).
  • After 15 minutes, or 3 failed checks in a row, a "Check again" link joins the busy note (same line, so nothing else moves) and restarts the checks. Hosts without a tool bridge keep today's text and get no button.
  • A refreshed status replaces only the Assembly in the host's result, so Step labels and Console/Template links stay. The create call's errors and warnings are dropped once the Assembly has finished, since they no longer apply. Identical repeats of the host's original result (ChatGPT re-sends toolOutput on every theme or height change) no longer bring the old "Processing" state back.
  • transloadit_get_assembly_status now declares openai/widgetAccessible: true (ChatGPT's opt-in for callTool) and an explicit ui.visibility: ['model', 'app'].
  • The widget never fetches the Assembly status URL itself. Its CSP only lists result file origins, and the tool bridge reuses the caller's credentials.

Tests

  • Unit (happy-dom, widget-handshake.test.ts): running to completed over tools/call with the exact 2 s / 3 s / 4.5 s delays; stops on failed, canceled and aborted; caps at 10 s and offers "Check again" after the 15 minute budget, which then finishes the job; "Check again" after 3 failures; no calls and unchanged text without a bridge; stops on teardown; pauses while hidden; the ChatGPT callTool path, including a later openai:set_globals not reverting to "Processing".
  • tool-surface.test.ts checks the new status tool metadata.
  • Playwright widget states: the fake host can now proxy tools/call. New states refreshed-to-completed (executing, then completed through the bridge) and check-again, plus a stability test that the transition happens without any new host result, keeps the upload preview node and fetches nothing twice. Baselines rendered in the official Playwright image (test:widget-visual); existing baselines are unchanged.

Closes #589

🤖 Claimed by kvz on framework1/node-sdk since 2026-10-19 · resume: claude --resume 26eaa88e-b3fa-4cc1-bcce-0c7ff5b6bab7

A widget rendered for a running Assembly showed "Processing" forever unless
the model also called transloadit_wait_for_assembly. It now checks
transloadit_get_assembly_status through the host's tool bridge (MCP Apps
tools/call or ChatGPT's callTool) with backoff until the Assembly finishes,
then renders the results in place.

Closes #589

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
@kvz
kvz merged commit e975d79 into main Oct 19, 2026
16 checks passed
@kvz
kvz deleted the widget-polls branch October 19, 2026 07:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

MCP result widget stays on Processing when the Assembly finishes later

1 participant