Repository navigation
fix(dashboard): drain a decided queue entry on its own row - #24418
Conversation
The queue drain unions every merged entry's meta into one row, so when two queued messages each carried a message.steer decision, the second receipt overwrote the first. A decided entry now ends a merge run and drains alone, the same rule attachments and quotes already follow, so each row keeps its own receipt. Part of #12438
UX Review (Opus 5.5) — ⏭️ skippedRevision |
Design Review (Opus 5.5) — ✅ PASSDesign-level review of Design-Verdict: PASS Nothing blocks: it applies the existing one-meta-per-row stop rule to Notes
[DESIGN-REVIEWED] 6711db9 Description read[DESCRIPTION-READ] c2ea8b33435bff118a89ac18fa8dbe2510b5ca77b2d81ca575da1d7425566917 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 Nothing blocks. The fix works at the mechanism: a decided entry now ends a merge run, so the last-writer-wins What this change shipsInventory (2 items) — 2 justifiedIntent: each queued message that a
[FIRST-PRINCIPLES-REVIEWED] 6711db9 Description read[DESCRIPTION-READ] 430002ebdb09993f60246c7a7443406f19cf6aaf4f758df152b9354a8dacc199 That sha256 names the PR description this verdict read. 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: |
KiroCrewCaptain
left a comment
There was a problem hiding this comment.
Tier 1 auto-approve: fix (3 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: a decided queue entry no longer merges with its neighbours, so its receipt stays on its own row; regression tests added. Spec files changed as a ride-along (a minority of the diff on both file count and changed lines), not reviewed as a design decision: docs/system-specs/modules/decisions.md.
Problem / Motivation
Goal: Each queued message that a
message.steerdecision chose keeps its own decision receipt, even when the queue would have merged it with other messages.When the slot is busy and
dashboard.merge_queued_messagesis on, the drain folds several queued messages into one "[N queued messages merged]" turn and one row. It builds that row's meta by updating one dict with each entry's meta in turn (chat_turn/queue_drain.py), so when two merged entries each carriedmeta.decisions_strip, the later one overwrote the earlier. The row showed one receipt for a decision about a different message, and the other decision's receipt was lost.Why it matters
The receipt is how a person sees what Jev decided about their message and files feedback on it. A merged row that shows the wrong message's receipt sends that feedback against the wrong turn id, and the lost one cannot be rated at all.
Not a goal
readSteerRecord) to carry a list, which changes the UI. This PR instead reuses the existing one-meta-per-row rule and changes no UI. A maintainer can rule otherwise.What changed (motivation → approach → change)
A queued message that a decision steered now drains on its own row, so its receipt is never overwritten.
_dequeue_next_message(dashboard/chat_utils_injected_rows.py) already ends a merge run at any entry whose meta cannot be shared by several texts: attachments, a whole-message quote, a possibly-delivered steer and an automation steer. An entry carryingmeta.decisions_stripnow ends a run the same way. Undecided neighbours still merge up to it, and a decided entry at the head of the queue pops alone.The spec says the same:
decisions.md§10 names the rule beside the queue-path receipt.Backwards compatibility
Compatible: no field, key or caller changes. A queue with no decided entry merges exactly as before.
Removes nothing: the only behaviour change is that a decided entry no longer merges with its neighbours; every message is still delivered, in order.
Tests
test/test_merge_queued_messages.py::TestADecidedEntryDrainsAlone:decisions_stripturn id;Proof: PROVEN test/test_merge_queued_messages.py::TestADecidedEntryDrainsAlone::test_each_decided_entry_drains_on_its_own_row, test/test_merge_queued_messages.py::TestADecidedEntryDrainsAlone::test_undecided_neighbours_still_merge_up_to_a_decided_entry (head 6711db9)
The related queue and steer test files pass (234 tests), and the flake-pattern ratchet passes.
Manual verification
N/A —
_dequeue_next_messageis a pure function over the slot queue, and the unit tests drive it directly.Related Issues
Part of #12438
Open PRs that edit
_dequeue_next_messagetoo, which may need a small rebase if this lands first: #21369 (adds lines in the same function) and #18517 (edits the same file, outside this function).Sibling sweep
Swept: git grep -nE "_drained_meta.update|for item in consumed" -- src/kiro_crew/dashboard
Sibling: src/kiro_crew/dashboard/chat_turn/queue_drain.py:884 -- not affected -- the meta union itself is unchanged; a decided entry no longer reaches it together with another entry
Sibling: src/kiro_crew/dashboard/responsive_chat.py -- not affected --
dequeue_waiting_runkeeps one row per message, so each row keeps its own metaPattern harvest
Rule candidate: review-prompt
Pattern: per-message metadata merged into one record by dict.update, so a later entry silently overwrites an earlier one
Checklist
feat|fix|docs|style|refactor|perf|test|chore|ci|build|revert: ...)