fix(dashboard): settle orphaned stop tasks - #9118
Conversation
Design Review (Fable 5, fork) — 🟡 CONCERNSDesign-level review of Design-Verdict: CONCERNS Cancelling on Watch
Suggestions
[DESIGN-REVIEWED] dece265 |
First Principles Review (Fable 5, fork) — ✅ PASSPremise-level review of All lenses run: the defect has provenance (the added First-Principles-Verdict: PASS Verify one thing: the description's "dispatches its preserved queue explicitly" never shipped — the cancelled runner's The description sentence "An idle interrupt then dispatches its preserved queue explicitly, because no provider turn remains to run the normal queue-drain finally path" is contradicted by the shipped mechanism: cancelling the captured runner is precisely what runs that finally path, and What this change shipsIntent: make the dashboard Stop/Interrupt buttons actually end a turn whose runner keeps running after the provider reports no active turn — a FIX. Inventory (7 items)
[FIRST-PRINCIPLES-REVIEWED] dece265 |
GPT 5.6 Review (fork) — ✅ no blocking findingsReviewed Review detailsFINDING -- src/kiro_crew/dashboard/chat_handlers.py:4222 -- cancelling an idle |
Opus 4.8 Review (fork) — ✅ no blocking findingsReviewed |
|
@Premshay Thanks for this one. A repo-wide audit of the open PRs looked at it, and the relationship side is clean: nothing on What holds it up is the diff itself, and there are three things to settle:
The tests read well, including the successor-not-cancelled guard. Could you also rebase? The branch is 107 commits behind Posted from the 2026-09-08 open-PR relationship audit (read-only, one auditor per PR); reply here if any of this is wrong. |
824fa44 to
632f055
Compare
An idle interrupt settles the captured runner, whose finally can already drain the preserved queue. A second handler dispatch can overwrite slot.task and run queued turns concurrently.
632f055 to
dece265
Compare
Problem / Motivation
A stopped dashboard turn can retain an orphaned task after the normal task reference has been cleared. The next stop action then has no task to cancel, leaving the turn lifecycle incomplete.
Why it matters
Users can see a turn remain stuck after requesting stop, and follow-on turn cleanup may not run against the orphaned task.
What changed (motivation → approach → change)
Stop and interrupt capture the slot runner before asking the provider to stop. On terminal outcomes they settle that captured task, never a successor that took ownership while the stop was in flight. An idle interrupt then dispatches its preserved queue explicitly, because no provider turn remains to run the normal queue-drain finally path. The force/second-press path follows the same captured-runner settlement and every idle terminal outcome releases stop state and refreshes the slot view.
Tests
python -m pytest -q test/test_dashboard_chat.py -k 'stop or task'— 52 passed.Manual verification
N/A — the task ownership and cancellation transitions are covered at the dashboard lifecycle boundary.
Related Issues
N/A
Pattern harvest
Rule candidate: review-prompt
Pattern: cleanup paths must reconcile durable task ownership when the fast-path reference is absent.
Checklist
feat|fix|docs|refactor|perf|test|chore|ci|build|revert: ...)Contribution License Agreement
N/A — no CLA wording has been supplied by the project.