Repository navigation
fix(acp): let Crew's own MCP servers defer under Tool Search on 0.8 (release/0.8.0) - #17271
Conversation
…release/0.8.0) Backport of #16131, #16700 and #17250 to release/0.8.0, plus the kiro_cli.chat_sibling helper #16131 calls (from #14982; only the helper, not #14982's KAS spawn change). - #16131: ASBX_KIRO_MANDATORY_MCPS no longer pins every Crew-owned MCP server resident. They defer under Tool Search when the spawn runs the pinned kiro-cli (or its chat sibling) at >= 2.27.0; any other binary or version keeps them resident. An operator's ambient value still wins. - #16700: a deferred call's rawInput is {"tool_id", "arguments"}; the directive consumer now digests the arguments, so monitor_start, monitor_update and autonudge_stop claim their parked record instead of being dropped with CLAIM MISS input-differs. - #17250: the bundled kiro-cli moves from 2.24.0 to 2.27.1, without which the >= 2.27.0 gate never opens on a desktop install. - chat_sibling: without it mandatory_mcps_drop_allowed raises NameError, which it swallows, so deferral would silently never apply on this branch. (cherry picked from commits af16284, af2619f, 9348a25)
Design Review (Fable 5) — ✅ PASSDesign-level review of Design-Verdict: PASS Smoke the 0.8 desktop bundle end-to-end on 2.27.1 — the pin jumps three CLI minors into a stable line, beyond the deferral matrix the PR verified. [DESIGN-REVIEWED] 6d2f99c |
First Principles Review (Fable 5) — ✅ PASSPremise-level review of First-Principles-Verdict: PASS Confirm the 2.27.1 artifact sha256s and the 2.27.0 thinking-signature matrix — both rest solely on the author's recorded manual verification. What this change shipsInventory (9 items) — 9 justifiedIntent: FIX — stop every 0.8 desktop chat paying Crew's resident tool schemas (~27k tokens, #15899) each turn, by backporting #16131/#16700/#17250.
[FIRST-PRINCIPLES-REVIEWED] 6d2f99c |
GPT 5.6 Review — ✅ no blocking findingsGPT 5.6 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: |
Opus 5 Review — ✅ no blocking findingsReviewed Review detailsThe version gate's trust premise contradicts this module's own recorded launcher-resolution rule, so it can clear Crew-MCP deferral on a FINDING — src/kiro_crew/kiro_cli.py:75 — FINDING — src/kiro_crew/kiro_cli.py:178 — the new docstrings state a contract no code implements: "callers fall back to binary unchanged" and "a KAS spawn … has to enter through the chat binary … (the KAS spawn skips that sibling for the same reason)", while FINDING — src/kiro_crew/config/sections.py:1273 — the help enumerates the resident cases as "any other executable, an older or unknown version" but omits the unconditional [OPUS-REVIEWED] 6d2f99c Verdict parsed from the review's SHA-scoped output markers for commit False positive or not applicable? A repository writer can comment: |
Problem / Motivation
Goal: On 0.8, Crew's own MCP servers defer under Tool Search like third-party servers, so a desktop chat no longer carries every Crew tool schema on every turn.
Backport of #16131, #16700 and #17250 to release/0.8.0. On this branch
ASBX_KIRO_MANDATORY_MCPSkeeps every Crew-owned server resident on every spawn (a desktop gateway's children carryarcc-governance,builder-mcp,creds-agent,kirocrew-aim,kirocrew-computer,kirocrew-core,...), and the bundled kiro-cli is 2.24.0, below the floor #16131 needs.Why it matters
Those resident schemas are a large fixed share of every new 0.8 chat's context (#15899 measured about 27k tokens for
kirocrew-corealone), paid again on every turn, on the channel most users run.Not a goal
kiro-cli-chat); only itschat_siblinghelper comes along.What changed (motivation → approach → change)
0.8 keeps Crew's tool schemas resident because the mandatory list is applied unconditionally and the bundled CLI is too old to defer them safely.
pin_mandatory_mcps_envdrops the list only when the spawn runs the pinned kiro-cli (or its chat sibling) at >= 2.27.0; any other binary or version keeps every Crew server resident; an operator's ambient value still winsrawInputis{"tool_id", "arguments"};event_input_digesthashes the arguments, somonitor_start,monitor_updateandautonudge_stopclaim their parked record instead ofCLAIM MISS input-differspackaging/kiro-cli-version2.24.0 -> 2.27.1 with the manifest sha256s, so the floor opens on desktop installskiro_cli.chat_siblingNameError, swallows it, and deferral never applies on this branchsrc/kiro_crew/kiro_cli.pyandsrc/kiro_crew/session_directive.pymatch main byte for byte; the harness edits insrc/kiro_crew/acp/harness/andsrc/kiro_crew/acp/runtime.py,src/kiro_crew/agent_sdk/tool_search.py,src/kiro_crew/config/sections.py,config-baseline.jsonanddocs/are the upstream hunks.Backwards compatibility
Compatible: on any spawn that is not the pinned >= 2.27.0 install, Crew's servers stay resident exactly as today; an explicit
ASBX_KIRO_MANDATORY_MCPS(including empty) is honoured verbatim.Reader: src/kiro_crew/acp/harness/_common.py:apply_mandatory_mcps_env -- release -- removed; its one caller (
apply_spawn_envin the kiro/KAS harnesses) now callspin_mandatory_mcps_envReader: src/kiro_crew/agent_sdk/tool_search.py:MANDATORY_MCPS_ENV, mandatory_mcps_env_value -- release -- removed; no remaining importer on this branch (grep)
Reader: test/test_acp_mandatory_mcps.py -- release -- replaced by test/test_acp_tool_search_spawn_env.py
Tests
Carried from upstream:
test/test_acp_tool_search_spawn_env.py(the gate for pinned, sibling, old, override, pod and missing binaries; the env pinning per harness), the #16700 envelope-unwrap tests, andtest/test_spawn_audit.py. On this branch the fourtest_deferral_requires_the_pinned_installcases fail without thechat_siblinghelper and pass with it.Manual verification
kiro-cli-chatneeds GLIBC_2.34 (x86_64) / GLIBC_2.30 (aarch64); the MSI has noCustomActiontable (as in build(desktop): bundle kiro-cli 2.27.1 so Crew's MCP servers defer under Tool Search #17250).ps -E), as quoted above.Related Issues
Part of #17247
Pattern harvest
Rule candidate: review-prompt
Pattern: a backported helper call inside a never-raises guard turns a missing dependency into a silent no-op; backport tests must assert the positive branch
Checklist
feat|fix|docs|style|refactor|perf|test|chore|ci|build|revert: ...)