Repository navigation
Conversation
One permission prompt runs at a time, so a call can wait for the prompt lock behind another call's open prompt. When its command exited or was killed during that wait, the core withdrew the request, but the bridge still ran the permission check once it got the lock. The person then saw a prompt for a command that was gone, and nothing ran after the answer. The bridge now asks the core, after it takes the prompt lock, whether the request still waits for its check, and skips the check when it does not. A prompt that is already open when its client leaves still stays until it is answered, as before.
awaitingPermission now finds the request with slotOf, the core's one slot search. The trace for a withdrawn request no longer says its prompt stays until answered, which a queued request no longer opens: nothing runs, and only a prompt that is already open stays.
fazxes
marked this pull request as ready for review
November 25, 2026 07:32
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Summary
fx mcp callwhose command exits or is killed while it waits for the permission prompt lock no longer opens a prompt.Why
The bridge runs one permission prompt at a time (
bridge.prompt). A second call waits for that lock behind the first call's open prompt. When the second call's command left during that wait, the core withdrew the request, but after the lock the bridge still calledauthorize. So the person saw a prompt for a command that no longer existed. Nothing ran after the answer, because the core frees the slot of a withdrawn request, so this was a confusing prompt, not a safety problem.Fix
mcp_call.awaitingPermission(state, id), a read-only query on the core: true only while the request is in itsauthorizingstage.serve, after the prompt lock, the bridge checks it underbridge.mutexand skipsauthorizefor a withdrawn request. The core then frees the slot with no reply, since no client is left to read one.admitted,withdrawn) signal the bridge condition, in the same way asrequest_polls, so the test waits on signals and not on sleeps.Tests
expected 1, found 2permission checks (B's check ran).ok, and B's tool never runs.awaitingPermission.mcp_call_bridgeandmcp_calltests: 45 pass. Fullzig build test: exit 0.bun test mcp-stdio.test.ts -t "fx mcp call": 25 pass, 0 fail.sh tests/tla/mcp_call/check.sh: pass. That covers the model check, spec to code (49,406 of 49,406 transitions), code to spec (313 traces), and 18 of 18 spec and code mutations.Not covered
tests/tla/mcp_call/models the core, not the bridge's prompt lock, so TLC does not check this rule. The core's transitions are unchanged.authorizeopens its prompt still gets the prompt. The existing rule then keeps it until it is answered. Closing that window would holdbridge.mutexfor the whole prompt.Ship check
bin/checklists four findings:tests/tla/mcp_call/(model-covered): see "Not covered" above.tests/tla/mcp_host/(model-covered): itsSubagentAccessspec models which bridged calls may run, not when a prompt opens. This change only turns a prompt for a withdrawn request into a deny, so a bridged call runs less, never more, and that model does not change.agents_menu_selectionandmcp_call_error_text(fuzz-reached): both reach this code only through imports. Neither callsserveorawaitingPermission. ReleaseSafe rounds ofagents_menu_selection(20,000 inputs) andmcp_call_error_text(150,000 inputs) passed on the merged head.