Repository navigation
Conversation
|
👋 Hi! This PR's description is missing some required sections from our PR template. Workflow runs won't be auto-approved until the description is updated. Missing sections:
Please update your PR description to include these sections, then push or re-save the description. The workflows will be approved on the next cycle. |
GPT 6.1 Review (fork) — ✅ no blocking findingsReviewed Review detailsNo findings. |
Design Review (Opus 5.5, fork) — ✅ PASSDesign-level review of Design-Verdict: PASS Before merge, run one turn live against a signed-out claude-agent-acp or codex-acp. The 401 response and the rerun refusal both rely on [DESIGN-REVIEWED] 4f3704f Description read[DESCRIPTION-READ] c30592bba24c0c8c71a67a5ba50991e25e5ccf21a547dd3dd764f2c8981f1b06 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, fork) — 🟡 CONCERNSPremise-level review of First-Principles-Verdict: CONCERNS The kiro-backed Not justified as shipped
What this change shipsInventory (8 items) — 5 justifiedIntent: let Claude Code, Codex and other foreign-harness deployments regenerate, rewind, edit-resend and use
[FIRST-PRINCIPLES-REVIEWED] 4f3704f Description read[DESCRIPTION-READ] 300c08b1298f02cbf74b078fc9e35ee236a69b90fc21ebf3f4e8193b7ce37245 That sha256 names the PR description this verdict read. Recompute it with |
Opus 5.5 Review (fork) — ✅ no blocking findingsReviewed |
4a55b29 to
2e4e52b
Compare
|
Dispositions for the review findings, addressed in the amended first commit (
|
2e4e52b to
88ed004
Compare
|
Dispositions for the second round, addressed in the amended first commit (
|
|
🤖 Kiro Crew [operator: NicholasRBowers#a942f9ca]: This PR has been inactive for 7+ days with failing CI. I've assessed the blockers and they appear resolvable — I'll push fixes directly to this branch as a co-author. Assessment: the conflict is a single import-block union in DetailsConflict — one hunk, mechanical. A trial merge against current Backend Tests (macOS) (2) + (Windows) (2) — the PR's own, and the fix is mechanical. The invariant that test defends still holds — the gate is still honored before the truncate — so this is a stub-shape break, not a policy break. Two in-scope fixes: give that test's slot stub a Backend Tests (macOS) (1) — stale-base drift.
The AI verdicts on record are stale. No human reviews and no unresolved review threads, so nothing here is waiting on a maintainer's opinion. If you'd prefer I don't touch this PR, add the |
88ed004 to
adcb9da
Compare
|
🤖 Kiro Crew [operator: NicholasRBowers#a942f9ca] Drive-to-green push: rebased onto current main (
The prior Original work by the PR author — credited in the amended commit body; fix commit carries a |
|
Readiness sweep 2026-09-29 — audited READY (LOOSENS net; the residual "auth recogniser only tested against synthetic frames" is accepted from the sweep's side, with the live capture as a follow-up), and the PR's own tests pass on the main+PR merge tree. It went A rebase onto current main (re-sort the baseline) is all that is needed; ping when readiness is green again and the sweep will approve and merge. |
|
Readiness sweep 2026-09-29: rebased onto main |
|
Readiness sweep 2026-09-29: rebased head |
|
PR triage 2026-10-05 (automated, read of the full diff against Rebase needed. The head (
Merge discussion with #16886 (open). Both PRs change how The breaking change (401 instead of an empty 200 on |
UX Review (Opus 5.5, fork) — ⏭️ skippedRevision |
|
|
|
|
|
On a Claude Code, Codex or other foreign-harness deployment, regenerate, rewind, edit-resend and /v1/chat/completions answered kiro_prerequisite_required 503 whenever kiro-cli was absent or signed out, although those sessions never spawn kiro-cli. reject_if_kiro_unverified now applies only when the session the caller acts on uses a backend in backends_retired_by_host_logout(). Reruns judge the live session first, then the installed provider factory's backend, re-derive the verdict under the slot lock before the first destructive write, and re-check app ownership (session and transcript halves) before and after each readiness await. /v1/chat/completions gates on the same verdict, after one shared ownership predicate, and translates a foreign turn's end: AcpAuthRequired -> OpenAI 401 authentication_error; any other error row with no reply text -> 500 server_error, so an unconfigured harness that dies at startup is never an empty 200. On a foreign backend streaming defers prepare() so a pre-output failure keeps its HTTP status. /api/models refuses a backend with neither an advertised selection nor a kiro-cli sign-in before resolving kiro-cli, and hands the gate its own snapshot. /api/sessions/usage stays gated on every backend (signs_in_via_kiro_cli=True): the scrape spawns kiro-cli itself, and the dashboard already hides the pill on a non-kiro harness (kirodotdev#15370). reload_provider_factory builds the new factory before installing it. Rebased onto current main: the first-run override is dropped (kirodotdev#13888 gives the first-run screen its own coding-agent choice), the app-ownership pieces use main's slot_ownership helpers, and the usage membership change is dropped to leave that handler to kirodotdev#16886.
|
|
|
|
|
|
|
|
- Refuse a foreign-harness rerun with harness_sign_in_required 503 under the slot lock when the slot's last turn ended AcpAuthRequired, before the first destructive write. - Trust a live-session verdict only while is_provider_alive(key) is True: a dead row is evicted and rebuilt on the installed factory, so it must not answer for its kiro-cli successor. - On /v1/chat/completions refuse an app for an absent target before the readiness gate too, so a signed-out kiro-cli is not a slot-existence oracle. - Drop the unreachable /api/models model_list_backend_unsupported refusal and the one-caller backend= gate parameter; /api/models passes signs_in_via_kiro_cli=True like the usage routes. - Declare and pin that a kiro-backed completion failing with no reply is a 500.
|
|
|
Thanks for this PR. It now conflicts with main. Could you rebase onto the latest main and resolve the conflicts? We will review it again once it is rebased and CI is green. |
|
[operator: bolichen97] Continuing this in #32839; thanks for the start. |
Problem / Motivation
Goal: On a Claude Code, Codex or other foreign-harness deployment, regenerate, rewind, edit-resend and
/v1/chat/completionswork without kiro-cli being installed or signed in.On main,
kiro_readiness.reject_if_kiro_unverifiedasks "is kiro-cli ready?" for every backend. So on a deployment whose sessions run on claude-agent-acp, codex-acp, goose and so on, those four routes answerkiro_prerequisite_required503 whenever kiro-cli is absent or signed out, although the selected backend never spawns that binary.Why it matters
Anyone who runs KiroCrew on a foreign harness loses core chat operations to a permanent 503 about a tool they turned off. The only fix open to them is installing and signing in to a kiro-cli they do not want.
Not a goal
/api/modelsand/api/sessions/usage: both spawn kiro-cli themselves, so they stay gated on every backend. The dashboard already hides the credit pill on a non-kiro harness (fix(dashboard): don't report a balance failure on a harness with no Kiro balance #15370), and feat(dashboard): read the credit balance with Crew's own Kiro credential #16886 owns the next change to the usage handler.What changed
The gate applies only while the session the caller acts on uses a backend in
backends_retired_by_host_logout()(positive membership; an unreadable config keeps the gate).kiro_readiness.py)selected_backend(key, state=)reads the installed provider factory's backend pair (member threads viamembers.select_provider_backend), falling back to config;live_session_signs_in_via_kiro_clireads a live session's ownuses_kiro_identity_store, and only whenSessionManager.is_provider_aliveanswersTrue; a dead row is evicted and rebuilt on the installed factory, so it never answers for its successor.reject_if_kiro_unverifiedtakessigns_in_via_kiro_cli=orsession_key=+state=, and keeps main'smax_age_secs.chat_regenerate.py,chat_rewind.py)_reauthorize_after_await(slot identity plus session and transcript ownership) runs before each readiness read and after each readiness await, so an app never learns another session's sign-in state through the 503. On a foreign harness, a slot whose last turn endedAcpAuthRequired(_last_turn_auth_required) is refused withharness_sign_in_required503 under the lock, before the first destructive write; the next ordinary send rewrites that flag./v1/chat/completions(openai_compat.py)_reject_unowned_app_slotoverdeny_app_slot_session_access) runs for every app caller before the readiness peek, absent targets included, and again on the slot the request obtains after each await. The collectors translate a foreign turn's end:_last_turn_auth_required-> OpenAI 401authentication_error; any othererrorrow with no reply text -> 500server_error. On a foreign backend streaming defersprepare(), so a failure before output keeps its HTTP status./api/models,/api/sessions/usage(handlers/agents.py,handlers/sessions.py)signs_in_via_kiro_cli=Trueand stay gated exactly as on main.reload_provider_factory(session_lifecycle_parts/fleet.py)The shared ownership predicate gives the two app 403 bodies a
code, soerror-code-baseline.jsonratchetsopenai_compat.pyfrom 17 to 15. The spec (docs/system-specs/modules/acp-client.md,docs/system-specs/modules/learn-cron-dashboard.md,docs/system-specs/modules/claude-code-provider.md) records the scoped gate, the live-session and installed-factory verdicts, the usage exception and the 401/500 translation.Backwards compatibility
Breaking for
/v1/chat/completions. On a backend the gate stands aside for, a turn that ends signed out now returns HTTP 401authentication_error. On every backend, kiro included, a turn that ends with anerrorrow and no reply text now returns HTTP 500server_error. Both used to return HTTP 200 with empty content. App-isolation 403 bodies on that route now carrycode: app_token_forbidden. External SDK clients get a standard OpenAI error instead of silent emptiness, which is the fix.Tests
test_kiro_spawn_readiness_gate.py: the gate applies exactly to the identity-store backends over every id inACP_BACKENDS_KNOWN; a foreign backend never consults the service; an unreadable config keeps the gate; member threads are judged by their own backend; reruns judge the installed factory, re-check under the lock, and refuse before mutation when a switch into a signed-out kiro-cli lands mid-request; a foreign rerun on a slot whose last turn ended signed out is refused before truncation, and goes through once the flag clears (red without the refusal);/api/modelsand both usage routes stay 503 on a foreign backend with a signed-out kiro-cli; an AST scan fails on any production call that hands the gate no input.test_kiro_spawn_readiness_gate.py::test_a_row_that_is_not_positively_alive_does_not_answer: a dead, unknown or unprobeable foreign row answersNone, so the gate falls back to the installed factory (the dead-row case is red without the liveness check).test_openai_compat.py: ownership precedes the readiness peek, including for an absent slot (red without it), and is re-checked after each await; the endpoint gates on the live session's and the installed factory's backend; auth-required turns return the 401 envelope on blocking and streaming paths; a foreign turn that fails without the auth verdict returns 500 on both paths (red on the previous head), a kiro-backed turn that fails with no reply returns 500 too, while an error row after reply text keeps the 200 reply; a kiro-backed stream prepares before any output.test_api_models_entitlement.py,test_chat_regenerate_cov80.py,test_dashboard_chat_rewind.py,test_session_config_hot_reload.py: as listed in each file's new tests.test_kiro_prerequisite_handlers.py,test_relay_archive.py,test_slot_ownership_checkpoint.py: stubs and fixtures follow the widened gate surface; the reruns still answer 503 before mutation on a signed-out kiro backend.Local run on the head: the 10 files above plus
test_error_code_contract.py, 489 passed; every test module that references a touched module (200 files), 9728 passed, 2 skipped;black --check,scripts/check_file_line_cap.pyandscripts/check_harness_parity.pyclean.Manual verification
Not run live. The 401 path needs a signed-out claude-agent-acp or codex-acp process whose stderr the shared auth vocabulary recognises; the tests reach that verdict by setting
_last_turn_auth_required. Any other startup failure now ends as the 500 above.Screenshots / video
N/A: backend-only change, no frontend file touched.
Pattern harvest
Rule candidate: semgrep
Pattern: a backend or capability verdict read from
SessionManager._sessions[key].providerwithoutis_provider_alive(key) is True-- a dead row answers for the sessionget_or_createwill build in its place.chat_turn/slash_commands._slash_command_backendalready applies the liveness test; this PR's live-session peek missed it in one round.no linked issue: contributed fix scoped by the fork author; no tracked issue exists for it.