GeezerVison is showing github.com — fix(web,mobile): MCP apps stay linked when an injected script messages before the bootstrap by juliusmarminge · Pull Request #43824 · pingdotgg/t3code
Conversation
MCP apps were replaced by "The MCP app needs a newer T3 Code server" even though the server was current, when a local filter such as AdGuard injected a script that messages the host before T3 Code's document bootstrap. The web/desktop host and the mobile relay took any first message that wasn't the bootstrap's handover as a missing bootstrap. Now only the app's own JSON-RPC before the handover counts as a missing bootstrap, and other early messages are ignored.
attachMcpAppDocumentLink (web and desktop): non-JSON-RPC messages before the handover are dropped instead of marking the frame unlinked.
mcpAppRelayDocument (mobile): the same rule in the relay page script before it reports {t3:'unlinked'}.
Fixes #43805
Reproduction on main
Commit a4ab2c5 (origin/main). Started T3CODE_DEV_SEED=0 vp run dev in a fresh worktree. Wrote a minimal stdio MCP server with a tool show whose _meta.ui.resourceUri is ui://demo/app, set it up through .mcp.json in a scratch git project, added the project with t3 project add, and ran t3 thread start --provider claudeAgent --model haiku asking the agent to call mcp__demo__show. Opened the thread in the web client with headless Chromium through Playwright, with a listener on the top window installed before any page script. (1) Plain: the frame posted {t3:'t3-mcp-app-document'}, ui/initialize, initialized and size-changed; the app showed 'DEMO APP CONNECTED TO HOST'. (2) With a Playwright route rewriting /api/assets/ HTML the way AdGuard's proxy does (a script right after the CSP meta, ahead of the bootstrap, posting "pb_handshake" with a MessagePort to the parent): the top window got '"pb_handshake" ports:1', then the handover, then ui/initialize, the same order as the reporter's capture. The frame was removed and the thread showed 'The demo app needs a newer T3 Code server on this environment. Update the server to use it.' Not run: the desktop app and Windows/AdGuard itself; the desktop renderer uses the same McpAppFrame, and the proxy's rewrite was emulated. Failing tests pushed on factory/repro-43805: McpAppFrame.browser.test.tsx (the app is never answered; the notice replaces it) and mcpAppRelayDocument.test.ts (the relay sends {t3:'unlinked'} instead of the request).
Evidence
Real web app, Chromium, 1280×800, light theme, fresh synthetic state on each commit. Replay supplies demo.show; the real server serves the app document. A response rewrite inserts pb_handshake with a MessagePort before T3's bootstrap. Open the thread, verify initialization, then tap the iframe's Check interaction button.
Proven: scenarios:prove exited 0; base failed and head passed.
Scenario source. All captures inspected. No code committed; reproduction checkouts and scratch files removed.
Not shown:
- Desktop shell, Windows, and AdGuard itself were not run; the web client reproduced the early MessagePort ordering through an HTML response rewrite.
- Claude and a live stdio MCP server were not exercised; Replay supplied the tool result and app reference, while the real server attachment route and client frame handled the document and initialization.
- The mobile relay change was not exercised on a device.
Tests
vp test run src/features/threads/mcpAppRelayDocument.test.ts (apps/mobile): 3 passed; the new test fails without the fix
vp test run src/components/chat/McpAppFrame.browser.test.tsx (apps/web): 6 passed; the new test fails without the fix
vp run check:changed: format, lint, knip, typecheck, tests and React compiler pass
Not in this change
- Neither the desktop app nor a real AdGuard install was exercised; the desktop renderer uses the same McpAppFrame code covered by the browser test.
Who did the work
- Written by Claude Opus 5.5, in Claude Code
- Reviewed by GPT-6.1 Sol, in Codex, and by Claude Opus 5.5, each on its own
- Proof captured by GPT-6.1 Sol and checked by Claude Opus 5.5
Run by the t3code factory in T3 Code.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
…ges first
Reproduces #43805: a script injected ahead of the document bootstrap
(AdGuard's local proxy) posts first, and the web host and mobile relay
treat the frame as served without the bootstrap.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
…s before the bootstrap
A script a local filtering proxy (AdGuard) adds ahead of T3 Code's document
bootstrap posts to the host first, and the web host and mobile relay took any
first message that was not the handover as a missing bootstrap. Only JSON-RPC
before the handover now marks the frame as unlinked; other early messages are
ignored.
Fixes #43805
Co-Authored-By: Claude Opus 5.5 <[email protected]>
coderabbitai
Bot
commented
Nov 26, 2026
•
edited
Loading
Uh oh!
There was an error while loading. Please reload this page.
|

No actionable comments were generated in the recent review.
Walkthrough
-
The web document link and mobile relay now ignore unrelated messages received before the document port. An early JSON-RPC message still indicates a missing bootstrap. New browser and mobile tests cover messages arriving before the bootstrap.
Changes: Pre-bootstrap message handling
| Layer / File(s) |
Summary |
Web document-link filtering and browser coverage apps/web/src/components/chat/mcpAppDocumentLink.ts, apps/web/src/components/chat/McpAppFrame.browser.test.tsx |
The document link ignores pre-port messages that are neither port transfers nor JSON-RPC. The browser test checks that an earlier message with a transferred port does not prevent host responses, including the size-change request. |
Mobile relay filtering and test coverage apps/mobile/src/features/threads/mcpAppRelayDocument.ts, apps/mobile/src/features/threads/mcpAppRelayDocument.test.ts |
The relay marks the frame unlinked before port establishment only when it receives JSON-RPC. The test checks that a request is relayed after an earlier message carries a port. |
Estimated code review effort: 2 (Simple) | ~10 minutes
Change: Bug fix · Severity of issue fixed: Medium
Merge Risk: Minimal · up to 0923a
-
MCP apps should now render inline when a browser extension injects an early unrelated message, instead of showing a "needs a newer server" notice. The change is small and tested on web and mobile, and no merge-blocking risk was found.
Pre-merge checks: 4
-
| Check name |
Status |
Explanation |
| Title check |
 |
The title names the fix and its scope: MCP apps stay linked when an injected script posts a message before the bootstrap. It matches the changeset in mcpAppDocumentLink.ts, mcpAppRelayDocument.ts, and… |
| Linked Issues check |
 |
Issue #43805 requires that MCP apps render inline when an injected script posts a message before the document bootstrap handover. At the reviewed head, the web and desktop path in apps/web/src/compone… |
| Out of Scope Changes check |
 |
The diff touches only the web link logic (mcpAppDocumentLink.ts, with its doc comments), the mobile relay page script (mcpAppRelayDocument.ts), and the tests for both. Each code change implements … |
| Description check |
 |
The description covers the problem, the change, scope, and verification in substance. It explains that AdGuard-style early messages were treated as a missing bootstrap, and that only pre-handover JSON… |
Full details: Title check
-
Explanation
The title names the fix and its scope: MCP apps stay linked when an injected script posts a message before the bootstrap. It matches the changeset in mcpAppDocumentLink.ts, mcpAppRelayDocument.ts, and their tests. It follows the conventional commit form and is specific enough for a teammate scanning history.
Full details: Linked Issues check
-
Explanation
Issue #43805 requires that MCP apps render inline when an injected script posts a message before the document bootstrap handover. At the reviewed head, the web and desktop path in apps/web/src/components/chat/mcpAppDocumentLink.ts (attachMcpAppDocumentLink) returns early for a first message that is neither the handover with a port nor JSON-RPC (event.data?.jsonrpc !== "2.0"). Only pre-handover JSON-RPC sets link = false and calls onMissing. The mobile relay in apps/mobile/src/features/threads/mcpAppRelayDocument.ts applies the same rule: a non-handover message with jsonrpc === "2.0" before the port reports {t3:'unlinked'}, and other early messages are ignored. This matches the issue's reported sequence (pb_handshake with a port, then the handover, then ui/initialize), because the pb_handshake string is not JSON-RPC and is skipped. The web/desktop change is in the shared McpAppFrame path, which the PR states the desktop renderer uses. The author added browser and relay tests for the injected-early-message case. The PR reports that these tests fail without the fix. I did not run the tests. The desktop app and a real AdGuard install were not exercised, so end-to-end desktop behavior is inferred from the shared code path, not observed.
Full details: Out of Scope Changes check
-
Explanation
The diff touches only the web link logic (mcpAppDocumentLink.ts, with its doc comments), the mobile relay page script (mcpAppRelayDocument.ts), and the tests for both. Each code change implements the issue's rule that only the app's own JSON-RPC before the handover marks the bootstrap as missing. The doc-comment edits describe the same behavior and support the change. The added tests cover the injected-early-message case. No unrelated files or behavior changes were identified in the summary or inspected hunks.
Full details: Description check
-
Explanation
The description covers the problem, the change, scope, and verification in substance. It explains that AdGuard-style early messages were treated as a missing bootstrap, and that only pre-handover JSON-RPC now counts. It links issue #43805 and gives a detailed reproduction on main, with before/after evidence and test commands. It also lists what was not tested: the desktop app, Windows, AdGuard itself, and the mobile device run. The template headings are present and mostly filled in. The Problem section is merged into the opening paragraph and has no explicit expected-behavior statement. The Scope section gives an issue link, which satisfies the requirement. The Verification section includes the commands and results. The author also names the models that did the work, as the template asks. The description is mostly complete, so this check passes.
Finishing Touches
-
Generate unit tests (beta)
-
- Commit to this branch
- Create a new PR
- Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
Recent review info
-
Run configuration
-
Commits
-
Reviewing files that changed from the base of the PR and between 1dba8e2 and 0923a04.
Files selected for processing: 4
-
apps/mobile/src/features/threads/mcpAppRelayDocument.test.ts
apps/mobile/src/features/threads/mcpAppRelayDocument.ts
apps/web/src/components/chat/McpAppFrame.browser.test.tsx
apps/web/src/components/chat/mcpAppDocumentLink.ts
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 8 remain after this review.
|
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
imetn
added a commit
to imetn/t4code
that referenced
this pull request
Nov 27, 2026
…ake latch stall for v0.1.12-t4.11
- Fix Antigravity (pingdotgg#43713) background wakeup reply stall by releasing the ACP wake latch and retiring cancelled wake slices in onRunEndedWithoutStarting, checking postSettleContinuationEnabled and runningBackgroundTaskIds before re-offering, and bumping continuationGeneration on runtime termination.
- Port Tier 1 upstream PRs: pingdotgg#43908 (i18n ICU/gt-i18n crash fixes), pingdotgg#43834 (Antigravity ACP support), pingdotgg#43789 (Antigravity usage model IDs & xhigh), pingdotgg#43854 & pingdotgg#43811 (Claude held notifications & workspace trust), pingdotgg#43825 (desktop pinch/wheel zoom), pingdotgg#43896 (GitVcsDriver index check), pingdotgg#43824 (MCP app frame links).
- Port Tier 2 upstream PRs: pingdotgg#43833 (file download from Files panel & chat links), pingdotgg#43826 (preserve right panel on fork/rewind), pingdotgg#43869 (client sentFrom context with T4 Code/T4 Connect labels).
This branch has not been deployed
No deployments
Uh oh!
There was an error while loading. Please reload this page.
Assignees
No one assigned
Labels
size:S
10-29 changed lines (additions + deletions).
vouch:trusted
Author is trusted by repo permissions or the VOUCHED list.
Milestone
No milestone
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
|