Repository navigation
Conversation
566a1cb to
7c82ea8
Compare
7c82ea8 to
51f1630
Compare
51f1630 to
ac5f549
Compare
UX Review (Opus 5.5, fork) — ⏭️ skippedRevision |
Design Review (Opus 5.5, fork) — ✅ PASSDesign-level review of Design-Verdict: PASS Nothing blocks: every drain gate that read Notes
[DESIGN-REVIEWED] 2b9de0d Description read[DESCRIPTION-READ] 7906837d33b54d1c91b3ba183c045fc140811665d134f09863c0f0cac38914ae 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) — ✅ PASSPremise-level review of First-Principles-Verdict: PASS Nothing blocks: the fix sits at mechanism level, and it converts all 7 drain gates that read Notes
What this change shipsInventory (8 items) — 6 justifiedIntent: prompts typed while signed out are kept and run in order after the person signs in. FIX.
[FIRST-PRINCIPLES-REVIEWED] 2b9de0d Description read[DESCRIPTION-READ] 8cccd0a594a4aad3a58ac3ad4275474df297fd61ccf5a7660f20241dbd479257 That sha256 names the PR description this verdict read. Recompute it with |
Opus 5.5 Review (fork) — ✅ no blocking findingsReviewed |
GPT 6.1 Review (fork) — ✅ no blocking findingsReviewed |
Security Scope Review (fork) — 🔴 BLOCK (blocking)Which legitimate operations does 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 |
ac5f549 to
9a5b297
Compare
06182f5 to
c41d67d
Compare
bf044e9 to
454454c
Compare
454454c to
4a24d89
Compare
4a24d89 to
b995d56
Compare
Code change approver recommendation: A person should decideWhy: the decider thinks the change is probably fine but estimates a 22% chance that this change introduces a defect, above the 12% limit for approving on its own. Fixes lost prompts during a sign-in outage. The failing turn puts the person's drained entries (or a direct composer/thread send) back at the queue head, marks the queue held, and a later unmarked person send releases it in order. I checked every drain site that read _last_turn_auth_required: all switched to signout_hold_active, except kiro_readiness, which correctly still reads the old flag. A repeat failure re-marks the queue without looping. A slot that never hit a sign-in failure takes the same paths as before, because the new branches need retained or put-back keys. App, composed and regenerate turns are excluded from put-back. MODEL_AS_TYPED is set only where the direct thread path already sends raw text to the model. Cancel and edit semantics have tests. Tests are extensive, CI is green and the AI review lanes pass; the Security Scope BLOCK was on an earlier head and only reports a job timeout. No concrete failing path found. Tier: 2, held for a person: 39 files, more than 20. An automated recommendation, not a review: a maintainer still decides. It approves on its own only when the estimated chance of a defect is at most 12% and the change has at most 400 changed lines. Decider v3c (217fe607) · commit |
|
This changes behaviour users already rely on, so it needs a design sign-off from a maintainer before it can merge. A maintainer will post the decision here. To propose a design, follow the request-for-change process in CONTRIBUTING.md (docs/request-for-change/). The review found no blocking defect on this head. Every drain site that read The decision for a maintainer is the new ordering. After a sign-in failure, a person's idle send from the composer, a Bot DM or a linked thread now waits behind the held prompts. So does every slash command except Optional:
|
A sign-in failure puts the person's prompts back and marks what it holds; a send made after it lets the queue try again.
Problem / Motivation
Goal: A prompt sent while the CLI is signed out is never lost, and the first send after signing in resumes the queue in order.
When a turn hits a signed-out CLI,
_requeue_auth_retryputs back only runner-authored, synthesis and sub-agent input. A person's own prompt that ran into the failure, whether drained from the queue or sent straight from the composer, is gone from the post-login resume. And on top of #22224, a send made after signing in that queues behind a pending conversation discard is stranded when the discard lands, because the release reads the sign-in failure flag, which only a turn that runs can clear.Why it matters
Anyone whose sign-in expires mid-session loses the prompts they typed during the outage, with no sign that they were dropped. The stranded post-sign-in send looks like a hung chat until the person sends again.
Not a goal
main.What changed (motivation → approach → change)
Telling a held prompt apart from a send made after the failure cannot be done later from the slot's state, because both leave it looking the same. So the turn that hits the failure records it, at the moment it holds the queue.
/prompts getturn puts back what the person typed, not its expansion.queue_item_already_sent. Cancel withdraws a put-back entry, leaving its row unanswered; cancelling one member of a merged run frees the rest from that row./usage,/contextand/help, which start no model turn, still run at once, from the composer or a linked thread; every other message starting with/waits like any send.signout_hold_activeholds the queue until an unmarked person send is queued, anywhere in it. Then the queue tries again in order. A failed try puts everything back and marks it again, so it loses nothing. Only a person's send triggers a try: app, cron, crew and sub-agent arrivals do not, and no parked-queue drain starts a held slot until one does. While held prompts wait and a sub-agent runs, only a person's send at the queue head runs past the child, from the composer or a linked thread, and every held prompt runs before the send that released them; an app, MCP or cron entry at the head waits for it.Every drain site that read
_last_turn_auth_requiredreadssignout_hold_activeinstead: the discard release insession_reset.py, the turn-end hand-off and both stop hand-offs inqueue_cycle.pyandturn_stop.py, and the completion hint inchat_utils_completion.py. The failing turn's put-back and mark run inturn_failures.py, the sign-in arm. The new names are bound on thechat_utils,chat_runnerandchat_handlersfacades.queue_drain.pyhands each turn the entries it drained, through a new_run_chatparameter carried onturn_locals.py;slot_queue_repository.pygainsqueue_restore, bound on the slot instate_parts/;responsive_chat.pyreuses a put-back entry's row and reports it as already written;slash_commands.pyhands the nested/prompts getturn its row, drained entries and typed flag. The linked-thread route inslack/handler_runtime/inbound.pyhands its turn the redacted row it wrote, andturn_locals.pycarries the typed flag to the sign-in arm.PUT_BACK_KEYlives inslot_queue_repository.py, read by the merge inchat_utils_injected_rows.py._send_binds_agentmoves unchanged fromchat_send.pyto a newchat_api/send_binding.py, bound on thechat_handlersfacade, only to keepchat_send.pywithin the 2000-line cap.Backwards compatibility
Compatible: a slot that never hits a sign-in failure takes every path it took before. The signature tests are updated for the new optional
_run_chatand_start_next_queued_turnkeywords.Accepted limit: the put-back group and row link live only in memory, so after a gateway restart a held run may write its user row a second time, and the restored queue drains without waiting for a new send. Before this PR the prompt was lost.
Removes nothing: no key, field, route or public function is removed or renamed; the new queue-entry keys are process-local.
Tests
test_signout_put_back.py: put-back of drained, merged and composer input; app and tagged input left alone; exactly one user row after a fail-then-drain cycle, for a single entry, a merged run and a composer send; a put-back entry does not merge with a later send; a/prompts getfrom the composer or the queue goes back as typed and writes one row; a put-back entry counts as written; a composed prompt is not put back; a redacted thread send goes back under its own row and reaches the model as typed; a composer send is charged to its author; drained entries drop their ended admission work; with held prompts queued, a person's send at the head passes a running sub-agent and an entry with no person origin does not; held prompts in separate groups all run before the send that released them; an open editor on that entry still holds it.test_signout_release.py: the hold check, including a send behind retained entries (the head-only failure); the failing turn marks its queue; a post-sign-in send behind a discard drains when it lands; a landed discard with only retained entries drains nothing; cron and crew sends do not release the hold, and a cron send to the idle held slot starts nothing; the turn-end hand-off and the completion hint read the hold.test_signout_release_stop.py: both stop hand-offs and the held-synthesis drain resume a post-failure send.test_dashboard_chat_handlers_coverage.py: editing an entry put back under a merged row returns 409; cancelling one frees the rest from that row.test_signout_slack_route.py: a linked thread's turn gets the redacted row the route wrote; a thread message waits behind held prompts, writes one user row when it drains, and reaches the model as typed while its row stays redacted; a resend there runs after the held copy; a thread send after sign-in starts a held prompt past a running sub-agent.test_signout_resend.py: an idle send waits behind held prompts; sending a held prompt's words again runs both in order; a refused resend leaves the held prompt queued;/usageruns past held prompts, while/prompts get,/compactand a path like/var/log/syslogwait; with a sub-agent running, a composer send after sign-in starts a person's held head but not an app's.test_responsive_chat.py: a responsive resend of a held prompt queues behind the held copy.test_dashboard_chat_handlers_coverage.py: a lone put-back entry can be cancelled.Proof: not provable -- other: the new tests import names the fix adds, so a run with every hunk reverted fails at collection; each guard was instead removed one at a time and its test went red
Manual verification
N/A: the sign-out state is reached by
AcpAuthRequired, which the tests raise through the real_run_chat; a real signed-out CLI was not used.Related Issues
Closes #23145
Builds on #22224 (merged).
Sibling sweep
Swept:
git grep -n "_last_turn_auth_required" -- src/Sibling: src/kiro_crew/dashboard/chat_turn/queue_cycle.py -- changed here
Sibling: src/kiro_crew/dashboard/chat_api/turn_stop.py -- changed here
Sibling: src/kiro_crew/dashboard/kiro_readiness.py -- not affected -- it reports sign-in state for a rerun, not whether the queue may drain
Sibling: src/kiro_crew/dashboard/chat_turn/session_reset.py -- changed here
Sibling: src/kiro_crew/dashboard/chat_utils_completion.py -- changed here
Pattern harvest
Not generalizable: the distinction rests on one handler knowing which entries it held, specific to the sign-in failure path.
Checklist
feat|fix|docs|style|refactor|perf|test|chore|ci|build|revert: ...)