Repository navigation
fix: settle a dashboard tab's returned results at its turn's release - #32387
Conversation
UX Review (Opus 5.5) — ⏭️ skippedRevision |
Design Review (Opus 5.5) — ✅ PASSDesign-level review of Design-Verdict: PASS Nothing blocks. This removes a one-parent exemption, so dashboard tabs now follow the same release rule cron and channel parents already use, and nothing outside the patch still reads Notes
[DESIGN-REVIEWED] cf1455e Description read[DESCRIPTION-READ] 18293e2e16bd4d0b687d75d5cdb1c25cdbd5f85746978d57351c9fa88da57621 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 change deletes a special case. The dashboard-born exemption was the cause of the bug, and removing it is the whole fix. What this change shipsInventory (7 items) — 6 justifiedIntent: a dashboard user who stops a turn that ran
[FIRST-PRINCIPLES-REVIEWED] cf1455e Description read[DESCRIPTION-READ] c39685d4278f9700a224d49940cfbd3dac66de493cac0384c89648039e45b059 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: |
A dashboard tab whose turn called spawn_sub_agents acknowledged each returned child on the mark, so a turn the user stopped before it landed lost the result. Every parent now holds the mark pending under the spawning attempt and settles it at that attempt's release, as cron and channel parents already do (#27508): a landed turn confirms it, any other end delivers it. The specs and the brokered-delivery RFC no longer describe the removed dashboard-born exception. Builds on #28576 by @cruisercohen. Closes #23495 Co-authored-by: Matt Cohen <mattcohe@amazon.com>
371b9c1 to
cf1455e
Compare
|
Rebased: main moved in docs/system-specs/modules/subagent.md (same file) plus 91 neighbouring or importing files since this head went green (d27a5fd -> 928d145); CI re-running. The patch is unchanged by the rebase; the cancelled [operator: bolichen97] |
KiroCrewCaptain
left a comment
There was a problem hiding this comment.
Approved for the on-call. Review lanes pass on cf1455e, no conflict, no open change request.
iamwhatever
left a comment
There was a problem hiding this comment.
Approve at cf1455e68aed9f5e771f4445e705dfafad4fbc43.
Removing settles_at_release puts dashboard tabs on the same release rule cron and channel parents already use. The mark now only holds a pending mark under the spawning attempt (run_control.py#L457, #L561). The tab route parks or delivers through _inline_verdict (subagent_injection.py#L687), and a landed release settles the queued slot entry. Every failure mode falls back to delivering the result, so a stopped turn can no longer lose it. No remaining reader of the removed predicate exists, and all checks are green.
AI findings judged non-blocking
- Design: RFC step 3 still reads as current. That list describes #17684 at a pinned commit, and the PR adds a note directly under it saying the exception is gone (code). Doc wording in a draft RFC.
— crew-pr-reviewer (r149)
…32387) A dashboard tab whose turn called spawn_sub_agents acknowledged each returned child on the mark, so a turn the user stopped before it landed lost the result. Every parent now holds the mark pending under the spawning attempt and settles it at that attempt's release, as cron and channel parents already do (#27508): a landed turn confirms it, any other end delivers it. The specs and the brokered-delivery RFC no longer describe the removed dashboard-born exception. Builds on #28576 by @cruisercohen. Closes #23495 (cherry picked from commit 2a4fb38) Original author: Bolin Chen (#32387). docs/system-specs/modules/subagent.md hand-resolved: removed the dashboard-born-tab sentence this PR makes untrue and kept the rest of release's paragraph; main's #25261 sentence belongs to a main change not on release.
Problem / Motivation
Goal: a dashboard tab whose own turn called
spawn_sub_agentsnever loses a returned child result when that turn ends without landing (the user presses Stop, the backend fails, the turn is cancelled).A dashboard tab acknowledged a returned child as soon as the reply carrying it reached kiro-cli's pipe, before the tab's own turn finished. If the user then pressed Stop, the completion that would have delivered the result was already acknowledged and tombstoned: no completion turn followed, and the result was in no finished answer. #27508 closed this window for cron and channel parents and left the dashboard tab's own window open.
Builds on #28576 by @cruisercohen.
Why it matters
Every dashboard user who stops a turn that used
spawn_sub_agentsafter its children returned can lose those results with no trace. Dashboard tabs are the most common parent.Not a goal
What changed (motivation → approach → change)
Symptom → cause.
parent_turns.settles_at_releaseanswered False fordashboard:keys. So the mark flagged a dashboard tab's child with no attempt,api_spawn_mark_collectedsettled the tab's queued completion at mark time, and_route_subagent_to_tabskipped the completion on the bare mark.Change. The dashboard-born exception is gone; every parent takes the #27508 rule. That rule already runs on the dashboard runner (it drives cron and channel tabs too), and the runner already notes landing on
end_turn(turn_stats.py), so the runner itself is unchanged.parent_turns.pysettles_at_releaseremovedrun_control.pyok/no_slot) unchangedsubagent_injection.py_inline_verdictfor every parent: a pending mark parks the completion until the turn releases; landed confirms it (no second turn), any other end delivers itsubagent.md,mcp.md,slack-gateway.md, the draft RFCrfc-brokered-delivery-confirmation.md, and the comments inrun_record.py,subagent_read_collected.pyandturn_stats.pyno longer describe the removed exceptionBackwards compatibility
Compatible: no API or wire change;
mark-collectedtakes and answers the same fields. On a dashboard tab a returned result whose turn did not end onend_turnnow gets its completion turn (one duplicate at worst, never a loss), where before it was dropped. A landed turn still plays no duplicate.Reader: src/kiro_crew/parent_turns.py:settles_at_release -- chat -- removed; every caller (run_control, subagent_injection, and the gateway and messaging re-exports) is changed here, and git grep finds no other reader in src/ or test/
Reader: src/kiro_crew/dashboard/messaging_api/run_control.py:api_spawn_mark_collected -- chat -- a dashboard tab's queued completion is no longer settled at mark time; the landed release settles it (test_collecting_a_member_whose_announce_already_queued_settles_it)
Reader: src/kiro_crew/slack/gateway_runtime/subagent_injection.py:_route_subagent_to_tab -- chat -- skips only a confirmed mark and parks a pending one (test_a_tab_parents_landed_turn_plays_no_duplicate_and_settles_at_its_release[dashboard-tab])
Tests
Proof: PROVEN test/test_spawn_sub_agents_settle_at_release.py::test_a_dashboard_born_tab_whose_turn_is_stopped_still_gets_its_result, test/test_spawn_sub_agents_settle_at_release.py::test_a_tab_parents_landed_turn_plays_no_duplicate_and_settles_at_its_release[dashboard-tab], test/test_spawn_sub_agents_settle_at_release.py::test_a_queued_tab_completion_is_settled_only_by_its_turns_landed_release[dashboard-tab-landed], test/test_subagent_queued_visibility.py::test_collecting_a_member_whose_announce_already_queued_settles_it (head 371b9c1)
test_a_dashboard_born_tab_whose_turn_is_stopped_still_gets_its_result(new) and thedashboard-tabcases oftest_a_tab_parents_landed_turn_plays_no_duplicate_and_settles_at_its_releaseandtest_a_queued_tab_completion_is_settled_only_by_its_turns_landed_release: a realSessionManager, the real mark and the real tab route; a stopped turn delivers the result once, a landed one plays no duplicate, and a completion already queued on the tab is removed only by a landed release.test_gateway_subagent_injection.pymarks the child returned in a landed turn;test_subagent_queued_visibility.pyandTestApiSpawnMarkCollected::test_records_ids_bounded_and_skips_non_stringsassert the mark holds a pending mark and settles nothing, andtest_collected_ids_are_bounded_and_knownmarks under a live turn, then settles what the mark flagged.-n0, 10 times at-n 4 --dist loadgroup --max-worker-restart=2besidetest_spawn_sub_agents_duplicate_never_loss.pyandtest_subagent_injection_live_turn.py, and once in a shuffled order (seed 987).parent_turns, the tab route, the landing note or the messaging and gateway facades pass (1805 tests,-n 4).Manual verification
N/A — unit coverage sufficient: the new test drives the real session manager, mark endpoint and tab route through a stopped and a landed turn.
Related Issues
Closes #23495
Sibling sweep
Swept: git grep -nE "settles_at_release|dashboard-born" -- src/ test/ docs/
Sibling: src/kiro_crew/dashboard/messaging_api/run_control.py -- changed here
Sibling: src/kiro_crew/slack/gateway_runtime/subagent_injection.py -- changed here
Sibling: src/kiro_crew/dashboard/chat_turn/recipient.py -- not affected -- its dashboard-born mentions are about mirror recipients, not inline marks
Pattern harvest
Not generalizable: one predicate exempted a single parent kind from a rule every other parent already followed; removing the exemption is the fix, and no other predicate of that shape gates the inline-collect path.
Checklist
feat|fix|docs|style|refactor|perf|test|chore|ci|build|revert: ...)Contribution License Agreement
Contributions are accepted under the project's Apache-2.0 license; see the Licensing section of CONTRIBUTING.md.