Repository navigation
feat(mcp): session_run_queued runs one of the caller's queued messages now - #15469
Pearcekieser wants to merge 1 commit into
Conversation
|
Intent: Let a session that queued a message on a busy session it created run that message now, reusing the queue card's Run-now path, without ever promoting a message a person or another session queued. |
Design Review (Fable 5, fork) — ✅ PASSDesign-level review of Design-Verdict: PASS Verify the #15421 convergence: [DESIGN-REVIEWED] c5a815b Description read[DESCRIPTION-READ] b107e9c515eb757b57ea62af4ba70ed014cdc6d08c4b3d8ce8524d7fcd085691 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 (Fable 5, fork) — ✅ PASSPremise-level review of First-Principles-Verdict: PASS Verify the extraction left What this change shipsInventory (9 items) — 9 justifiedIntent: let a session run one message it queued on a busy session it created, without a blind stop — an ADDITION (linked issue #15450).
All base helpers the diff leans on exist ( [FIRST-PRINCIPLES-REVIEWED] c5a815b Description read[DESCRIPTION-READ] b237fec442231bd35c06fe4d120cfb9ecbf98c07ed0994ebad469ef5f141493b That sha256 names the PR description this verdict read. Recompute it with |
GPT 5.6 Review (fork) — 🔴 changes requested (blocking)Reviewed 2 of 2 blocking finding(s) are security-class and were withheld from adjudication, so the blocking verdict stands. BLOCKING -- src/kiro_crew/dashboard/chat_handlers.py:6923 -- late compaction leaves a refused queue promotion
BLOCKING -- src/kiro_crew/dashboard/chat_runner.py:8879 -- run-now ownership binding is cleared before successful dispatch
[BLOCK-MERGE] c5a815b Adjudication (Opus 5) — is blocking on each finding proportionate?F1 — Harm rung LOW, not loss or corruption: F2 — No rarity argument is available: the binding is consumed unconditionally before the drain is even attempted, ahead of 🏷️ Fenced finding(s) machine-flagged as likely edge caseThe security fence keeps these findings blocking regardless of adjudication; the only clearance path is a human override recorded by a repository writer, who must independently verify a rationale before recording it — it is machine-authored, and a wrong override on a security-class finding ships exactly the class the fence exists to stop. (This lane's comment deliberately carries no override command.)
|
Opus 5 Review (fork) — ✅ no blocking findingsReviewed |
|
48d53fe to
357b330
Compare
|
|
|
|
357b330 to
f0832bf
Compare
|
26643ef to
227cc05
Compare
…s now Adds session_run_queued to kirocrew-dashboard: on a running target it stops the turn cooperatively with the caller's chosen queue entry promoted and the rest of the queue kept; on an idle one it dispatches the entry. Only sessions the caller created and only entries it queued with session_send. The Run-now route's stop tail and idle re-check are shared with the new verb.
|
227cc05 to
c5a815b
Compare
|
Rebased onto current main to clear the conflict with |
|
🤖 Kiro Crew [operator: dwu96#8c08bee0]: This PR has been inactive for 7+ days. I reviewed the blockers but they require your input:
What would unblock this fastest: rule on F1 — rebut-and-override, or implement. If you rule rebut-and-override and want F2 driven mechanically on its own, re-apply Not blocking, recorded so a later pass does not re-derive it: When you've addressed these, the pipeline will re-assess on its next cycle. |
|
Automated rebase attempt: stopped on conflicts, nothing pushed I tried to rebase
Please rebase locally ( |
|
🤖 Kiro Crew Auto-Pipeline [operator: buluoray#ce473fca]: @Pearcekieser, checking in on this PR for #15450 (and #15421). What blocks it today at Do you still plan to finish it? If there is no reply within 7 days, a maintainer may take the PR over or close it in favour of a fresh one. |
|
Thanks for this PR. It now conflicts with main. Could you rebase onto the latest main and resolve the conflicts? We will review it again once it is rebased and CI is green. There has been no push here in over 30 days, so we may close it if there is no activity in the next 14 days. |
|
[operator: bolichen97] Maintainer decision: F1 (a compaction that commits after the pre-claim probe) stays rebutted, and F2 (the run-now binding cleared before the targeted drain) is fixed in this PR by keeping the binding until the targeted entry is dispatched or gone. On merge order, #15423 merges first and this PR then uses its ownership check. The reason: F1 matches how the dashboard's own Run-now route on main already handles that case, F2 can let a later drain run a message the caller did not pick, and #15423 is where a caller gets the queue ids this tool takes. The F1 override can be recorded once the PR is rebased and the lane raises it again on the new head. |
|
[operator: bolichen97] Continuing this in #38393; thanks for the start. |
Problem / Motivation
Goal: A session that queued a message on a busy session it created can run that message now, without touching anything a person or another session queued.
session_sendto a busy session queues the message behind the running turn and answersstarted: false. The sender cannot then say "run this one now". A conductor whose worker is deep in a long, wrong turn can wait, orsession_stopthe worker, but it cannot choose which queued message runs next. People already have this: the "run now" button on a queued card callsPOST /api/chat/slots/{slot}/interrupt. That route checks app scope only, so it cannot tell an agent's entry from a person's, and thekirocrew-dashboardMCP server does not expose it.Why it matters
A correction sent to a busy worker waits behind the turn it is meant to correct. The conductor's only lever is a blind stop, after which the worker runs its queue in arrival order, stale instructions first.
Not a goal
session_queue(feat(mcp): session_queue lets a sender list, cancel and reorder what it queued #15421), which is also how a caller learns its queue ids.What changed (motivation → approach → change)
session_run_queued(target, queue_id)doesstop already in progressslot_orchestrating; nothing changescompacting, as the Stop button is; nothing changesThe card's Run-now route already does both halves, but its authorization lives on the aiohttp request. So the mechanism moved out of
api_chat_slot_interruptinto shared helpers insrc/kiro_crew/dashboard/chat_handlers.py, the waystop_slot_turnserves both the Stop button andsession_stop. The route calls the same stop tail (_interrupt_claimed_turn) and the same idle re-check (_idle_run_now_refusal) as before. The newrun_queued_slot_turnis the entry point for a caller that has no request. A dequeue bound to one queue id (_start_next_queued_turnwithrequired_queue_id, insrc/kiro_crew/dashboard/chat_runner.py) skips the merge-setting config read, since that setting never applies to it, so neither Run-now path reads config on the event loop. When this verb stops a running turn, it leaves a one-shot binding on the slot (_ChatSlot._run_now_queue_id, memory only). The stopped turn's tail drain consumes it asrequired_queue_id, so withdashboard.merge_queued_messageson, the promoted entry runs alone and never sweeps a person's or another session's queued messages into its turn. If the entry was cancelled meanwhile, the drain falls back to the ordinary queue order.run_queued_targetinsrc/kiro_crew/dashboard/session_control.pygates before anything changes. It runsauthorize_target, then requires that the caller created the target, whatever class of caller it is. The target must not be remote-bound, andqueue_idmust name an entry the caller queued withsession_sendorsession_broadcast. That last check (queued_by_caller) reads the sender stampsession_sendalready writes: the caller's slot key and its current tab id. A person's typed message, another session's delivery, and any entry with a producer kind, payload or consumption callback are refused withnot_your_entry. On the idle path the gate runs again after the slot-lock await, synchronously, before dispatch. The ownership rule matchessession_queue's in #15421, and whichever lands second shares one helper.The tool (
src/kiro_crew/mcp_dashboard.py, schema insrc/kiro_crew/validation.py) rides a new strict-internalPOST /api/session-control/run-queued(src/kiro_crew/dashboard/handlers/session_control.py, registered and listed insrc/kiro_crew/dashboard/server.py). It is withheld from unattended conductors (agent.py), blocked for channel agents (channel.py), and titled inmcp_tool_titles.json. Docs coverdocs/session-control.md, the docs index, the MCP architecture table, the feature map and the session-control module spec.Backwards compatibility
Compatible: a new tool and a new route. The interrupt route's stop tail and idle re-check moved into helpers with the same logic, responses and audit lines.
Tests
test/test_mcp_dashboard_session_run_queued.py(42 tests). Running target: stopped with the entry promoted, queue kept, a pending stop answers a no-op, an orchestrating or compacting target is declined untouched, and a provider reporting no active turn is not reported as a stop. Idle target: dispatched through Run-now, a vanished entry and a mid-stop target are refused, the entry is re-checked after the lock. Ownership: person, peer, previous-occupant and producer-shaped entries are refused on both paths. Also the creator fence, remote, self and unknown-entry refusals, schema, route auth and mapping, the strict route set, and tool dispatch.test/test_chat_runner_coverage.py: a dequeue withrequired_queue_iddoes not load config; one without it still does.Manual verification
N/A: a server-side route plus text rendering, covered at the handler and MCP-dispatch level; no UI change.
Related Issues
Fixes #15450
Checklist
feat|fix|docs|style|refactor|perf|test|chore|ci|build|revert: ...)