Repository navigation
Conversation
…oes back Under MCP 2026-07-28 a server may answer tools/call with resultType "input_required" instead of acting; the client retries the same call under a new id. The guard took that answer for a success: it committed the reserved amount and marked any approval as used, then did both again on the retry. Now an input_required reply releases the hold with the reason execution.input-required, leaves the approval unspent, and the retry is decided on its own. Refusals carry resultType "complete" when the request named a protocol revision in _meta, so a 2026-07-28 client gets the shape it expects and an older client sees no change. Three tests, each shown to fail without the fix: the ledger ends with one released and one committed reservation and the daily headroom proves it; an approval survives the ask and is spent by the retry; a refusal carries resultType only for a client that announced the revision. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
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.
What was wrong
guard.mjsjudged an upstream reply as "the call ran" unless it was a JSON-RPC error orisError: true. MCP 2026-07-28 adds a third answer totools/call:resultType: "input_required", meaning the server wants more input before acting and the client should retry the same call under a new id. The guard committed the reserved amount on that answer and marked any approval as used, then did both again when the retry ran. Claude Code's v2 runtime already speaks 2026-07-28.What changes
input_requiredreply releases the hold, with the reasonexecution.input-requiredon the receipt, and leaves the approval unspent. The retry is a call of its own and is decided afresh.resultType: "complete"when the request named a protocol revision in_meta. An older client, which has never seen the field, gets the shape it knows.arguments.ask: trueuntilinputResponsesarrives).Proof
Each new test was run against the unfixed guard and failed, then passed with the fix:
guard-proxy: one session with the ask and the retry leaves the ledger at onereleasedand onecommitted; a fresh session then shows 1,900 of 5,000 spent, not 3,800. Receipts: oneblockedwithexecution.input-required, oneexecuted.approvals: one session per step, so the test cannot pass by racing. The approval is stillapprovedafter the ask,usedafter the retry, and the same call again is refused as already used.guard-proxy: a refusal to a 2026-07-28 client hasresultType: "complete"; to an older client it has no such field.138 tests, the execution-boundary harness and the end-to-end scenario are green from this branch.
Not in this PR
Carrying a receipt id in
_meta, and the in-protocol approval flow overinput_required(plan items A4 and A5).server/discoveralready passes through untouched.🤖 Generated with Claude Code