Repository navigation
fix: gate history reruns on kiro-cli only when their turn runs on it - #32839
Conversation
UX Review (Opus 5.5) — ⏭️ skippedRevision |
First Principles Review (Opus 5.5) — ✅ PASSPremise-level review of First-Principles-Verdict: PASS Nothing blocks. Both behaviour changes are in the frozen Goal, reuse existing mechanisms ( What this change shipsInventory (5 items) — 5 justifiedIntent: let people on a non-Kiro harness use Regenerate, Edit + Send and rewind without needing kiro-cli, without losing history to a signed-out turn. This is a FIX.
[FIRST-PRINCIPLES-REVIEWED] a25bd54 Description read[DESCRIPTION-READ] 1b88ccccf117d8680352e0789fcb7a501ee8a12eb882663fc5b91b6d8fce96cb That sha256 names the PR description this verdict read. Recompute it with |
Design Review (Opus 5.5) — ✅ PASSDesign-level review of Design-Verdict: PASS Nothing blocks: the gate now follows the turn's own harness, a selection it can't read keeps the old check, and the one new refusal is listed with its three readers. Notes
[DESIGN-REVIEWED] a25bd54 Description read[DESCRIPTION-READ] a905ba1ddf4ba4b023f8138e7a0b313ddb9bc77855b38883b6fb456386f8c7d4 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 |
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: |
Regenerate, edit-resend and rewind refused with kiro_prerequisite_required whenever kiro-cli was missing or signed out, even on a slot whose turn runs on Claude, Codex or another harness that never reads kiro-cli's sign-in. They now ask the kiro-cli gate only when the backend the session manager's applied provider factory picks for the slot's session (member DMs and crewmate pins included) signs in from kiro-cli's store. The applied config is read rather than config.json, which runs ahead of the factory until the config watcher applies a write. On such a foreign harness the one sign-in fact Crew holds is the slot's last outcome, so edit-resend and rewind, which cut history before their turn runs, refuse with harness_sign_in_required while the last turn ended signed out. Restoring the replaced tail after a failed foreign turn stays open on the issue. Builds on #10414 by @amansk. Part of #14512
72fe91c to
a25bd54
Compare
|
self-added: yes
|
KiroCrewCaptain
left a comment
There was a problem hiding this comment.
Approving head a25bd54. The review read the full src diff and checked that the rerun gate uses the same member-aware backend selector as the provider factory. It reads the applied config, not config.json, and it names the harness by positive membership in backends_retired_by_host_logout(). Every unreadable path keeps the gate. The new harness_sign_in_required refusal runs under the slot lock, before any history is cut. On an extracted head tree, test_rerun_readiness_scope.py passed 18 of 18, the sibling files passed 499, and 12 of 13 mutants on the production hunks were killed.
Done well: every refusal test also asserts that history and the native conversation stay untouched, so a refusal placed after the cut would fail.
Optional: add a _REGENERATE case (Claude slot, signed-out last turn, expect 200) to pin "Regenerate is not refused". That was the one mutant no test killed.
Optional: on the chat page, rewindWithRollback swallows the new 503 and the edit disappears without a message. A follow-up issue could surface both rerun refusal codes there.
Optional: after merge, note on #10414 that the rerun half and its helper are on main, so it can narrow to the /v1/chat/completions half. Also name the merge order against #25562, which edits the same three gate call sites. The Proof line still cites 71769bed and could be refreshed to this head.
…32839) Regenerate, edit-resend and rewind refused with kiro_prerequisite_required whenever kiro-cli was missing or signed out, even on a slot whose turn runs on Claude, Codex or another harness that never reads kiro-cli's sign-in. They now ask the kiro-cli gate only when the backend the session manager's applied provider factory picks for the slot's session (member DMs and crewmate pins included) signs in from kiro-cli's store. The applied config is read rather than config.json, which runs ahead of the factory until the config watcher applies a write. On such a foreign harness the one sign-in fact Crew holds is the slot's last outcome, so edit-resend and rewind, which cut history before their turn runs, refuse with harness_sign_in_required while the last turn ended signed out. Restoring the replaced tail after a failed foreign turn stays open on the issue. Builds on #10414 by @amansk. Part of #14512 Original author: Bolin Chen (cherry picked from commit 91ee8a0)
…32839) Regenerate, edit-resend and rewind refused with kiro_prerequisite_required whenever kiro-cli was missing or signed out, even on a slot whose turn runs on Claude, Codex or another harness that never reads kiro-cli's sign-in. They now ask the kiro-cli gate only when the backend the session manager's applied provider factory picks for the slot's session (member DMs and crewmate pins included) signs in from kiro-cli's store. The applied config is read rather than config.json, which runs ahead of the factory until the config watcher applies a write. On such a foreign harness the one sign-in fact Crew holds is the slot's last outcome, so edit-resend and rewind, which cut history before their turn runs, refuse with harness_sign_in_required while the last turn ended signed out. Restoring the replaced tail after a failed foreign turn stays open on the issue. Builds on #10414 by @amansk. Part of #14512 Original author: Bolin Chen (cherry picked from commit 91ee8a0)
Problem / Motivation
Goal: On a chat whose turns run on Claude, Codex or another harness that does not sign in through kiro-cli, Regenerate, Edit + Send and rewind work without kiro-cli installed or signed in, and Edit + Send and rewind are refused before any history is cut when that chat's last turn ended signed out.
On main the three history reruns ask "is kiro-cli signed in?" for every chat. A chat on a harness that never runs kiro-cli gets a
kiro_prerequisite_required503 whenever kiro-cli is missing or signed out. When kiro-cli is signed in, they go ahead with no sign-in fact at all about the harness the turn will use.Why it matters
Anyone who runs Kiro Crew on a non-Kiro harness without kiro-cli loses Regenerate, Edit + Send and rewind to an error about a tool they do not use, and the only way out is to install and sign in to it.
Not a goal
POST /v1/chat/completions(Restore safe history reruns for non-Kiro ACP harnesses #14512 leaves SDK completions out), and/api/modelsand/api/sessions/usage, which spawn kiro-cli themselves.What changed (motivation → approach → change)
Regenerate, Edit + Send and rewind no longer fail with a kiro-cli sign-in error on a chat that runs on Claude, Codex or another harness that never uses kiro-cli. On such a chat, Edit + Send and rewind are refused before they cut history when the chat's last turn ended signed out, so a signed-out harness does not throw away the messages they replace.
A kiro-cli or KAS chat is checked exactly as before. On any other harness the turn is its own sign-in authority, as for an ordinary send.
kiro_readiness.rerun_signs_in_via_kiro_cli_configured_backend_for_slot(crewmate pin, then member route, then default), from the session manager's applied config: the one its provider factory starts the turn from, notconfig.json, which runs ahead of it until the config watcher applies a write. Answers whether that backend is inbackends_retired_by_host_logout(). No slot, no session manager, or a selection it cannot read, keeps the check.chat_regenerate.py,chat_rewind.py)reject_if_kiro_unverifiedonly when that answer is yes.kiro_readiness.refuse_rerun_after_signed_out_turnharness_sign_in_required503 under the slot lock, before history is cut, while the last turn this process ran on the slot ended signed out (_last_turn_auth_required, kept in memory). Regenerate is not refused: it replaces the reply only when its turn produces one.The specs
docs/system-specs/modules/learn-cron-dashboard.mdanddocs/system-specs/modules/cli.mdrecord the scoped check and the refusal. This is the rerun half of #10414's gate scoping, cut to its smallest form.Builds on #10414 by @amansk.
Backwards compatibility
Breaking: on a non-Kiro harness chat whose last turn ended signed out, Edit + Send and rewind answer
harness_sign_in_required503 instead of cutting history and starting a turn that fails the same way. Writer sweep on origin/main @ df553b0: the three callers below already handle any non-OK answer. Everything else widens: a non-Kiro chat is no longer refused over kiro-cli.Reader: website/src/lib/rewindCall.ts:rewindWithRollback -- chat -- a failed rewind rolls the optimistic edit back
Reader: website/src/pages/chat/crew-window/CrewChatWindow.tsx:CrewChatWindow -- crew page -- a rejected rewind puts the edit back in the rewind draft
Reader: website/src/apps/mochi/panel/panelBridge.ts:editResend -- app -- a non-OK answer falls back to a plain send
Tests
test_rerun_readiness_scope.py: the check follows the slot's backend (kiro-cli and KAS gated, Claude not); a member DM is judged byagent.member_acp_backendboth ways; no slot, no session manager, or an unreadable selection keeps the check. With kiro-cli signed out, all three reruns go through on a Claude chat and still answerkiro_prerequisite_requiredon a kiro-cli chat. After a signed-out last turn, Edit + Send and rewind on a Claude chat answerharness_sign_in_requiredwith history and the native conversation untouched, while a kiro-cli chat with kiro-cli signed in is not refused. Whenconfig.jsonsays Claude but the applied config still says kiro-cli, Edit + Send and rewind keep the kiro-cli check and cut nothing.test_chat_regenerate_cov80.py,test_slot_ownership_checkpoint.py: the three tests that need the check to run give their session-manager double an applied config;test_chat_handlers_composition_contract.pypins the new_configured_backend_for_slotsignature.-n0, a seeded shuffled order (shuf, seed 31415), and a run at-n 4 --dist loadgroup --max-worker-restart=2besidetest_chat_regenerate_cov80.pyandtest_slot_ownership_checkpoint.py(175 passed). The applied-config test fails on the disk read it replaces: edit-resend and rewind answered 200 and cut history.Proof: PROVEN test/test_chat_handlers_composition_contract.py::test_a_moved_name_keeps_its_base_shape_and_owner[slot_effort:_configured_backend_for_slot], test/test_rerun_readiness_scope.py::test_a_signed_out_kiro_cli_refuses_only_a_rerun_that_runs_on_it[claude-200-regenerate-body0], test/test_rerun_readiness_scope.py::test_a_signed_out_kiro_cli_refuses_only_a_rerun_that_runs_on_it[claude-200-edit-resend-body1], test/test_rerun_readiness_scope.py::test_a_signed_out_kiro_cli_refuses_only_a_rerun_that_runs_on_it[claude-200-rewind-body2], test/test_rerun_readiness_scope.py::test_a_signed_out_last_turn_refuses_a_foreign_rerun_before_the_cut[claude-503-edit-resend-body0] (head 71769bed4824)
Manual verification
Not run live: a signed-out non-Kiro harness needs that harness's own account. The tests drive the real handlers with a signed-out kiro-cli and the harness written to the test's
config.jsonand applied to the session manager, the way a user's pick takes effect.Screenshots / video
N/A: backend-only change, no frontend file touched.
Related Issues
Part of #14512
Sibling sweep
Swept: git grep -n "reject_if_kiro_unverified(" -- src/
Sibling: src/kiro_crew/dashboard/chat_regenerate.py -- changed here
Sibling: src/kiro_crew/dashboard/chat_rewind.py -- changed here
Sibling: src/kiro_crew/dashboard/openai_compat.py -- tracked in #10414
Sibling: src/kiro_crew/dashboard/handlers/agents.py -- not affected -- the /api/models catalog spawns kiro-cli itself
Sibling: src/kiro_crew/dashboard/handlers/sessions.py -- not affected -- the usage poll and refresh spawn kiro-cli themselves
Pattern harvest
Rule candidate: review-prompt
Pattern: a kiro-cli readiness verdict used to authorize a turn without first asking whether that turn's harness signs in through kiro-cli (
backends_retired_by_host_logout()).Checklist
feat|fix|docs|style|refactor|perf|test|chore|ci|build|revert: ...)