test(mcp): pin the typed unknown-tool refusal on the rmcp wire - #2649
Merged
Merged
Conversation
#2517 made an unknown tool name a non-retryable invalid_request (JSON-RPC -32602 with typed data), which is also the MCP spec code for an unknown tool. The rmcp wire matrix test still pinned the untyped -32603 from before, while its raw-dispatch parity check already passed. Pin the whole error object the wire carries instead of the code alone.
|
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
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.
Fixes #2645
Cause: stale pin, not a production regression
rmcp_wire_matrix_matches_raw_dispatch_initialize_tools_and_resourcesfailed at the code assertion:The line just before that assertion,
assert_last_response_matches_raw_dispatch, already passed. It compares the whole rmcp wire frame with the rawMcpServer::handle_requestframe for the same request, so the two frames were identical in every field. Only the literal code was stale.#2517 (a0b5987) changed
unknown_tool_errorfrom untypedTraceDecayError::Config, which rendered as-32603, toproject_route("unknown_tool", retryable=false). It also addedunknown_toolto theinvalid_requestkinds inproject_route_problem_kind. That PR re-pinned the mcp_suite frames but missed this lib test.-32602is also the code the MCP spec gives for an unknown tool.Recent changes I checked:
fleet/one-problem-shape, 175446a632, no PR yet) moves typed problems forisErrortool results intostructuredContent. It doesn't touch JSON-RPC error frames,unknown_tool_error, orrmcp.rs, so it doesn't overlap with this change.Change
The test now pins the whole wire error object instead of the code alone, so any drift in the message or typed
datafails too:{"code": -32602, "message": "tool project route failed: reason_code=unknown_tool retryable=false: unknown tool: tracedecay_not_a_tool", "data": {"tool": "tracedecay_not_a_tool", "code": "unknown_tool", "reason_code": "unknown_tool", "kind": "invalid_request", "retryable": false, "detail": "unknown tool: tracedecay_not_a_tool"}}No production code changes.
Fail before / pass after
origin/masterd842ec3: FAILED,left: Number(-32602) right: Number(-32603)(output above). It also failed in all 18 full-lib-suite runs of the unmodified master binary.rmcp_wire_matrix_matches_raw_dispatch_initialize_tools_and_resources,raw_json_rpc_wire_frames_are_unchanged_by_the_typed_envelope, andrmcp_tool_call_honours_the_request_meta_caller_deadlineall pass:test result: ok. 3 passed; 0 failed; ... 769 filtered out. It also passed in every loaded full-lib-suite run of a binary with this change.Runtime journey (built CLI, isolated profile)
hauler exec -- cargo build -p tracedecay-cli --no-default-features --features production --locked. The daemon ran undersystemd-run --user --scope -p MemoryMax=6G -p MemorySwapMax=1G ... tracedecay daemon run --socket $HOME/.tracedecay/daemon.sock, with a scratchHOME, a one-file git project, andtracedecay init. Thentracedecay serve -p <project>was driven over stdio like an MCP host:The shipped server answers exactly the pinned frame.
Checks
cargo clippy -p tracedecay --all-targets --features test-transport -- -D warnings: cleancargo fmt --all -- --check: cleanripwire --quality-delta: gating=0; the only rows are minor verbosity and churn on the test itself