Repository navigation
fix(mcp): stop revoked App actions after catalog waits - #126415
Conversation
|
🦞👀 Pull request received. I will update this pull request when review starts. |
|
Codex review: needs maintainer review before merge. Reviewed August 19, 2026, 4:15 PM ET / 20:15 UTC. ClawSweeper reviewWhat this changesThe PR prevents a revoked board-granted MCP App from calling tools, returning interactive tools, or being pinned as interactive after an awaited catalog refresh. Regression provenancePossible regression — suspected (reviewed change). No predecessor PR is attributed. Merge readinessKeep this protected maintainer PR open for final human approval and exact-head CI. The current main path authorizes before catalog work but not after it; this branch closes that authority race at dispatch, capability-return, and pin-persistence boundaries. Priority: P0 Review scores
Verification
Live VerificationCommand: Result: FAIL (partial) — step 2 Assertions:
How this fits togetherBoard widgets mint MCP App views whose interactive authority comes from a specific live grant. Gateway operations may wait on MCP catalog work, then dispatch tools, return capabilities, or persist a pinned view. flowchart LR
A[Board widget grant] --> B[Grant-bound App view]
B --> C[Catalog or tool lookup]
C --> D[Live grant recheck]
D -->|active| E[Tool call or tool list]
D -->|revoked| F[Denied request or read-only pin]
Decision needed
Why: The maintainer label requires explicit human handling for a change that governs when previously granted interactive authority becomes invalid. Before merge
Agent review detailsSecurityNone. PR surfaceSource +10, Tests +561. Total +571 across 9 files. View PR surface stats
Review metrics
Merge-risk optionsMaintainer options:
Technical reviewBest possible solution: Retain the localized post-await checks at the dispatch, capability-return, and pin-persistence owners, then merge only after human approval and exact-head checks validate the pinned MCP fixture. Do we have a high-confidence way to reproduce the issue? Yes, source-reproducible: the E2E deterministically holds a real child Gateway's Streamable HTTP catalog refresh, removes the board widget, and checks for denial with no tool execution. It was not run here because this read-only worktree has no dependencies and must not reconcile them. Is this the best way to solve the issue? Yes. Rechecking the exact live grant immediately after awaited discovery and before each interactive output or side effect is the narrow owner-boundary repair; an outer wrapper would either run too late or restrict preserved read-only resource access. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against f68503084b7a. LabelsLabel changes:
Label justifications:
EvidenceWhat I checked:
Likely related people:
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
HistoryReview history (1 earlier review cycle)
|
|
Land-ready proof for exact head b2a3a399a925e47e5e943330a327e698deb08f82.
ClawSweeper's exact-head review has no actionable code or security finding and identifies this as the best owner-boundary fix. Its remaining maintainer-decision and proof requests are resolved: owner decision is land, exact-head CI is green, and direct inspection of pinned Final Codex autoreview is clean. Production is +12/-2 (net +10), justified by live revalidation at the shared dispatch/list and board-persistence owners; tests/test support are +764/-203, including 213 mechanically moved board runtime-boundary lines. Revoked board authority must fail before delayed tool dispatch, capability return, or interactive pin persistence. Maintainer decision: land. |
|
Merged via squash.
|
* fix(mcp): revalidate app grants after catalog work * test(mcp): track grant proof temp state * test(browser): use canonical graceful stop budget
AI-assisted: Yes. The implementation and validation used AI coding tools, with a clean final autoreview.
What Problem This Solves
Fixes an issue where a board-granted MCP App interaction could remain effective after the operator removed or replaced the granting widget while the request was waiting for MCP catalog work. An in-flight App tool call could therefore execute after revocation, tool discovery could return stale capability inventory, and a pin operation could persist stale interactive authority.
Why This Change Was Made
Interactive MCP App boundaries now revalidate the exact live board grant after awaited catalog/list work and immediately before tool dispatch, capability return, or interactive pin persistence. Pinning that loses authority during tool resolution downgrades to the existing read-only representation; ordinary catalog failures retain their existing error behavior. Resource reads and reconstructed read-only Apps are unchanged.
User Impact
Removing or replacing a granted board App now reliably stops delayed interactive work before it crosses the MCP boundary. Operators no longer see a revoked App complete a side-effecting call after removal, and stale pins cannot retain interactive tool declarations.
Evidence
mcp.app.callToolandmcp.app.listToolsreturned success after revocation; board pinning checked the grant once and remained interactive; the standalone bridge returned HTTP 200.postRevocationExecuted: true.node scripts/run-vitest.mjs test/e2e/qa-lab/runtime/gateway-mcp-app-grant-revalidation.e2e.test.ts— 1/1 passed on the final local tree; the same flow returned HTTP 403 withMCP App widget grant is no longer active, and the MCP child recorded no post-revocation call.node scripts/run-vitest.mjs src/gateway/server-methods/mcp-app.test.ts src/gateway/server-methods/board.test.ts src/gateway/server-methods/board.runtime-boundaries.test.ts src/gateway/mcp-app-standalone.test.ts— 66/66 passed.node scripts/check-changed.mjs -- <nine changed paths>— passed for core, coreTests, extensionTests, testRoot, and tooling lanes.git diff --check— passed.chrome.test.tsfile passed 36/36.Production LOC: +12/-2 (net +10), justified by post-await authorization at the shared dispatch/list and board-persistence owners. Tests and test support: +764/-203; 213 added lines are a mechanical split of pre-existing runtime-boundary board tests required to bring the touched test owner below its line limit.