Repository navigation
feat(mcp): declare read-only annotations on all five MCP tools - #32
Merged
Merged
Conversation
Every tool in the MCP router reads the local index and mutates nothing, but none of them said so. An MCP client that sees no annotations must assume the tool is destructive and open-world, and some clients then demand an approval the caller cannot supply. Codex's review flow is the concrete casualty: a review runs as a delegated sub-Codex with approval_policy pinned to Never, its elicitation handler has no arm for ElicitationRequest, and the await has no timeout. The result is that the first secall call in `codex review` is announced and then never dispatched -- the tools/call frame never reaches the server and the run waits forever (openai/codex#31565, unfixed). Measured, same binary and prompt, only the annotations differing: un-annotated hung past 600s with no tools/call reaching the server; annotated dispatched in 14.6s and completed in 22s. The annotations are accurate on their own merits; unblocking that client is the reason to add them now.
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.
Every tool in the MCP router reads the local index and mutates nothing, but none of them declared that. An MCP client that sees no annotations must assume the tool is destructive and open-world, and some clients then demand an approval the caller cannot supply.
Codex's review flow is the concrete casualty. A review runs as a delegated sub-Codex with
approval_policypinned toNever, its delegate event forwarder has no arm forElicitationRequest, and the elicitation await has no timeout — so the first secall call insidecodex reviewis announced (mcp: secall/recall started) and then never dispatched. Thetools/callframe never reaches this server and the run waits forever. Upstream: openai/codex#31565 (open).Measured
Three
codex exec reviewruns against a mock MCP server that mirrors this server's wire behaviour — same binary, same prompt, same repo:tools/callreached the serverread-onlydanger-full-accessread-onlyAnd against this server before the change, under
codex exec review -c sandbox_mode=read-only:mcp: secall/recall started, then 480s of silence until the timeout killed it.The daemon itself was never at fault — verified separately that it reaps idle sessions at exactly 300s, closes the standalone SSE stream cleanly, and answers a reaped session id with 404 in 0.4ms, which is what MCP requires.
Change
read_only_hint = true,destructive_hint = false,idempotent_hint = true,open_world_hint = falseonrecall,get,status,wiki_searchandgraph_query, plus a title each. All five only read the local index, so the annotations are accurate on their own merits; unblocking that client is the reason to add them now.Tests:
cargo test --no-default-features -p secall-core— 121 passed, 0 failed, 8 ignored.