Repository navigation
fix(acp): run a Kiro CLI pick on KAS outside the gateway too - #25808
Conversation
UX Review (Opus 5.5) — ⏭️ skippedRevision |
Design Review (Opus 5.5) — ✅ PASSDesign-level review of Design-Verdict: PASS Nothing blocks: the per-process probe uses the gateway floor's own evidence and promotion rule, and only a stored Kiro CLI pick off the bundle route runs it. Notes
[DESIGN-REVIEWED] a801fa9 Description read[DESCRIPTION-READ] dd9d1aadad59411f19b07abf3093362df444d7b835f1d339fb2f2ccc26861923 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) — ✅ PASSPremise-level review of First-Principles-Verdict: PASS The fix sits at the cause: non-gateway spawn entries now get the same v3 evidence the gateway records. The four call sites cover every non-gateway Notes
What this change shipsInventory (8 items) — 7 justifiedIntent: a stored Kiro CLI pick should run on KAS in every Kiro Crew process where kiro-cli offers v3, as
[FIRST-PRINCIPLES-REVIEWED] a801fa9 Description read[DESCRIPTION-READ] ed78e7bcd37dbfe9751c2e4f0fd6ea5ab8898e49901f7ad259c56267a15bb24f 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: |
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: |
a17cd90 to
37b6d88
Compare
|
Re: Opus 5.5 review — fixed in 37b6d88. The per-process helper now declines the bundle route, matching the gateway floor. |
|
Re: GPT 6.1 review — fixed in 37b6d88.
|
37b6d88 to
c8a61c4
Compare
|
Re: Opus 5.5 review — fixed in c8a61c4. The owning specs now match the code. harness-parity.md H1 names |
A stored Kiro CLI pick (agent.acp_backend: "kiro") moves onto Crew's KAS path only inside the gateway, because the evidence that kiro-cli offers its v3 engine is process-local: confirm_kiro_cli_offers_kas() is set only by the gateway's KAS floor. A process that never runs the floor still starts the v2 kiro-cli acp launch, which is driven as v2 even where kiro-cli serves v3. Add ensure_kiro_cli_kas_verdict(): gated on the stored pick being Kiro CLI and the bundle route being off (two cheap document reads, no spawn for a default/kas/claude/codex backend, and the bundle route stays on kiro-cli just as the gateway floor keeps it). It runs one bounded acp --help probe at most once per process -- lock-guarded for concurrent callers -- and records the verdict on positive evidence only, the same promotion rule the floor uses. Every non-gateway spawn entry (kirocrew chat, the eval runner, the task runner, history consolidation) calls it before its config load, so the pick reads as KAS the same way the gateway reads it. The gateway path and kirocrew doctor are unchanged. Part of #25288. Fixes #25695.
c8a61c4 to
a801fa9
Compare
KiroCrewCaptain
left a comment
There was a problem hiding this comment.
Approved on behalf of the watch holder (bolichen). Design and First Principles pass on this head (or skipped / author override), UX skipped or pass, no conflict, no open change request.
Problem / Motivation
Goal: A stored Kiro CLI harness pick runs on Kiro Agent (KAS) in every Kiro Crew process where the installed kiro-cli offers its v3 engine, not only inside the gateway.
A user who stored
agent.acp_backend: "kiro"has that pick moved onto Crew's KAS path only inside the gateway. The evidence that kiro-cli offers v3 is process-local —confirm_kiro_cli_offers_kas()is set only by the gateway's KAS floor — sokirocrew chat(and the eval, task and consolidation processes) still starts the bare v2kiro-cli acplaunch. Where kiro-cli already serves a bareacpon v3, that launch drives a v3 engine as the v2 harness (wrong skill-view aliases,cli.jsonoverlay and re-filtered specs).Why it matters
Once kiro-cli serves v3 by default, a Kiro CLI pick run outside the gateway hits the v3-driven-as-v2 mismatch the KAS-pick decision exists to prevent: the terminal chat and background runs would silently diverge from the gateway for the same user on the same config.
Not a goal
kas/claude/codexpay no probe and start exactly as before.kirocrew doctor(already correct).What changed (motivation → approach → change)
Root cause: the v3 evidence is process-local and only the gateway floor records it. Approach: of the two options (a per-process bounded probe, or a cached verdict keyed on the pinned kiro-cli version), take the per-process probe — it reuses the exact mechanism and positive-evidence-only rule the gateway floor already uses, adds no persistence or cache-invalidation surface, and cannot promote on a stale verdict after a kiro-cli downgrade.
Change: add
ensure_kiro_cli_kas_verdict()beside the existing process flag. It returns when evidence is already recorded; gates on two cheap document reads (acp_backend_stored_as_kiro,acp_backend_bundle_route) so it probes only for a Kiro CLI pick off the bundle route; otherwise runs the one boundedacp --helpprobe and records the verdict on positive evidence only. It is probe-once and lock-guarded, so concurrent callers run the spawn exactly once. Every non-gateway process that loads config and spawns an ACP agent calls it before its config load:cli_chat._chat,cli_commands_eval._run_eval,cli_server._run_task,cli_knowledge._consolidate_cmd. The bundle-route and policy-denied cases keep the v2 launch, matching the gateway floor.Backwards compatibility
Compatible: the change is purely additive — a new helper and four call sites, each gated on the stored pick being Kiro CLI off the bundle route. No field, kind, validator or key is rejected, renamed or removed.
Removes nothing: no path is hidden, no record or key deleted, no validator tightened, no public function removed; a non-kiro backend takes exactly the path it took before.
Tests
test/test_cli_chat.py::test_a_stored_kiro_pick_runs_on_kas_in_cli_chat— end-to-end through the CLI entry: a stored kiro pick with a v3-positive probe resolves to KAS at the provider factory.test/test_acp_backend_kas.py::TestAProcessOutsideTheGatewayReachesTheSameVerdict— the helper: positive-evidence promotion, unknown/gap keep v2, non-kiro backend spends no probe, bundle route spends no probe, KAS-not-selectable spends no probe, probe-once, and concurrent callers probe exactly once.Proof: not provable -- prove.py is not installed on this host; the CLI end-to-end test is confirmed to fail on origin/main (provider factory handed the v2 launch,
'') and pass on the branch (kas).Manual verification
N/A — unit coverage sufficient: the config-load remap and all four call sites are exercised by the tests above.
Screenshots / video
N/A — no user-visible frontend surface is touched (backend harness resolution only).
Related Issues
Part of #25288. Fixes #25695.
Sibling sweep
Swept: git grep -nE "acp_backend_stored_as_kiro|kiro_cli_pick_backend|confirm_kiro_cli_offers_kas" -- src/
Sibling: src/kiro_crew/platform/bootstrap.py:apply_kas_cli_floor -- not affected -- the gateway floor already records the verdict and already declines the bundle route; this helper mirrors its rule for non-gateway processes.
Siblings: none other -- the gap is specific to processes that never run the floor, which are the four spawn entries wired here.
Pattern harvest
Not generalizable: this is a single process-local-evidence gap specific to the KAS-pick promotion; the fix is to reach the same verdict the gateway floor already establishes.
Checklist