Skip to content

fix(dashboard): drain a decided queue entry on its own row - #24418

Merged
KiroCrewCaptain merged 1 commit into
mainfrom
crew/issue-triage/12438-decided-entry-drains-alone
Oct 26, 2026
Merged

KiroCrewCaptain merged 1 commit into
mainfrom
crew/issue-triage/12438-decided-entry-drains-alone

Conversation

@iamwhatever

Copy link
Copy Markdown
Contributor

Problem / Motivation

Goal: Each queued message that a message.steer decision 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_messages is 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 carried meta.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

  • Showing several receipts on one merged bubble (option B in message.steer follow-ups #12438). That would keep merging and teach the drain and the user-row reader (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.
  • Any change to how a decision is made, stamped or rendered.
  • Any change to merging of undecided messages.

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 carrying meta.decisions_strip now 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:

  • two decided entries drain one at a time, neither as a merged turn, and each consumed entry keeps its own decisions_strip turn id;
  • two undecided entries still merge, and the merge stops before the decided entry that follows them.

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_message is 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_message too, 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_run keeps one row per message, so each row keeps its own meta

Pattern 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

  • At most two commits (one is the norm), with a Conventional Commits title (feat|fix|docs|style|refactor|perf|test|chore|ci|build|revert: ...)
  • Existing tests pass and new tests added for new functionality
  • Self-review completed; code follows project style guidelines
  • Documentation updated (if applicable)
  • No secrets, credentials, or internal references in the diff

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
@iamwhatever
iamwhatever requested review from a team and KiroCrewCaptain as code owners October 26, 2026 08:51
@iamwhatever
iamwhatever requested a review from CrysisDeu October 26, 2026 08:51
@github-actions github-actions Bot added the readiness: checking Automated validation is still running label Oct 26, 2026
@github-actions

Copy link
Copy Markdown
Contributor

UX Review (Opus 5.5) — ⏭️ skipped

Revision 6711db9eb673b66f766f8a1f5d2a93c32c5b3778 touches no user-facing surface (no changes under website/ or committed screenshots), so the UX review was skipped. Does not block merge.

@github-actions

Copy link
Copy Markdown
Contributor

Design Review (Opus 5.5) — ✅ PASS

Design-level review of 6711db9eb673b66f766f8a1f5d2a93c32c5b3778 — updated in place on each push. A BLOCK verdict blocks PR readiness; PASS does not.

Design-Verdict: PASS

Nothing blocks: it applies the existing one-meta-per-row stop rule to decisions_strip, which fixes the overwrite where the meta gets built and leaves merging of undecided entries unchanged.

Notes

  • The literal "decisions_strip" is now read in the drain as well as in the stamping paths. Using the shared key constant, if one exists, would let a rename reach this check too.

[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 .github/scripts/pr-description-capture.sh over the same inputs; if it differs, the description or that evidence changed after this verdict was formed and any finding drawn from either is unproven.

@github-actions

Copy link
Copy Markdown
Contributor

First Principles Review (Opus 5.5) — ✅ PASS

Premise-level review of 6711db9eb673b66f766f8a1f5d2a93c32c5b3778 — why this exists and whether the shipped surface is the smallest honest version. Updated in place on each push. A BLOCK verdict blocks PR readiness; PASS does not.

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 _drained_meta.update at chat_turn/queue_drain.py:884 never gets two receipts to overwrite.

What this change ships

Inventory (2 items) — 2 justified

Intent: each queued message that a message.steer decision chose keeps its own decision receipt, so feedback lands on the right turn. FIX.

  1. With merging on, a queued message a decision steered is now delivered on its own row instead of being folded into a "[N queued messages merged]" turn; undecided neighbours still merge up to it — justified
  2. The decisions.md §10 spec now states that a decided entry never merges — justified

[FIRST-PRINCIPLES-REVIEWED] 6711db9

Description read

[DESCRIPTION-READ] 430002ebdb09993f60246c7a7443406f19cf6aaf4f758df152b9354a8dacc199

That sha256 names the PR description this verdict read. Recompute it with .github/scripts/pr-description-capture.sh; if it differs, the description changed after this verdict was formed and any finding drawn from the description is unproven.

@github-actions

Copy link
Copy Markdown
Contributor

Opus 5.5 Review — ✅ no blocking findings

Reviewed 6711db9eb673b66f766f8a1f5d2a93c32c5b3778 — this comment is updated in place on each push.

Review details

No findings.

[OPUS-REVIEWED] 6711db9

Verdict parsed from the review's SHA-scoped output markers for commit 6711db9eb673b66f766f8a1f5d2a93c32c5b3778.

False positive or not applicable? A repository writer can comment:
/ai-review override fable 6711db9eb673b66f766f8a1f5d2a93c32c5b3778 false-positive: <reason, 20 to 500 characters>

@github-actions

Copy link
Copy Markdown
Contributor

GPT 6.1 Review — ✅ no blocking findings

GPT 6.1 completed its review of 6711db9eb673b66f766f8a1f5d2a93c32c5b3778 and found no blocking issues.

This comment is updated in place on each push.

Review details

No findings.
[GPT-REVIEWED] 6711db9

False positive or not applicable? A repository writer can comment:
/ai-review override gpt 6711db9eb673b66f766f8a1f5d2a93c32c5b3778 false-positive: <reason, 20 to 500 characters>

@github-actions github-actions Bot added readiness: passed Eligible automated validation passed for the current revision and removed readiness: checking Automated validation is still running labels Oct 26, 2026
@KiroCrewCaptain
KiroCrewCaptain enabled auto-merge (squash) October 26, 2026 10:08

@KiroCrewCaptain KiroCrewCaptain left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@KiroCrewCaptain
KiroCrewCaptain merged commit 3bcc2d0 into main Oct 26, 2026
107 checks passed
@KiroCrewCaptain
KiroCrewCaptain deleted the crew/issue-triage/12438-decided-entry-drains-alone branch October 26, 2026 11:35
@github-actions github-actions Bot removed the readiness: passed Eligible automated validation passed for the current revision label Oct 26, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants