Skip to content

test(mcp): pin the typed unknown-tool refusal on the rmcp wire - #2649

Merged
ScriptedAlchemy merged 2 commits into
masterfrom
fleet/master-red-2645
Sep 29, 2026
Merged

ScriptedAlchemy merged 2 commits into
masterfrom
fleet/master-red-2645

Conversation

@ScriptedAlchemy

Copy link
Copy Markdown
Owner

Fixes #2645

Cause: stale pin, not a production regression

rmcp_wire_matrix_matches_raw_dispatch_initialize_tools_and_resources failed at the code assertion:

assertion `left == right` failed: handler error code is a host-visible protocol contract
  left: Number(-32602)
 right: Number(-32603)

The line just before that assertion, assert_last_response_matches_raw_dispatch, already passed. It compares the whole rmcp wire frame with the raw McpServer::handle_request frame for the same request, so the two frames were identical in every field. Only the literal code was stale.

#2517 (a0b5987) changed unknown_tool_error from untyped TraceDecayError::Config, which rendered as -32603, to project_route("unknown_tool", retryable=false). It also added unknown_tool to the invalid_request kinds in project_route_problem_kind. That PR re-pinned the mcp_suite frames but missed this lib test. -32602 is also the code the MCP spec gives for an unknown tool.

Recent changes I checked:

Change

The test now pins the whole wire error object instead of the code alone, so any drift in the message or typed data fails 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/master d842ec3: FAILED, left: Number(-32602) right: Number(-32603) (output above). It also failed in all 18 full-lib-suite runs of the unmodified master binary.
  • This branch, after merging master 8d4fd5e: rmcp_wire_matrix_matches_raw_dispatch_initialize_tools_and_resources, raw_json_rpc_wire_frames_are_unchanged_by_the_typed_envelope, and rmcp_tool_call_honours_the_request_meta_caller_deadline all 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 under systemd-run --user --scope -p MemoryMax=6G -p MemorySwapMax=1G ... tracedecay daemon run --socket $HOME/.tracedecay/daemon.sock, with a scratch HOME, a one-file git project, and tracedecay init. Then tracedecay serve -p <project> was driven over stdio like an MCP host:

initialize.serverInfo: {"name": "tracedecay", "version": "1.0.0-beta.62+b25a8f9f9ec62bdb40670c23b543d8ec0f0bf943.dirty"}
tools/call tracedecay_not_a_tool: {"jsonrpc": "2.0", "id": 2, "error": {"code": -32602, "message": "tool project route failed: reason_code=unknown_tool retryable=false: unknown tool: tracedecay_not_a_tool", "data": {"code": "unknown_tool", "detail": "unknown tool: tracedecay_not_a_tool", "kind": "invalid_request", "reason_code": "unknown_tool", "retryable": false, "tool": "tracedecay_not_a_tool"}}}
tools/call tracedecay_status: isError= None text[:120]= {"graph_statistics":{"reason":"exact_scope_generation_not_ready","state":"unavailable"},...

The shipped server answers exactly the pinned frame.

Checks

  • cargo clippy -p tracedecay --all-targets --features test-transport -- -D warnings: clean
  • cargo fmt --all -- --check: clean
  • ripwire --quality-delta: gating=0; the only rows are minor verbosity and churn on the test itself

#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.
@changeset-bot

changeset-bot Bot commented Sep 29, 2026

Copy link
Copy Markdown

⚠️ No Changeset found

Latest commit: 19e5115

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@ScriptedAlchemy
ScriptedAlchemy merged commit 1d48e19 into master Sep 29, 2026
4 of 5 checks passed
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Sep 29, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-09-29T15:38:11.143815Z 19e5115 PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@ScriptedAlchemy
ScriptedAlchemy deleted the fleet/master-red-2645 branch September 29, 2026 18:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

rmcp_wire_matrix_matches_raw_dispatch_initialize_tools_and_resources red on master

1 participant