Repository navigation
fix(mcp): keep tool descriptions free of runtime state - #4529
ScriptedAlchemy wants to merge 2 commits into
Conversation
|
f404b45 to
d5b13e2
Compare
90909cd to
bafe3fd
Compare
05f3027 to
770114e
Compare
bafe3fd to
8dfc5c0
Compare
770114e to
017328f
Compare
f147012 to
51d151e
Compare
|
The completed-check notification at The uploaded artifact The last reported state was the fifth generation in |
8b07ca6 to
eea3ca0
Compare
51d151e to
c8b0cff
Compare
eea3ca0 to
443b1f9
Compare
c8b0cff to
9174d4f
Compare
…ext-tool-description
Merge #4478 first, followed by #4526, #4510, #4524, #4489, #4485, #4527, #4528, #4530, #4531, #4529, #4534, and #4541.
This PR is number 11 of 13, based on #4531. Merge #4534 next.
Use merge commits. After merging a parent PR, change its child's base to
masterbefore merging the child. Auto-merge is disabled.Stacked on #4531.
Refs #4451 (section 2 only).
Problem
The
tracedecay_contextMCP tool description said "The graph is still warming, and 3 broad context calls are available." It never changed for the life of a session, even aftertracedecay_statusreportedcode_index_freshness: currentandretrieval_serving: serving. Agents read the stale note and skipped TraceDecay.Root cause
tools/listpatched runtime state into the description. In the daemon,cached_project_node_countalways returnedNonefor a project, so every session got the "warming" variant. Hosts also cachetools/list, so even a correct value would have gone stale.Fix
Tool descriptions are static. I deleted the dynamic description path and everything that existed only to feed it:
context_description,context_warming_description,explore_call_budget,get_tool_definitions_with_budget.catalog_discovery_tools_list_payload, andcached_project_node_count.catalog_is_provisionalflag onclaim_catalog_refreshand its warming-catalog test. The version-skewtools/list_changedrefresh stays.The call budget was advisory text only; nothing enforced it. Live state stays in the per-response
freshness:andindexing:lines.Verification
Before, with the installed beta.92 binary on an isolated daemon, a fresh session's
tools/listended with "The graph is still warming, and 3 broad context calls are available." even after status wascurrent.After, with the binary built from this branch, the description has no state text. It is identical while freshness is
warmingand after it iscurrent.Bazel, run with
--disk_cacheandCARGO_BAZEL_TIMEOUT=3600://crates/tracedecay-mcp-catalog/...and//crates/tracedecay-mcp/...: all pass, including the newcontext_description_carries_no_runtime_stateanddiscovery_advertises_rewrite_with_a_state_free_context_description.//crates/tracedecay:unit_test, filtered to the daemon bootstrap tests by exact path anddaemon::tests::handshake::: 21 passed.//crates/tracedecay-cli:core_cli_suite,cli_boundary::: 2 passed.bazel build --config=clippyover the touched crates: clean.The test-first commit changes the two daemon bootstrap assertions to require a static description. I did not capture a clean red unit-test run. The real-surface run above is the failing-before evidence.
🤖 Generated with Claude Code
Independent canonical validation
At
5168aa6b3be88654fbf8acb7122a6666d11333d4, fresh Bazel execution passed 33 catalog tests and 483 MCP tests, plus affected Rust formatting. Invocation:d57c232b-b530-43c1-82c8-d92bb067e90a. No budgets or host settings changed.Fresh daemon handshake coverage: 19 passed, 922 filtered, nonzero helper passed; invocation
9f1bab71-f931-4169-8dad-c7674577bb53. The only local change since the catalog/MCP run corrects two stale comments describing the deleted dynamic patching path.Shipped CLI boundary tests: 2 passed, 205 filtered, exact-count helper passed; invocation
8b69c401-048f-4570-82c5-28c1980f4671. Both exact daemon-bootstrap tests passed (939 filtered), proving catalog discovery while the project writer is blocked; invocationde980baf-e7be-4a2d-9de8-4e1368a561f2. These latter runs include the comment correction; MCP formatting passed again.Stack integration
Merged parent #4531 (
51a435adac93d8e1f7c6eea4ff1a8bbe3b503e88) without conflicts inea18e44c202fcb1b0bf82156bd9f8fafd65b2502. The own delta remains 16 files, 104 additions and 421 deletions. The focused validation above predates this integration; it is not a claim of fresh combined-tree execution. Diff checks passed; combined-head CI remains pending.