Repository navigation
fix(mcp): don't warn 'gave no tools' for Tool Search-deferred servers - #18576
Conversation
4327e20 to
a49bc9a
Compare
GPT 6.1 Review — ✅ no blocking findingsGPT 6.1 completed its review of This comment is updated in place on each push. Review detailsNo findings. False positive or not applicable? A repository writer can comment: |
UX Review (Opus 5.5) — ⏭️ skippedRevision |
Design Review (Opus 5.5) — 🟡 CONCERNSDesign-level review of Design-Verdict: CONCERNS Nobody has checked that the Watch
[DESIGN-REVIEWED] 9ae5155 Description read[DESCRIPTION-READ] 033603db2ada80da19675e7bff8f5ed546fdc340cf0fe1ae81b3346ce58dd8c0 That sha256 names everything this verdict read: the PR description, plus the 1 evidence file(s) the workflow collected from it and handed this review. It covers that evidence because the media strip replaces every attachment URL with the same placeholder, so an edit swapping one attachment for another would leave the description's captured text identical while what this review judged changed. Recompute it with |
First Principles Review (Opus 5.5) — 🟡 CONCERNSPremise-level review of First-Principles-Verdict: CONCERNS The detector is fixed, but Not justified as shipped
What this change shipsInventory (5 items) — 3 justifiedIntent: stop the start-of-session warning, and the subagent "do not go looking for them" summary, from naming healthy MCP servers whose tools Tool Search has deferred. FIX (#18349).
[FIRST-PRINCIPLES-REVIEWED] 9ae5155 Description read[DESCRIPTION-READ] af5669dc81a69380d47ae5b8e2b240d0c67a0a5d1fb2dac1441307578796c477 That sha256 names the PR description this verdict read. Recompute it with |
Opus 5.5 Review — ✅ no blocking findingsReviewed Verdict parsed from the review's SHA-scoped output markers for commit False positive or not applicable? A repository writer can comment: |
a49bc9a to
356d7c7
Compare
|
Addressed the Design / First Principles BLOCK on head The reviewer's root point: Fix (head |
356d7c7 to
88214c6
Compare
|
Rebased: main moved in files this PR also imports (diagnostics.py) since this head went green; re-synced onto fresh main and re-ran the scoped + diagnostics tests (green). No logic change. CI re-running. |
88214c6 to
75f2a83
Compare
|
Rebased onto current |
75f2a83 to
21400a4
Compare
|
Repushed as Note on Backend Tests shard 5 (3.12 + Windows): the two reds there are |
|
CI settled on rebased head Passing: all 6 review lanes (GPT 6.1, Opus 5.5, Design, First Principles, UX, Security scope), Issue Gate, Decision Ledger Gate, and every CI lane except the items below. The 3 remaining reds are all INHERITED from main, not from this PR:
PR Readiness's '1 blocking readiness item' is the aggregate CI rollup catching the inherited reds above. This is a merge-judgment call for a maintainer (the base needs to fix test_acp_bindings), not a defect in this fix. The branch is rebased clean onto current main and remains a DRAFT. |
21400a4 to
250aad4
Compare
|
Rebased onto main (head |
|
CI on head The remaining reds are inherited from main, not this PR:
A transient |
The zero-tool warning flagged any running, spec-granted MCP server missing from /tools. With MCP Tool Search deferral on (the default), every server's tools are held out of /tools until the model loads one, so at session start nearly every healthy server looked like a tool-name clash victim -- and each subagent was told its core tool servers were unavailable. servers_exposing_no_tools now takes the session's deferral state: under deferral it reports a running granted server only when /mcp proves emptiness (toolCount == 0), staying silent on a positive or unreadable count. With deferral off the existing clash detection is unchanged. The runtime exposes tool_search_deferring() from the wire settings it sent, threaded through _note_zero_tool_servers. Closes #18349
250aad4 to
9ae5155
Compare
|
Rebased onto current main (HEAD |
|
CI is green on head |
KiroCrewCaptain
left a comment
There was a problem hiding this comment.
Approved by a maintainer. Every review lane is clean, the change matches its description, and the automation held this on a category, path or size rule only.
Problem / Motivation
Goal: Stop the "started but gave no tools" warning from firing for MCP servers whose tools are simply deferred by Tool Search.
On a default install, MCP Tool Search is on, which holds every MCP server's tools out of the session's
/toolslist until the model loads one. The zero-tool detector read "running server, not in/tools" as a tool-name clash, so at session start it flagged nearly every healthy server. A read-only probe against kiro-cli under default settings returned 9 of 10 running servers, includingkirocrew-coreandkirocrew-cron.Why it matters
The false warning erodes trust in the real one, and worse:
problem_summary()tells every subagent its named servers are unavailable and "do not go looking for them." On the default path that steers delegated work away from core tool servers that work fine.Not a goal
What changed (motivation → approach → change)
The detector saw a running, spec-granted server absent from
/toolsand called it a dropped-clash victim. Under Tool Search deferral that absence is the normal start-up state of a healthy server, so the signal was wrong by default.Whether a given session defers cannot be read from configuration — kiro-cli defers only once its
minPct/minTokensthresholds are crossed — so the fix reads the evidence the session itself produces. Thetool_searchloader tool is in/toolsexactly when the session is deferring (the model needs it to load deferred MCP tools).servers_exposing_no_toolsinacp/mcp_session_report.pynow derives that signal from the/toolsresult it already reads: when the loader is present, a running granted server is reported only when/mcpproves it empty (toolCount == 0), staying silent on a positive or unreadable count; with no loader present, nothing is deferred, so absence from/toolsremains the clash signal and the existing behaviour is untouched.providers/acp.py's start-time check calls it unchanged — the signal is backend-independent, which matters because that check runs on the kiro backend.Backwards compatibility
Compatible: with no
tool_searchloader in/toolsthe detector behaves exactly as before; only the deferral case, which previously over-reported, changes.Removes nothing: no path, record, validator, key or public function is removed or tightened.
Tests
test/test_mcp_zero_tool_warning.py: with the loader in/tools, a deferred server (positivetoolCount) is not reported; under deferral only atoolCount==0server is reported; an unreadable or missing count under deferral reports nothing; the same server shapes with no loader are still reported as a clash; an mcp-sourced tool merely namedtool_searchdoes not count as the loader; plus provider-level coverage that the loader-in-/toolscase records nothing.Reverting the new check turns the deferral tests red.
Manual verification
N/A — unit coverage sufficient; the change is a pure decision over
/mcp//toolspayloads with no I/O or UI.Pattern harvest
Not generalizable: a single detector reading absence-from-a-list as evidence while a feature deliberately defers that list — specific to the Tool Search /
/toolsinteraction.Related Issues
Closes #18349