Skip to content

fix(doctor): fail when kiro-cli-chat cannot launch - #23235

Merged
KiroCrewCaptain merged 1 commit into
kirodotdev:mainfrom
JLargent42:fix/doctor-kiro-cli-chat-probe
Oct 30, 2026
Merged

KiroCrewCaptain merged 1 commit into
kirodotdev:mainfrom
JLargent42:fix/doctor-kiro-cli-chat-probe

Conversation

@JLargent42

@JLargent42 JLargent42 commented Oct 22, 2026 •

Copy link
Copy Markdown
Contributor

Problem / Motivation

Goal: kirocrew doctor fails with "Kiro CLI is broken: reinstall it" when the kiro-cli-chat binary every session runs cannot start, instead of reporting the install healthy.

Doctor's Connectivity row runs kiro-cli --version. The kiro-cli launcher answers that itself and never starts kiro-cli-chat. On a host where ~/.local/bin/kiro-cli-chat links to a release an upgrade removed, doctor prints kiro-cli: ✅ and exits 0, while every session dies with process exited (rc=None) / (rc=1).

Why it matters

Several users hit this in one week and lost time before someone found that a reinstall fixes it. #22980 made the runtime error name the fix. Doctor is the first thing a user or the on-call runs, and it still says nothing is wrong.

Not a goal

  • Repairing the install. Crew does not own Kiro CLI's links; the remedy stays "reinstall Kiro CLI".
  • Changing which binary the gateway spawns, or the launcher's own kiro-cli --version row.
  • Windows, where Kiro CLI ships one self-contained kiro-cli.exe with no separate chat binary.

What changed (motivation → approach → change)

Symptom: doctor passes a broken install. Cause: it only asks the launcher, which answers --version without starting the chat binary.

A new Connectivity row, kiro-cli-chat, runs kiro-cli-chat --version with a 5-second timeout. It looks for the chat binary where the launcher does: ~/.local/bin, then PATH, never the launcher's own directory. The exception is a macOS launcher inside Kiro CLI.app/Contents/MacOS, which runs the chat binary next to it, so that one is probed. A path counts as soon as the link exists, even if it is dangling, so a broken ~/.local/bin link is not hidden by a working copy beside the launcher or later on PATH. A bundled kiro-cli-chat entry is probed directly.

A missing binary, a dangling link, a non-zero exit or a timeout prints ❌ Kiro CLI is broken: <reason> with the fix "reinstall Kiro CLI (rerun its installer), then rerun kirocrew doctor". When the harness selected for either role runs kiro-cli (the Kiro CLI backend, or KAS through kiro-cli's relay, as agent.acp_backend or as the crewmate backend agent.member_acp_backend), it is added to doctor's issues and doctor exits 1. For any other harness (Claude, a KAS bundle, others) the same line prints as ⚠️ "not used by the selected backends" and doctor's exit code is unchanged, like the existing kiro-cli --version row. When relay KAS is selected for either role and Crew's vault holds a usable identity, its spawn enters through the kiro-cli-chat beside the launcher instead of the ~/.local/bin delegate (the same swap KasHarness.resolve_spawn makes, never for an operator KIROCREW_KIRO_BIN; doctor asks the harness's own override rule through the new kas_operator_override wrapper in src/kiro_crew/agent_sdk/kas_bundle.py rather than keeping a copy). services.kas_relay_entry resolves that binary and doctor probes it on its own, whatever the delegate returned, so a healthy delegate cannot hide a broken relay entry; a broken relay entry is fatal. The delegate is probed as well and is fatal when the Kiro CLI backend is also selected (a mixed selection runs both binaries). With relay KAS alone, a broken delegate next to a working relay entry is reported as ⚠️ advisory. The row stays silent when there is no kiro-cli, on Windows, and when KIROCREW_KIRO_BIN names a wrapper whose chat binary cannot be known.

Backwards compatibility

Compatible: a healthy install gets one extra ✅ row; doctor now exits 1 only when the selected harness runs kiro-cli and no session can start.

Removes nothing: the change adds a row and removes no row, field or path.

Tests

  • test/test_doctor_kiro_chat_delegate.py runs real files: a healthy chat binary passes; a dangling ~/.local/bin link, a non-zero exit, a hang past the timeout and a missing binary each report the reinstall fix and add an issue; a dangling link is not skipped for a working copy on PATH or beside the launcher; a bundled chat entry and a macOS .app sibling are probed; with required=False a broken delegate prints ⚠️ and adds no issue; no launcher or an unknown wrapper prints nothing.

  • test/test_cli_doctor_refactor_report.py: the frozen report pins the new row's position after the kiro-cli Connectivity row that it shares doctor's issues list, and that it is fatal for the Kiro CLI backend and relay KAS (main or crewmate backend, the latter in src/kiro_crew/cli_doctor.py) but advisory for a KAS bundle and Claude on both roles.

  • test/spawn_audit_helpers.py: the new kiro-cli-chat --version spawn is listed in BENIGN_SPAWNS with its justification (fixed argv, 5s, read-only, the same binary every session start already execs), so test_spawn_audit keeps passing.

Manual verification

N/A: the unit tests run the probe through a real exec of on-disk scripts and links, which is the behaviour at issue.

Related Issues

Closes #23232

Sibling sweep

Swept: git grep -n "resolve_kiro_cli()" -- src/kiro_crew/cli_doctor.py src/kiro_crew/cli_doctor_parts src/kiro_crew/doctor_checks
Sibling: src/kiro_crew/cli_doctor_parts/host_probes.py:57 -- not affected -- runs whoami, a sign-in question the launcher answers correctly
Sibling: src/kiro_crew/cli_doctor_parts/kas_relay.py:122 -- not affected -- reads acp --help for relay capability, not launchability; the new row covers the launch

Pattern harvest

Rule candidate: review-prompt
Pattern: a health check that probes a launcher or wrapper instead of the binary it delegates to

Checklist

  • At most two commits (one is the norm), with a Conventional Commits title
  • 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

@JLargent42
JLargent42 requested review from a team and KiroCrewCaptain as code owners October 22, 2026 23:30
@JLargent42
JLargent42 requested a review from mbriones98 October 22, 2026 23:30
@github-actions github-actions Bot added fork Pull request from a fork (external contributor) readiness: checking Automated validation is still running labels Oct 22, 2026
@JLargent42
JLargent42 force-pushed the fix/doctor-kiro-cli-chat-probe branch from d01214d to f6d281f Compare October 22, 2026 23:32
@github-actions

github-actions Bot commented Oct 22, 2026 •

Copy link
Copy Markdown
Contributor

UX Review (Opus 5.5, fork) — ⏭️ skipped

Revision 03c9dc8fcb441ac5d06de6a87fa591535fe71d2c touches no user-facing surface (no changes under website/ or committed screenshots), so the UX review was skipped. Does not block merge.

@github-actions

github-actions Bot commented Oct 22, 2026 •

Copy link
Copy Markdown
Contributor

First Principles Review (Opus 5.5, fork) — ✅ PASS

Premise-level review of 03c9dc8fcb441ac5d06de6a87fa591535fe71d2c via the fork AI-review pipeline — 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 does not.

First-Principles-Verdict: PASS

Nothing blocks. One minor note: the new kas_operator_override function only passes a call through, and it has one caller.

Notes

  • Item 5 — one consumer, generalized: kas_operator_override in agent_sdk/kas_bundle.py is a public one-line call to acp/harness/kas.py:_is_operator_override. I grepped kas_operator_override and found one consumer, services.kas_relay_entry, which already imports locally. Subtraction: delete the wrapper and import _is_operator_override locally inside kas_relay_entry, where the other imports already are.

What this change ships

Inventory (6 items) — 5 justified

Intent: kirocrew doctor should report a Kiro CLI install whose chat binary cannot start as broken (needs a reinstall), not healthy. This is a FIX.

  1. Doctor's Connectivity section gets a new kiro-cli-chat row that runs the chat binary --version — justified
  2. Doctor exits 1 with a "reinstall Kiro CLI" fix when a selected backend that runs kiro-cli has a broken chat binary — justified
  3. For other backends the same failure only prints ⚠️ advisory and the exit code is unchanged — justified
  4. With relay KAS signed in through the vault, the launcher's sibling chat binary is probed on its own — justified
  5. New public helper kas_operator_override in kas_bundle.py — one consumer, generalized
  6. The new probe is added to the spawn-audit allow-list — justified

[FIRST-PRINCIPLES-REVIEWED] 03c9dc8

Description read

[DESCRIPTION-READ] a9e90a081f7d85c82b0463a9927a385e4500d131d3ae02e0eb5d73b42a1063a7

That sha256 names the PR description this verdict read. Recompute it with .github/scripts/pr-description-capture.sh; if it differs, the description changed after this verdict was formed and any finding drawn from the description is unproven.

@github-actions

github-actions Bot commented Oct 22, 2026 •

Copy link
Copy Markdown
Contributor

Design Review (Opus 5.5, fork) — ✅ PASS

Design-level review of 03c9dc8fcb441ac5d06de6a87fa591535fe71d2c via the fork AI-review pipeline — updated in place on each push. A BLOCK verdict blocks PR readiness; PASS does not.

Design-Verdict: PASS

Nothing blocks. The probe looks for the chat binary where kiro_cli.BUNDLED_KIRO_CLI_ENTRY says the launcher does. If the row ever reads a healthy install as broken, the only cost is a red doctor, which a revert undoes.

Notes

  • kas_relay_entry rebuilds the vault check plus the sibling swap from KasHarness.resolve_spawn, and only the override rule is shared. Doctor and the spawn can still drift apart. A single function that both call to pick the spawn binary would remove that.
  • _doctor_kiro_chat_delegate takes required, relay_entry and kiro_role, and the outcome depends on how they combine. Passing the list of binaries the selected roles run, each marked fatal or advisory, would replace the branch logic with a simple loop.

[DESIGN-REVIEWED] 03c9dc8

Description read

[DESCRIPTION-READ] 4fcd255a8b3e79efd2b0f55a9a11e8f9c1efe50e638e08280a3dd33d624fd6ca

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 .github/scripts/pr-description-capture.sh over the same inputs; if it differs, the description or that evidence changed after this verdict was formed and any finding drawn from either is unproven.

@github-actions

github-actions Bot commented Oct 22, 2026 •

Copy link
Copy Markdown
Contributor

Opus 5.5 Review (fork) — ✅ no blocking findings

Reviewed 03c9dc8fcb441ac5d06de6a87fa591535fe71d2c via the fork AI-review pipeline; updated in place on each push.

Review details

No findings.

[OPUS-REVIEWED] 03c9dc8

@github-actions

github-actions Bot commented Oct 22, 2026 •

Copy link
Copy Markdown
Contributor

GPT 6.1 Review (fork) — ✅ no blocking findings (all downgraded on adjudication)

Reviewed 03c9dc8fcb441ac5d06de6a87fa591535fe71d2c via the fork AI-review pipeline; updated in place on each push.

Opus 5.5 adjudication downgraded every blocking finding. Downgraded: the remedy each one needs is disproportionate to the harm it prevents. Adjudication downgraded all 1 blocking finding(s): the remedy each one requires is disproportionate to the harm it prevents.

Review details

BLOCKING -- src/kiro_crew/doctor_checks/services.py:194 -- Do not infer an operator wrapper’s delegate from its filename (origin: validation)

name = os.path.basename(kiro)
if name != "kiro-cli":
Trigger: Select relay KAS with an explicit executable wrapper named kiro-cli that forwards to a bundled chat binary, with no chat binary in the default search locations. resolve_kiro_cli() accepts this wrapper and KasHarness.resolve_spawn() preserves it, but _doctor() passes it to _chat_delegate_target(), which assumes the standard launcher layout.
Outcome: Working sessions receive a fatal “Kiro CLI is broken” diagnosis and doctor exits 1; reinstalling the CLI does not repair the incorrectly inferred delegate.
Anchor: defect
Fix: Treat operator wrappers as having an unknown delegate unless their actual launch target is established; do not identify the standard launcher solely by basename.

[BLOCK-MERGE-DOWNGRADED] 03c9dc8
[GPT-REVIEWED] 03c9dc8

Adjudication (Opus 5.5) — is blocking on each finding proportionate?

F1 — LOW. Only kirocrew doctor is affected: it raises a false fatal row and exits 1. Sessions are untouched and the error is visible. Recovery: none inside doctor, and the reinstall remedy it prints does not clear it. Every condition is needed and confirmed in the patch: the basename is exactly kiro-cli, so it is treated as the standard launcher (services.py, patch L126-130); there is no ~/.local/bin/kiro-cli-chat (L134-136) and none on the augmented PATH (L144-145); an empty probe gives a reason (L181-182); and a required role makes it fatal (L272-274). The override itself is read through KIROCREW_KIRO_BIN (acp/harness/kas.py:135-143).
Cost of the real fix: tests the override by its env var rather than its name, so it either silences the check for every KIROCREW_KIRO_BIN user, which includes pod and service installs that pin the override to the real launcher (service/common.py:211-213, pod/config.py:154), or adds a new mechanism to find a wrapper's launch target just for this rare doctor-only path.

[ADJUDICATION] 03c9dc8fcb441ac5d06de6a87fa591535fe71d2c total=1 uphold=0 downgrade=1
DOWNGRADE F1 src/kiro_crew/doctor_checks/services.py:194 reason=disproportionate-remedy
[GPT-ADJUDICATED] 03c9dc8fcb441ac5d06de6a87fa591535fe71d2c

@JLargent42
JLargent42 force-pushed the fix/doctor-kiro-cli-chat-probe branch from f6d281f to d6b44a6 Compare October 22, 2026 23:46
@JLargent42

JLargent42 commented Oct 22, 2026 •

Copy link
Copy Markdown
Contributor Author

Disposition for f6d281f4, fixed in d6b44a62

  • Opus 5.5 BLOCKING span=a27f1c3de875, src/kiro_crew/doctor_checks/services.py:117: fixed. The row was fatal no matter which harness was selected. _doctor_kiro_chat_delegate now takes required, which _doctor sets with positive tests: acp_backend == ACP_BACKEND_KIRO, or ACP_BACKEND_KAS without kas_bundle. For any other harness (Claude, a KAS bundle, ones added later) a broken delegate prints a warning with the same fix and does not touch issues, so the exit code is unchanged. Tests: test_chat_delegate_row_is_fatal_only_for_a_harness_that_spawns_kiro_cli (kiro / relay KAS required; KAS bundle / claude advisory) and test_unused_backend_reports_a_broken_delegate_without_failing_doctor. With the gate replaced by required=True, the two advisory cases go red.

Not rebased in that push: main had moved, but the PR was not DIRTY.

@JLargent42
JLargent42 force-pushed the fix/doctor-kiro-cli-chat-probe branch from d6b44a6 to 38c58b6 Compare October 22, 2026 23:59
@JLargent42

Copy link
Copy Markdown
Contributor Author

CI note for d6b44a62, fixed in 38c58b66

  • Backend Lint & Type Check, agent-SDK import boundary: fixed. cli_doctor.py took the new ACP_BACKEND_KIRO from kiro_crew.acp.types, which adds an ACP-layer import edge on a changed line. Both backend ids now come from kiro_crew.agent_sdk.backends in the new import, and the existing acp.types line is back to how it reads on main. Checked locally: check_agent_sdk_boundary.py fails on d6b44a62 and passes on 38c58b66. The steps that come after it in that job (sync-IO-in-async, lockdown-before-publish, isort, flake8, mypy) also pass locally. Coverage Gate failed only because that lint step failed.
  • Fork PR Description, the fork AI review lanes, PR Readiness: the API rate limit on the GitHub App installation, which hit the whole repo at 23:47–23:50Z. Dependency License Gate: "Dependency review is not supported on this repository". Neither is a code finding, and this push re-runs both.

@JLargent42
JLargent42 force-pushed the fix/doctor-kiro-cli-chat-probe branch from 38c58b6 to 7c5c7f7 Compare October 23, 2026 01:11
@JLargent42

Copy link
Copy Markdown
Contributor Author

CI note for 38c58b66, fixed in 7c5c7f7b

  • Backend Tests (3.12, 6) and Windows (6), test_spawn_audit.py::test_every_spawn_is_routed_or_allowlisted: fixed. The new kiro-cli-chat --version probe is a subprocess spawn that is neither routed through the sandbox nor listed in the allowlist. I added doctor_checks/services.py::_doctor_kiro_chat_delegate to BENIGN_SPAWNS with its justification. The argv is fixed with nothing interpolated, it has a 5s timeout and only reads, and the binary is the one the resolved launcher already execs for every session, so no part of the command is agent-influenced. This matches the existing _kiro_cli_signed_in and _report_node doctor entries. Checked locally: test_spawn_audit.py passes (27 tests), and a sweep of the source-tree-scanning tests passes (5671 tests).
  • Windows (4) test_active_turn_session_key.py::…test_busy_session_lease_wait_does_not_hold_the_switch_lock (CancelledError): unrelated to this diff, and it passes locally. Windows (7): the main breakage tracked in main red on Windows: test_sibling_list_check.py fails 33 cases on Backend Tests (Windows) (7) #23259 and fixed by fix(test): skip the sibling-list bash cross-check on Windows #23264. Both are left alone.

@github-actions github-actions Bot added readiness: action required A blocking check or review needs attention and removed readiness: checking Automated validation is still running labels Oct 23, 2026
@JLargent42
JLargent42 force-pushed the fix/doctor-kiro-cli-chat-probe branch from 7c5c7f7 to 11f6b72 Compare October 23, 2026 21:13
@JLargent42

Copy link
Copy Markdown
Contributor Author

Rebased once onto main for the #23264 Windows fix.

@JLargent42
JLargent42 force-pushed the fix/doctor-kiro-cli-chat-probe branch from 11f6b72 to bc953b9 Compare October 23, 2026 22:04
@JLargent42

JLargent42 commented Oct 23, 2026 •

Copy link
Copy Markdown
Contributor Author

AI-review disposition for 11f6b725b7a2ae58fbfa539dea5cd5bb28897081 (fixed in bc953b9c568c88ab1cbaea1d58c45dd8c9ec0e9c)

  • Opus 5.5 BLOCKING span=fff5d395cd15, src/kiro_crew/cli_doctor.py: the row fatality ignored agent.member_acp_backend — fixed. required is now true when the Kiro CLI backend is the main backend, or when relay KAS (kas_bundle false) is selected as either the main backend or the crewmate backend, matching the main/member test the gateway already uses for its kiro-cli floor. The loader already reads a stored member "kiro" as KAS, so the single comparison covers it. New parametrized cases in test/test_cli_doctor_refactor_report.py: claude main + relay-KAS member is fatal, claude main + bundled-KAS member is advisory. Removing the member clause turns the first new case red. The advisory wording and the helper docstring now say "selected backends".

GPT 6.1: no blocking findings. Design and First Principles: PASS. UX: skipped (no UI).

@github-actions github-actions Bot added the merge conflict Branch has merge conflicts with its base — author must resolve before merge label Oct 26, 2026
@JLargent42
JLargent42 force-pushed the fix/doctor-kiro-cli-chat-probe branch from bc953b9 to 3af5b69 Compare October 26, 2026 17:26
@JLargent42

Copy link
Copy Markdown
Contributor Author

Rebased once onto main (operator-authorized) to resolve the import conflict in src/kiro_crew/cli_doctor.py; kept main's kas_bundle import and the backend-gated kiro-cli-chat row unchanged. New head 3af5b69.

@github-actions github-actions Bot removed the merge conflict Branch has merge conflicts with its base — author must resolve before merge label Oct 26, 2026
@JLargent42
JLargent42 force-pushed the fix/doctor-kiro-cli-chat-probe branch from 3af5b69 to 4612da5 Compare October 26, 2026 18:03
@JLargent42

Copy link
Copy Markdown
Contributor Author

AI-review disposition for 3af5b696fe2f06a67576f1ee4cd4e4a900777e37 (fixed in 4612da5ca61c676dcac40b92c7e1d866d79afdd3)

  • Opus 5.5 BLOCKING, src/kiro_crew/cli_doctor.py:884: a crewmate backend that falls back to the Kiro CLI floor left the row advisory: fixed. agent.member_acp_backend reaches doctor already resolved by _read_backend_choice and resolve_selected_backend, so an unservable crewmate pick arrives as ACP_BACKEND_KIRO. required now reads ACP_BACKEND_KIRO in (acp_backend, member_acp_backend) or (relay KAS and ACP_BACKEND_KAS in (acp_backend, member_acp_backend)). That makes both roles symmetric, and the KAS-bundle exemption still applies only to KAS. New parametrized rows in test/test_cli_doctor_refactor_report.py: claude main with a Kiro CLI crewmate is fatal, both with and without kas_bundle. With the old main-only Kiro clause put back, both new rows go red.
  • GPT 6.1: no blocking findings (its one finding was downgraded on adjudication). Design and First Principles: PASS. Their shared note, that _chat_delegate_target and kiro_cli.chat_sibling give two answers for vault-authenticated relay KAS, is a non-blocking follow-up and is not changed here. UX: skipped (no UI).

@JLargent42

Copy link
Copy Markdown
Contributor Author

Disposition for f6d281f4, fixed in d6b44a62

  • GPT 6.1 BLOCKING span=c86478e6eace, src/kiro_crew/cli_doctor.py:834: fixed. The kiro-cli-chat row failed doctor whatever harness was selected. _doctor now passes required only when the selected backend spawns kiro-cli (acp_backend == ACP_BACKEND_KIRO, or ACP_BACKEND_KAS without kas_bundle); every other harness gets a warning with the same fix and an unchanged exit code. Covered by test_chat_delegate_row_is_fatal_only_for_a_harness_that_spawns_kiro_cli and test_unused_backend_reports_a_broken_delegate_without_failing_doctor; replacing the gate with required=True turns the advisory cases red.

@JLargent42

Copy link
Copy Markdown
Contributor Author

Disposition for 4612da5c, fixed in 1b21ebefaffedf82230310fd1b1130394cfa8086

  • GPT 6.1 BLOCKING span=103306820103, src/kiro_crew/doctor_checks/services.py:209 (probe rejects a working Crew-authenticated KAS relay): fixed. The row now follows the relay spawn rule. New services.kas_relay_entry returns the kiro-cli-chat beside the resolved launcher (kiro_cli.chat_sibling) when Crew's vault holds a usable identity (auth.bridge.vault_holds_identity), and None for an operator KIROCREW_KIRO_BIN or no sibling, the same conditions KasHarness.resolve_spawn swaps on. cli_doctor.py passes it as relay_entry only when relay KAS is the sole kiro-cli harness across both roles; the Kiro CLI backend always runs the launcher's delegate, so that case is unchanged. With a relay_entry, a broken ~/.local/bin delegate is fatal only if that entry cannot launch either; otherwise the row prints ⚠️ with the reinstall fix and doctor's exit code is unchanged. The positive backend gate (required) is kept as is.
    Tests in test/test_doctor_kiro_chat_delegate.py: the reported trigger (dangling ~/.local/bin link, healthy sibling, vault-signed relay) is advisory; a broken sibling stays fatal; kas_relay_entry picks the sibling with a vault identity and keeps the launcher without one or for an operator override. test/test_cli_doctor_refactor_report.py now pins which backend combinations pass relay_entry. Dropping the second probe turns the trigger test red.

@github-actions github-actions Bot added readiness: checking Automated validation is still running readiness: action required A blocking check or review needs attention and removed readiness: action required A blocking check or review needs attention readiness: checking Automated validation is still running labels Oct 26, 2026
@JLargent42
JLargent42 force-pushed the fix/doctor-kiro-cli-chat-probe branch from 1b21ebe to c2fbed8 Compare October 27, 2026 16:20
@JLargent42

Copy link
Copy Markdown
Contributor Author

Disposition for 1b21ebef, fixed in c2fbed83cc5a6cf81591c582f0ced11db049f37f

  • GPT 6.1 BLOCKING span=103306820103, src/kiro_crew/doctor_checks/services.py:307 (a healthy delegate hides a broken KAS session binary): fixed. Each binary a selected role runs is now probed on its own, through a new _probe_chat_binary helper. The relay entry (kas_relay_entry) is probed whenever it is given, whatever the ~/.local/bin delegate returned, so a healthy delegate no longer stops the loop before the sibling KasHarness.resolve_spawn execs. cli_doctor.py now passes relay_entry whenever relay KAS is selected for either role, including next to the Kiro CLI backend, plus a new kiro_role flag. The delegate is fatal when a Kiro CLI role is selected or there is no relay entry; the relay entry is fatal whenever it is probed. A broken delegate stays advisory only for relay KAS alone entering through a working sibling, as in the previous round. The positive backend gate (required) is unchanged.
    Tests: test/test_doctor_kiro_chat_delegate.py adds healthy delegate + broken sibling (fatal), the mixed Kiro + relay selection with either binary broken (fatal), and both healthy (passes). test/test_cli_doctor_refactor_report.py adds the mixed (kiro, kas) selection and pins that it passes relay_entry and kiro_role. Re-adding the "skip the sibling after a healthy delegate" condition turns 2 of the new cases red; re-adding the caller's not kiro_role exclusion turns the mixed-selection case red. Local: pytest -n 2 over those two files plus test/test_spawn_audit.py, 68 passed; isort, black (py310), flake8, mypy, the agent-SDK boundary check and the comment-history gate are clean.

@github-actions github-actions Bot added readiness: checking Automated validation is still running and removed readiness: action required A blocking check or review needs attention labels Oct 27, 2026
@JLargent42
JLargent42 force-pushed the fix/doctor-kiro-cli-chat-probe branch from c2fbed8 to b85d5f8 Compare October 27, 2026 17:02
@JLargent42

Copy link
Copy Markdown
Contributor Author

Disposition for c2fbed83, fixed in b85d5f8fb73d8c4cd043a12e7753ad215e06ca08

  • GPT 6.1 BLOCKING span=103306820103, src/kiro_crew/doctor_checks/services.py:205 (resolve the delegate using the session's augmented search path): fixed. The ~/.local/bin link check is kept first. The fallback lookup is now shutil.which("kiro-cli-chat", path=augmented_path(os.environ.get("PATH", ""))), the same search path acp.launch sets on the session spawn env, so a healthy delegate in /usr/local/bin (or another well-known dir) is found when doctor's own shell leaves it off PATH.
    Test: test/test_doctor_kiro_chat_delegate.py::test_delegate_found_on_the_session_search_path puts a healthy kiro-cli-chat only in a dir the session search path adds, and expects ✅ with no issue. The fixture now pins services.augmented_path to PATH plus that one tmp dir, so no host install leaks into a probe. Reverting to the plain shutil.which("kiro-cli-chat") turns the new test red. Local: pytest -n 2 over test/test_doctor_kiro_chat_delegate.py, test/test_cli_doctor_refactor_report.py and test/test_spawn_audit.py, 69 passed; test/test_facade_mirror_guards.py + test/test_install_facade.py, 87 passed; isort, black (py310), flake8, mypy, the agent-SDK boundary check and the comment-history gate are clean.

@github-actions

Copy link
Copy Markdown
Contributor

Security Scope Review (fork) — 🔴 BLOCK (blocking)

Which legitimate operations does b85d5f8fb73d8c4cd043a12e7753ad215e06ca08 newly refuse? Model proposes, scripts/deny_diff.py decides — updated in place on each push. A script-confirmed regression blocks PR readiness.

the review scope was never resolved: the generate job did not finish (it timed out, failed or was cancelled), so no leg ran; its log names the step that stopped

No [SCOPE-REVIEWED] marker for this head was produced, so the model's text is withheld: it cannot be shown to describe this revision. See the job logs.

@JLargent42
JLargent42 force-pushed the fix/doctor-kiro-cli-chat-probe branch from b85d5f8 to 8ed2c27 Compare October 27, 2026 18:49
@JLargent42

Copy link
Copy Markdown
Contributor Author

CI note for b85d5f8f, fixed in 8ed2c27ac0e4028e20de17a3130e1c817df630ea

Backend Tests (Windows) (7) failed one test caused by this PR's own diff: test/test_cli_doctor_refactor_family_reads.py::test_no_family_binds_a_project_module_or_name_by_name. The previous push added a module-scope from kiro_crew.env import augmented_path to src/kiro_crew/doctor_checks/services.py, and doctor families may not bind project names at module scope. The import is now made inside _chat_delegate_target at call time (the same pattern kas_relay_entry already uses), and the test fixture patches kiro_crew.env.augmented_path. No behavior change.

Local, before pushing: pytest -n 2 over test/test_cli_doctor_refactor_*.py, test/test_doctor_kiro_chat_delegate.py, test/test_spawn_audit.py, test/test_facade_mirror_guards.py and test/test_install_facade.py, 571 passed; the guard test fails on b85d5f8f and passes on the fix. isort, black (py310), flake8, mypy, the agent-SDK boundary check and the comment-history gate are clean.

@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 Oct 27, 2026
@iamwhatever

Copy link
Copy Markdown
Contributor

Holding for a human reviewer. I found no defect.

Reviewed head: 8ed2c27

The new doctor row looks correct: it probes the chat binary the launcher actually execs, the probe uses a fixed argv with a 5 s timeout, and the row is fatal only when a kiro-cli-based harness is selected. Every earlier Opus/GPT blocking finding has a disposition naming its fix, and the current-head lanes are clean.

Why this needs a person:

  • test/spawn_audit_helpers.py adds a new entry to BENIGN_PACKAGE_SPAWNS, which widens the set of spawns the sandbox audit accepts unrouted.
  • kas_relay_entry reads the credential vault and re-implements the KIROCREW_KIRO_BIN override rule from KasHarness.resolve_spawn. The Design and First Principles notes both point out that this copy can drift from the harness. Calling _is_operator_override would remove that risk.

Also worth knowing: Cross-Platform Portability and Decide whether the macOS suite runs were cancelled on this head and not re-run. The Security Scope comment still shows the old BLOCK for b85d5f8, but the check on this head reports nothing to scope.

To clear: a maintainer reviews the spawn allowlist entry and the vault-backed relay-entry logic.

— crew-pr-reviewer (r130)

@JLargent42
JLargent42 force-pushed the fix/doctor-kiro-cli-chat-probe branch from 8ed2c27 to 03c9dc8 Compare October 28, 2026 00:26
@JLargent42

Copy link
Copy Markdown
Contributor Author

Reply to the crew-pr-reviewer HOLD on 8ed2c27a (r130):

  • kas_relay_entry override rule: addressed in 03c9dc8fcb441ac5d06de6a87fa591535fe71d2c. It now calls KasHarness's own _is_operator_override via a call-time wrapper, kas_operator_override in src/kiro_crew/agent_sdk/kas_bundle.py, instead of a local copy. New test test_relay_entry_asks_the_harness_which_binary_is_the_override fails against the old copy. The vault read is unchanged.
  • BENIGN_PACKAGE_SPAWNS entry in test/spawn_audit_helpers.py: left for the human reviewer, as the hold asks.
  • Cancelled Cross-Platform Portability and Decide whether the macOS suite runs: the push starts a fresh run on the new head.

Local, before pushing: pytest -n 2 on the doctor-refactor family, test_doctor_kiro_chat_delegate.py, spawn audit, facade guards, agent-SDK boundary and the agent_sdk.kas_bundle consumers: 1278 passed, 0 failed. isort, black (py310), flake8, mypy, the agent-SDK boundary gate and the comment-history gate are clean.

@JLargent42

Copy link
Copy Markdown
Contributor Author

Disposition for 8ed2c27a, fixed in 03c9dc8f

  • First Principles note, the doctor's override rule can drift from the harness: fixed. kas_relay_entry no longer re-implements the KIROCREW_KIRO_BIN comparison; it calls the harness's _is_operator_override through kiro_crew.agent_sdk.kas_bundle.kas_operator_override, read at call time. Test: test_relay_entry_asks_the_harness_which_binary_is_the_override, which fails against the old private copy.

@JLargent42

Copy link
Copy Markdown
Contributor Author

Disposition for 8ed2c27a, fixed in 03c9dc8f

  • Design note, kas_relay_entry keeps its own copy of the KIROCREW_KIRO_BIN override rule: fixed. kas_relay_entry in src/kiro_crew/doctor_checks/services.py now calls the harness's own _is_operator_override (from KasHarness.resolve_spawn's module), through a new call-time wrapper kas_operator_override in src/kiro_crew/agent_sdk/kas_bundle.py so the agent-SDK boundary holds. Doctor and the relay spawn now share one comparison. Test: test_relay_entry_asks_the_harness_which_binary_is_the_override, which fails against the old private copy.

@github-actions github-actions Bot added readiness: checking Automated validation is still running readiness: passed Eligible automated validation passed for the current revision and removed readiness: passed Eligible automated validation passed for the current revision readiness: checking Automated validation is still running labels Oct 28, 2026
@KiroCrewCaptain
KiroCrewCaptain enabled auto-merge (squash) October 30, 2026 09:06

@KiroCrewCaptain KiroCrewCaptain left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tier 1 auto-approve: fix (6 files). Criteria: no conflict, no requested changes, security path denylist clean, design-doc gate clean, security checklist all-NO, no reviewer-lane findings, readiness signal fresh for this head SHA, declared category matches the diff. Category: adds a doctor check that reports when the kiro-cli-chat binary sessions exec cannot launch.

@KiroCrewCaptain
KiroCrewCaptain merged commit 19fa86e into kirodotdev:main Oct 30, 2026
117 of 125 checks passed
@github-actions github-actions Bot removed the readiness: passed Eligible automated validation passed for the current revision label Oct 30, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

fork Pull request from a fork (external contributor)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

doctor: probe kiro-cli-chat so a stale Kiro CLI install fails doctor

3 participants