Repository navigation
fix: preserve compact MCP tool routing guidance - #1668
Conversation
|
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
|
The remaining failing check is FR-011's merge-base latency comparison on head In the head run, Could a maintainer rerun the failed FR-011 job on this same head to check whether it reproduces? My current repository permissions do not allow workflow reruns. If it reproduces, I will investigate the latency before marking this ready for review. The Codecov comment reports that all modified coverable lines are covered; there is no failed Codecov check in the current rollup. A Codecov rerun would not rerun FR-011. |
|
Thanks @copystring, this is a real fix and a clean one. Compact What I did on your branch (your three commits untouched, authorship preserved):
On the FR-011 failure: it is runner noise, not your change. Your diff does not touch Next step is to confirm CI on the new head; then this is ready to flip out of draft whenever you like. |
…dance; align docs and comments Review follow-ups to smart-mcp-proxy#1668: - toolslist_snapshot_test pins the retrieve_tools and call_tool_* deltas against the frozen pre-105 capture with test-owned sentences instead of substituting the live description after a prefix check. - The code_execution-mode isolation test asserts the live selection-guide heading is absent, and the retrieve_tools-mode test asserts it present, so neither can pass vacuously. - DeriveCallWith's doc comment no longer tells agents to override the read default from descriptions; call_with is authoritative, and the server tier gate plus the profile unannotated policy decide admission. - docs/features/search-discovery.md, docs/configuration.md and the mcp.go entry-builder comment list call_with in the compact shape and drop the 'byte-identical' claim for full mode.
|
Thanks @copystring, good catch and a clean fix. The live check (compact and full mode, with annotated, destructive and unannotated tools) matched, and the change is a net token saving on every golden. I pushed one commit on top of your branch: the pre-105 snapshot test now pins the exact description delta with test-owned sentences, the code_execution isolation assertion checks the live heading so it cannot pass vacuously, and the docs plus the DeriveCallWith comment say call_with is authoritative. I marked the PR ready and armed auto-merge; it lands when CI is green. |
Compact
retrieve_toolsentries omitcall_with, while agents are told to select a call variant using tool-name heuristics. This can route tools such aswindows:PowerShellthrough the wrong variant even though the proxy already has an authoritative upstream classification.This change includes the same
call_withroute in each compact entry as full mode, including the existingcall_tool_readfallback when tier annotations are unavailable. Tool descriptions and usage instructions make that route authoritative over names, descriptions, command text, and apparent intent; security tiers and dispatch behavior are unchanged. The compact contract and REST API documentation include the field.Response and tools/list goldens now pin the intended routing fields and guidance. Historical pre099/pre105 captures remain unchanged; enumerated compatibility checks permit only the deliberate description deltas and continue checking all other fields. A structural comparison of the twelve updated JSON fixtures confirmed that ranking, schemas, tool membership, and unrelated data are unchanged.
Validation:
-tags server,nogui), without golden-update environment variables. Includes compact routing parity for read/write/destructive/unannotated tools, Full/Stats/ProfileV3/Spec094 response goldens, tools/list snapshots, read-only profiles, enumerated surface deltas, and historical pre105 compatibility.go test ./internal/server -run '^(TestBuildToolEntry_Compact.*|TestCallToolVariantDescriptionsHonorRouteAnnotations|TestRetrieveToolsInstructions_RetrieveToolsMode|TestRetrieveToolsFullMode_GoldenByteIdentity|TestRetrieveToolsProfileV3_GoldenByteIdentity|TestSpec094Goldens|TestToolsListSnapshot_MatchesMergeBaseGoldens|TestToolsList_ProfilesPresentUnderReadOnlyMode|TestToolsListSnapshot_DeltaIsEnumerated|TestCodeExecutionDescriptions_EnumerationIsAdminOnly|TestMenuSurface_ExactDeltaFromPreFeature)$' -count=1 -v-tags server,nogui.gofmton changed Go files andgit diff --check.Tests used go1.26.9 from the official Windows archive, verified against its official SHA256 manifest. The full Go suite was not run locally; Linux and cross-platform build verification runs in CI.
Additional regression coverage: route parity now covers canonical IDs with and without an explicit server, and bare tool names with an explicit server, across read/write/destructive/unannotated tools. Missing result/tool/identity and unknown-server cases preserve the read fallback. These focused tests pass in personal and server editions. Local Go coverage reports 100% statement coverage for
compactToolCallWith; the rest of the package was not used to infer a patch coverage percentage.