Repository navigation
fix(acp): read KAS tool exposure off the connected status catalog - #11857
Conversation
The KAS managed MCP readiness barrier took an `@server/tool` tag in `_kiro/tools/didChange` as the only proof that a connected managed server's tools are exposed. Captured kiro-cli 2.22.0 (KAS 0.66.0) never sends one: every `didChange` snapshot lists only `builtin` tags, with or without `tool_search` in the agent, while the connected `_kiro/mcp/status` entry still carries the full `tools` catalog. Every KAS session start on that release therefore died at the 90s budget with `kirocrew-core: tools not advertised, kirocrew-dashboard: ..., kirocrew-work: ...`. A connected entry that carries a non-empty catalog now counts as exposed. A tag frame adds exposure and no longer replaces it, so the builtin-only snapshot that arrives with the connected status cannot retract the catalog. A reconnect still clears exposure and needs fresh evidence.
|
Intent: Let a KAS session start on kiro-cli releases whose |
Design Review (Fable 5) — 🟡 CONCERNSDesign-level review of Design-Verdict: CONCERNS The fix's load-bearing premise — that a 2.22.0 catalog entry means the model can actually invoke the tools — was never verified by a tool call. WatchThe barrier existed to distinguish "server advertises tools" (the status catalog) from "the model can reach them" (the harness tag). On 2.22.0 the tag never arrives, so the fix collapses that distinction on exactly the release where it can't be cross-checked: the manual verification logged status and [DESIGN-REVIEWED] fca1a49 |
GPT 5.6 Review — ✅ no blocking findingsGPT 5.6 completed its review of This comment is updated in place on each push. Review detailsFINDING -- src/kiro_crew/acp/mcp_session_report.py:328 -- False positive or not applicable? A repository writer can comment: |
First Principles Review (Fable 5) — ✅ PASSPremise-level review of First-Principles-Verdict: PASS Verify on kiro-cli 2.22.0 that an MCP tool is actually callable after catalog-based readiness — the capture logged status frames, not a successful tool invocation. What this change shipsInventory (5 items) — 5 justifiedIntent: FIX — KAS chat on kiro-cli 2.22.0 always timed out at the readiness barrier because that release never sends MCP tool tags; accept the connected entry's own tools catalog as exposure evidence.
[FIRST-PRINCIPLES-REVIEWED] fca1a49 |
Opus 4.8 Review — ✅ no blocking findingsReviewed Review detailsI've independently traced the change. The discovery pass reported no candidates, and my own examination confirms the logic is sound:
No grounded, reachable defect in the changed lines. No findings. [OPUS-REVIEWED] fca1a49 Verdict parsed from the review's SHA-scoped output markers for commit False positive or not applicable? A repository writer can comment: |
|
|
…rodotdev#11857) The KAS managed MCP readiness barrier took an `@server/tool` tag in `_kiro/tools/didChange` as the only proof that a connected managed server's tools are exposed. Captured kiro-cli 2.22.0 (KAS 0.66.0) never sends one: every `didChange` snapshot lists only `builtin` tags, with or without `tool_search` in the agent, while the connected `_kiro/mcp/status` entry still carries the full `tools` catalog. Every KAS session start on that release therefore died at the 90s budget with `kirocrew-core: tools not advertised, kirocrew-dashboard: ..., kirocrew-work: ...`. A connected entry that carries a non-empty catalog now counts as exposed. A tag frame adds exposure and no longer replaces it, so the builtin-only snapshot that arrives with the connected status cannot retract the catalog. A reconnect still clears exposure and needs fresh evidence. Co-authored-by: Joe Guo <zejiangg@amazon.com>
Problem / Motivation
Every KAS chat on a machine with kiro-cli 2.22.0 fails to start. After 90 seconds the user sees a red bubble:
The servers are connected. Their tools are there. Crew still refuses to prompt.
Why it matters
No KAS session can start on that kiro-cli release. The Crew MCP tools (
spawn_run,learn_add,cron_add, the dashboard and work servers) are what the barrier guards, so there is no fallback: the user cannot chat at all. Every machine that updated Crew past #11018 and kiro-cli to 2.22.0 is hit.What changed (motivation → approach → change)
The readiness barrier waited for two things per managed server: a
connectedentry in_kiro/mcp/status, and an@server/tooltag withsource: "mcp"in_kiro/tools/didChange. The tag was the only proof that the tools are exposed.Captured off the wire from kiro-cli 2.22.0 (KAS 0.66.0), with the production relay spawn and a session-level
kirocrew-coreinjection: the connected status entry carriesorigin: clientand an 82-entrytoolscatalog, and everydidChangesnapshot of the session lists onlybuiltintags (read,write,shell,web). No MCP tag ever arrives, with or withouttool_searchin the agent. The tag requirement can never be met, so every start runs to the timeout.The connected entry's own catalog is now exposure evidence too.
KasMcpReadinessinsrc/kiro_crew/acp/mcp_session_report.pykeeps two evidence sets and reads their union:advertised_by_catalog, filled from a connected status entry that carries a non-emptytoolslist, andadvertised_by_tag, replaced by each full tag snapshot exactly as before. So the builtin-only tag snapshot that arrives with the connected status cannot wipe the catalog evidence, while a tag that disappears from a later snapshot is still retracted. A reconnect (connectingafterconnected) clears both and needs the next connected catalog or a tag.docs/system-specs/modules/acp-client.mdrecords both wire shapes.toolscatalogdidChangetag@server/toolsource: mcp🟩 added · 🟨 changed · 🟦 unchanged
Backwards compatibility
Compatible: every start that reached readiness before still does, and every retraction that happened before still happens. The change only adds a second way to satisfy the exposure half of the barrier; connection, provenance and failure states are untouched.
Tests
test/test_mcp_session_report.py: newTestKasReadinessExposurereplays the 2.22.0 wire (builtin-only tags, then connected with catalog, then builtin-only tags again) and asserts ready; locks in that an empty catalog is not exposure, that a reconnect clears both evidence kinds, that a tag frame adds tag evidence without clearing catalog evidence, and that a full tag snapshot still retracts a dropped tag. The_corehelper gainscatalog=False, and three provenance tests now use it so they keep proving the tag path.test/test_acp_runtime.py: the hoisted-core readiness test runs incatalogandno-catalogvariants: start completes on the connected catalog alone, and still waits for the tag when the entry has none. Theunapproved-recallrestriction case is ready on its catalog with no tag.Related sets pass: 495 tests across the four ACP/readiness files, 578 across the KAS and session-handle files.
Manual verification
Probed kiro-cli 2.22.0 directly over ACP (
kiro-cli acp --agent-engine v3 --auth-method cli,initialize,session/newwith a session-levelkirocrew-corestdio server and a custom agent,session/set_mode) and logged every_kiro/mcp/statusand_kiro/tools/didChangeframe for 75 seconds, once withtool_searchin the agent's tools and once without. Both runs:kirocrew-corereachesconnectedwithorigin: clientand 82 catalog entries at ~4s; everydidChangesnapshot carries onlybuiltintags. The newTestKasReadinessExposuretest is built from those frames.Related Issues
no linked issue: reported from the dashboard error bubble. #11762 and #11764 show the same barrier timing out in the nightly GUI test, but with
unreported(no status frame at all), which is a different pending state this change does not address.Pattern harvest
Not generalizable: a backend wire drift between kiro-cli releases; the fix accepts the evidence both releases send rather than adding a rule.
Checklist
feat|fix|docs|refactor|perf|test|chore|ci|build|revert: ...)