Repository navigation
fix(dashboard): keep the warm brief card when the user leaves after the opener - #24512
Conversation
UX Review (Opus 5.5) — ⏭️ skippedRevision |
Design Review (Opus 5.5) — ✅ PASSDesign-level review of Design-Verdict: PASS Nothing blocks: the per-thread "opener posted" set is scoped to the brief's lifetime and cleared in Notes
[DESIGN-REVIEWED] 6852823 Description read[DESCRIPTION-READ] 3acc2b55dd43727c55c6d7165936910be88efbb1a28a37fd71e8e01e0479de09 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 This fixes a reported defect (#24502) in the code that causes it, and it keeps the cancel and stale-result guards. The one open question is a recorded leave rule that this diff reverses itself. Notes
What this change shipsInventory (5 items) — 4 justifiedIntent: once a returning owner has seen the "Welcome back" opener, the progress card still arrives even if they leave the thread. FIX.
[FIRST-PRINCIPLES-REVIEWED] 6852823 Description read[DESCRIPTION-READ] b3d2b329e83a561fc29cede6850ecad1635ab2bcc65e5997f845116c52433834 That sha256 names the PR description this verdict read. Recompute it with |
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: |
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: |
74bc868 to
b4a1c41
Compare
|
self-added: no
|
b4a1c41 to
6852823
Compare
Bring the delayed-task-brief RFC and its directory index into agreement with the document's amendments and with what shipped on main. The warm task brief shipped in #20422 and its amendments shipped in #21750, #22828, #22839, #23847, #24512 and #24307, but the RFC still read `accepted` ("nothing built yet") with implementation-prs [] and a 2026-10-14 audit stamp. The front matter now records status implemented, those seven PRs, and last-audited 2026-10-28 at 7cbf872; the section 1 status and "Audited on" lines match it; and the snapshot's third field is renamed "Suggested actions" to match the section 3.5 output it feeds. The README index row no longer describes the superseded preparing-status design or says implementation waits for the RFC. It reads implemented, names the shipped PRs, and summarises the shipped trigger, the free-form brief card and the leave-after-opener rule. The audit paragraph gains a dated re-audit sentence for the row. Closes #20887
Bring the delayed-task-brief RFC and its directory index into agreement with the document's amendments and with what shipped on main. The warm task brief shipped in #20422 and its amendments shipped in #21750, #22828, #22839, #23847, #24512 and #24307, but the RFC still read `accepted` ("nothing built yet") with implementation-prs [] and a 2026-10-14 audit stamp. The 2026-10-28 writer amendment (section 3.8, #25433) is design only: main has no wake turn and no `dashboard.warm_brief_wake` setting. So the front matter now records status partial, those seven PRs, and last-audited 2026-10-29 at 4d36177; the section 1 status line names what shipped and that section 3.8 is not built; the "Audited on" line matches; and the snapshot's third field is renamed "Suggested actions" to match the section 3.5 output it feeds. The README index row no longer describes the superseded preparing-status design or says implementation waits for the RFC. It reads partial, names the shipped PRs, summarises the shipped trigger, the free-form brief card and the leave-after-opener rule, and names the unbuilt writer amendment. The audit paragraph gains a dated re-audit sentence for the row. Closes #20887
…21712) Bring the delayed-task-brief RFC and its directory index into agreement with the document's amendments and with what shipped on main. The warm task brief shipped in #20422 and its amendments shipped in #21750, #22828, #22839, #23847, #24512, #24307, #25881 (Crew Mode scope), #26500 (fixed progress orb) and #26652 (first part of the 2026-10-31 redesign), yet the front matter and README row still read `accepted` ("nothing built yet") with implementation-prs [] and a 2026-10-14 audit stamp. Not built on main: the 2026-10-28 writer amendment (section 3.8; main has no wake turn and no `dashboard.warm_brief_wake` setting), the 2026-11-01 trigger amendment (#26938 is open), and the live checks, links and copied option buttons of section 3.9.3. So the front matter now records status partial, those ten PRs, and last-audited 2026-11-01 at fed53fc; the section 1 status line names what shipped and what is not built; the "Audited on" line matches; and the snapshot's third field is renamed "Suggested actions" to match the section 3.5 output it feeds. The README index row no longer describes the superseded preparing-status design or says implementation waits for the RFC. It reads partial, names the shipped PRs, summarises the shipped trigger, the one-message brief with its fixed card and quiet return, and names the unbuilt parts. The audit paragraph gains a dated re-audit sentence for the row. Closes #20887
Problem / Motivation
Goal: Leaving a crewmate thread after the "Welcome back" opener no longer throws away the progress card; it still arrives once, while the user is away or after they come back.
The warm brief posts two messages: a fixed opener, then a progress card from one background model call. If the user hides the browser tab or opens another chat while that call runs, even for two seconds, the card is never posted. Coming back posts nothing either, because the claim row is already written. The thread is left with the opener alone, so the crewmate looks like it stopped mid-sentence.
Why it matters
Every owner who glances away during the up-to-60-second model call loses the brief they came back for. Switching tabs is the normal way people use the dashboard, so this hits most real returns.
Not a goal
What changed (motivation → approach → change)
Root cause: in
src/kiro_crew/dashboard/warm_task_brief.py,handle_focus_framecalledcancel_warm_task_briefwhenever the last owner view left the thread, and_still_currentrequired the thread to be on screen before publishing. Either one dropped a card that was already half-delivered.The fix records, per thread, that the opener is out (
_warm_task_brief_openedindashboard/state_parts/dashboard_state.py). After that point leaving no longer cancels, and the publication re-check (_settled,_still_current,_wait_for_idle_turn) skips the on-screen test. Every other guard stays: a typed row, reset or close still cancels or abandons the brief, a new user turn still makes the result stale, and a running turn still defers publication. A return while the brief is in flight starts nothing new (already_preparing/short_away), so there is no duplicate.This follows the accepted RFC
docs/request-for-change/rfc-delayed-task-brief.md; it gains a 2026-10-26 leave amendment, and the owning specdocs/system-specs/modules/session.mdand thedocs/feature-map/README.mdrow say the same.Backwards compatibility
Compatible: the only behaviour change is that a card which used to be dropped is now posted; no field, route or message kind changes.
Removes nothing: the diff only stops discarding a result; no path, row, key or reader is taken away.
Tests
test/test_warm_task_brief.py:test_leaving_after_the_opener_still_publishes_the_card(tab hidden, other chat): the card posts after the owner leaves mid-call.test_quick_leave_and_return_during_the_model_call_posts_one_card: a quick away-and-back keeps the same task, posts exactly one card, and a later return adds nothing.test_typing_after_leaving_past_the_opener_still_drops_the_card: a typed row still cancels.test_cancel_during_model_suppresses_result_without_cancelling_acquisitionnow registers its task so it tests a real cancel, not a leave.Proof: PROVEN test/test_warm_task_brief.py::test_leaving_after_the_opener_still_publishes_the_card[tab_hidden], test/test_warm_task_brief.py::test_leaving_after_the_opener_still_publishes_the_card[other_chat], test/test_warm_task_brief.py::test_quick_leave_and_return_during_the_model_call_posts_one_card (head b4a1c41)
Determinism: the four tests passed 20 repeated runs, and the whole file (91 tests) passed in three shuffled orders. No sleeps or wall-clock waits; each test blocks the model on an
asyncio.Event.Manual verification
N/A — unit coverage sufficient: the change is server-side control flow, and the tests drive the real
handle_focus_frameandnote_foregroundpath thatws.pycalls.Related Issues
Closes #24502
Sibling sweep
Swept: git grep -nE "cancel_warm_task_brief|_is_foreground" -- src/
Sibling: src/kiro_crew/dashboard/chat_handlers.py -- not affected -- a real user send, which must still cancel
Sibling: src/kiro_crew/dashboard/chat_api/slot_lifecycle.py -- not affected -- reset and close, which must still cancel
Sibling: src/kiro_crew/dashboard/handlers/members_thread_turns.py -- not affected -- a typed crewmate turn, which must still cancel
Pattern harvest
Not generalizable: the defect is one feature's choice to treat "off screen" as "cancelled" after part of its output was already posted.
Checklist
feat|fix|docs|style|refactor|perf|test|chore|ci|build|revert: ...)