Skip to content

fix(acp): read KAS tool exposure off the connected status catalog - #11857

Merged
kyleseaman merged 1 commit into
mainfrom
fix/kas-mcp-readiness-tool-search
Sep 18, 2026
Merged

kyleseaman merged 1 commit into
mainfrom
fix/kas-mcp-readiness-tool-search

Conversation

@iamwhatever

Copy link
Copy Markdown
Contributor

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:

KAS managed MCP readiness timed out after 90s: kirocrew-core: tools not advertised, kirocrew-dashboard: tools not advertised, kirocrew-work: tools not advertised

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 connected entry in _kiro/mcp/status, and an @server/tool tag with source: "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-core injection: the connected status entry carries origin: client and an 82-entry tools catalog, and every didChange snapshot of the session lists only builtin tags (read, write, shell, web). No MCP tag ever arrives, with or without tool_search in 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. KasMcpReadiness in src/kiro_crew/acp/mcp_session_report.py keeps two evidence sets and reads their union: advertised_by_catalog, filled from a connected status entry that carries a non-empty tools list, and advertised_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 (connecting after connected) clears both and needs the next connected catalog or a tag. docs/system-specs/modules/acp-client.md records both wire shapes.

Wire kiro-cli 2.18.0 / 2.20.0 kiro-cli 2.22.0 Before After
connected status with tools catalog yes yes 🟦 not exposure 🟩 exposure
didChange tag @server/tool source: mcp yes never 🟦 exposure, replaces all 🟨 exposure, replaces tag evidence only
connected status without catalog, then tag -- -- 🟦 ready on tag 🟦 ready on tag
tag dropped from a later snapshot -- -- 🟦 pending again 🟦 pending again
reconnect after ready -- -- 🟦 pending again 🟦 pending again

🟩 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: new TestKasReadinessExposure replays 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 _core helper gains catalog=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 in catalog and no-catalog variants: start completes on the connected catalog alone, and still waits for the tag when the entry has none. The unapproved-recall restriction 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/new with a session-level kirocrew-core stdio server and a custom agent, session/set_mode) and logged every _kiro/mcp/status and _kiro/tools/didChange frame for 75 seconds, once with tool_search in the agent's tools and once without. Both runs: kirocrew-core reaches connected with origin: client and 82 catalog entries at ~4s; every didChange snapshot carries only builtin tags. The new TestKasReadinessExposure test 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

  • At most two commits (one is the norm), with a Conventional Commits title (feat|fix|docs|refactor|perf|test|chore|ci|build|revert: ...)
  • Existing tests pass and new tests added for new functionality
  • Self-review completed; code follows project style guidelines
  • Documentation updated (if applicable)
  • No secrets, credentials, or internal references in the diff

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.
@iamwhatever
iamwhatever requested review from a team and krishdhasmana September 18, 2026 18:08
@iamwhatever

Copy link
Copy Markdown
Contributor Author

Intent: Let a KAS session start on kiro-cli releases whose _kiro/tools/didChange snapshot carries no MCP tool tags (2.22.0 / KAS 0.66.0), by accepting the connected status entry's own tools catalog as exposure evidence, without weakening any readiness check that held before.
Not a goal: Changing the connection, provenance or failure semantics of the barrier; fixing the unreported timeout seen in the nightly GUI test (no status frame at all); rewriting how tags are matched to servers.

@github-actions github-actions Bot added the readiness: checking Automated validation is still running label Sep 18, 2026
@github-actions

Copy link
Copy Markdown
Contributor

Design Review (Fable 5) — 🟡 CONCERNS

Design-level review of fca1a49b0d993f71ca337cd8923bf6f4fe93debe — updated in place on each push. A BLOCK verdict blocks PR readiness; PASS/CONCERNS are advisory.

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.

Watch

The 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 didChange frames but never invoked a Crew MCP tool through a 2.22.0 prompt. If that release's missing MCP tags reflect real non-exposure rather than wire drift, this trades a loud 90s timeout for silent spawn_run/cron_add failures at call time on a core path — harder to diagnose than the red bubble it removes. The evidence-union design is right either way (blocking all chat is not the remedy), but the premise is author-verifiable and the PR's own claim "Their tools are there" currently rests on the catalog alone.
Clears when: a 2.22.0 session demonstrably invokes one Crew MCP tool (e.g. memory_recall or learn_add) end-to-end, noted in the PR.

[DESIGN-REVIEWED] fca1a49

@github-actions

Copy link
Copy Markdown
Contributor

GPT 5.6 Review — ✅ no blocking findings

GPT 5.6 completed its review of fca1a49b0d993f71ca337cd8923bf6f4fe93debe and found no blocking issues.

This comment is updated in place on each push.

Review details

FINDING -- src/kiro_crew/acp/mcp_session_report.py:328 -- intersection_update(connected) preserves stale catalog exposure when a later full connected snapshot omits tools, allowing startup without exposure -> Fix: replace catalog evidence with catalogued on every status snapshot.
[GPT-REVIEWED] fca1a49

False positive or not applicable? A repository writer can comment:
/ai-review override gpt fca1a49b0d993f71ca337cd8923bf6f4fe93debe: <one-sentence reason>

@github-actions

Copy link
Copy Markdown
Contributor

First Principles Review (Fable 5) — ✅ PASS

Premise-level review of fca1a49b0d993f71ca337cd8923bf6f4fe93debe — why this exists and whether the shipped surface is the smallest honest version. Updated in place on each push. A BLOCK verdict blocks PR readiness; PASS/CONCERNS are advisory.

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 ships

Inventory (5 items) — 5 justified

Intent: 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.

  1. KAS session start succeeds on kiro-cli 2.22.0 instead of a 90s timeout — justified
  2. A connected status entry's non-empty tools catalog now counts as exposure evidence — justified
  3. A full tag snapshot retracts only tag evidence, never catalog evidence — justified
  4. Reconnect still voids prior exposure, now for both evidence kinds — justified
  5. Old "connected still needs a tag" pins rewritten; tag-only path re-pinned via catalog=False — justified

[FIRST-PRINCIPLES-REVIEWED] fca1a49

@github-actions

Copy link
Copy Markdown
Contributor

Opus 4.8 Review — ✅ no blocking findings

Reviewed fca1a49b0d993f71ca337cd8923bf6f4fe93debe — this comment is updated in place on each push.

Review details

I've independently traced the change. The discovery pass reported no candidates, and my own examination confirms the logic is sound:

  • The provenance guard is preserved: catalogued.add(name) only fires when the final state == "connected", which excludes STATE_CONNECTED_WITHOUT_PROVENANCE and non-client entries (those continue earlier or get reassigned).
  • Reconnect semantics hold: both advertised_by_catalog and advertised_by_tag are intersected against the freshly-rebuilt connected set each status frame; catalogued ⊆ connected ⊆ required.
  • Empty catalogs are correctly rejected (and catalog falsy-guards []).
  • advertised field→property conversion is safe: every .advertised reference in this module is a read; no external assignment or advertised= construction exists.
  • The owning spec (acp-client.md) is updated in the same commit.

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 fca1a49b0d993f71ca337cd8923bf6f4fe93debe.

False positive or not applicable? A repository writer can comment:
/ai-review override fable fca1a49b0d993f71ca337cd8923bf6f4fe93debe: <one-sentence reason>

@github-actions github-actions Bot added readiness: passed Eligible automated validation passed for the current revision and removed readiness: checking Automated validation is still running labels Sep 18, 2026
@iamwhatever

Copy link
Copy Markdown
Contributor Author
  • rebutted span=d48383a76f3d — the catalog-vs-tag distinction is not lost; on 2.22.0 the model demonstrably reaches Crew MCP tools with catalog-only exposure

Evidence: the session that authored this PR runs on kiro-cli 2.22.0 / KAS 0.66.0 (the same release the probe captured) with the kirocrew agent (tool_search + @kirocrew-core), and invoked kirocrew-core::learn_add (saved a lesson), kirocrew-core::spawn_run (four sub-agents completed) and kirocrew-core::monitor_start end-to-end. That release never emits an MCP tag, so every one of those calls went through with exactly the exposure evidence this PR accepts: a connected status entry carrying the catalog.
The Crew build hosting that session predates #11018 (no barrier), which is the point: reachability is a property of the KAS wire, not of the barrier. The barrier only decides whether Crew waits; it cannot make a tool reachable or unreachable.
The tag path is retained unchanged for releases that send tags (2.18.0/2.20.0), so no release loses the cross-check it can actually provide.

@iamwhatever

Copy link
Copy Markdown
Contributor Author
  • rebutted span=c56f3a4ffa5b — keeping catalog evidence across a connected snapshot that omits tools is the safer direction, and the omitted-catalog-while-connected shape is not on any captured wire

Every captured release (2.18.0, 2.20.0, 2.22.0) carries tools on every connected status entry; the probe behind this PR saw 82 entries on each connected frame. A connected entry with no tools after one that had them is a hypothetical shape.
Asymmetry: if that shape did occur, the proposed replace would drop exposure and re-open the 90s startup timeout (total outage, the defect this PR fixes); the current code at worst keeps exposure for a server that is still connected. A reconnect (connecting) still clears it.
Advisory, not a defect: no reachable trigger on a released kiro-cli; code kept as-is.

@kyleseaman
kyleseaman enabled auto-merge (squash) September 18, 2026 18:45
@kyleseaman
kyleseaman merged commit 7f060d9 into main Sep 18, 2026
85 checks passed
@kyleseaman
kyleseaman deleted the fix/kas-mcp-readiness-tool-search branch September 18, 2026 18:46
@github-actions github-actions Bot removed the readiness: passed Eligible automated validation passed for the current revision label Sep 18, 2026
amadsalmon pushed a commit to amadsalmon/KiroCrew that referenced this pull request Sep 22, 2026
…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>
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.

3 participants