Skip to content

feat(mcp): session_run_queued runs one of the caller's queued messages now - #15469

Open
Pearcekieser wants to merge 1 commit into
kirodotdev:mainfrom
Pearcekieser:feat/mcp-session-run-queued
Open

Pearcekieser wants to merge 1 commit into
kirodotdev:mainfrom
Pearcekieser:feat/mcp-session-run-queued

Conversation

@Pearcekieser

@Pearcekieser Pearcekieser commented Sep 30, 2026 •

Copy link
Copy Markdown
Contributor

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_send to a busy session queues the message behind the running turn and answers started: false. The sender cannot then say "run this one now". A conductor whose worker is deep in a long, wrong turn can wait, or session_stop the worker, but it cannot choose which queued message runs next. People already have this: the "run now" button on a queued card calls POST /api/chat/slots/{slot}/interrupt. That route checks app scope only, so it cannot tell an agent's entry from a person's, and the kirocrew-dashboard MCP 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

What changed (motivation → approach → change)

Target state What session_run_queued(target, queue_id) does
Running Stops the turn cooperatively (its work is discarded), moves the chosen entry to the front, keeps the rest of the queue
Running, stop already pending Nothing; answers stop already in progress
Running a multi-stage plan Refused with slot_orchestrating; nothing changes
Running, but an automatic compaction holds the session Declined with outcome compacting, as the Stop button is; nothing changes
Running, but the provider reports no active turn Moves the entry to the front; says nothing was stopped or started
Idle (e.g. held by attached sub-agents) Starts the chosen entry now

The 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_interrupt into shared helpers in src/kiro_crew/dashboard/chat_handlers.py, the way stop_slot_turn serves both the Stop button and session_stop. The route calls the same stop tail (_interrupt_claimed_turn) and the same idle re-check (_idle_run_now_refusal) as before. The new run_queued_slot_turn is the entry point for a caller that has no request. A dequeue bound to one queue id (_start_next_queued_turn with required_queue_id, in src/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 as required_queue_id, so with dashboard.merge_queued_messages on, 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_target in src/kiro_crew/dashboard/session_control.py gates before anything changes. It runs authorize_target, then requires that the caller created the target, whatever class of caller it is. The target must not be remote-bound, and queue_id must name an entry the caller queued with session_send or session_broadcast. That last check (queued_by_caller) reads the sender stamp session_send already 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 with not_your_entry. On the idle path the gate runs again after the slot-lock await, synchronously, before dispatch. The ownership rule matches session_queue's in #15421, and whichever lands second shares one helper.

The tool (src/kiro_crew/mcp_dashboard.py, schema in src/kiro_crew/validation.py) rides a new strict-internal POST /api/session-control/run-queued (src/kiro_crew/dashboard/handlers/session_control.py, registered and listed in src/kiro_crew/dashboard/server.py). It is withheld from unattended conductors (agent.py), blocked for channel agents (channel.py), and titled in mcp_tool_titles.json. Docs cover docs/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 with required_queue_id does not load config; one without it still does.
  • Existing tool-set, doc-count and running-reader enumerations updated for the new verb. The interrupt route's own tests pass unchanged.

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

  • 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

@Pearcekieser

Copy link
Copy Markdown
Contributor Author

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.
Not a goal: listing, cancelling, reordering or editing queued messages (that is session_queue, #15421), a hard kill, or a generic tool-registration framework.

@Pearcekieser
Pearcekieser marked this pull request as ready for review September 30, 2026 16:16
@Pearcekieser
Pearcekieser requested a review from a team as a code owner September 30, 2026 16:16
@github-actions github-actions Bot added fork Pull request from a fork (external contributor) readiness: action required A blocking check or review needs attention readiness: checking Automated validation is still running and removed readiness: action required A blocking check or review needs attention labels Sep 30, 2026
@github-actions

github-actions Bot commented Sep 30, 2026 •

Copy link
Copy Markdown
Contributor

Design Review (Fable 5, fork) — ✅ PASS

Design-level review of c5a815bd7219524d83140ec6553ae8bc4ab12b05 via the fork AI-review pipeline — updated in place on each push. A BLOCK verdict blocks PR readiness; PASS/CONCERNS are advisory.

Design-Verdict: PASS

Verify the #15421 convergence: queued_by_caller must become the one shared ownership helper when session_queue lands, not a second spelling.

[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 .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

github-actions Bot commented Sep 30, 2026 •

Copy link
Copy Markdown
Contributor

First Principles Review (Fable 5, fork) — ✅ PASS

Premise-level review of c5a815bd7219524d83140ec6553ae8bc4ab12b05 via the fork AI-review pipeline — 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/CONCERNS are advisory.

First-Principles-Verdict: PASS

Verify the extraction left /api/chat/slots/{slot}/interrupt byte-identical: its stop tail, compacting decline and audit metadata now flow through _interrupt_claimed_turn.

What this change ships

Inventory (9 items) — 9 justified

Intent: let a session run one message it queued on a busy session it created, without a blind stop — an ADDITION (linked issue #15450).

  1. New session_run_queued tool on kirocrew-dashboard — justified
  2. New strict-internal POST /api/session-control/run-queued route — justified
  3. Run-now mechanism extracted from the interrupt route into shared helpers (_idle_run_now_refusal, _interrupt_claimed_turn); route behavior kept — justified
  4. Ownership rule: only sessions the caller created, only entries its own session_send/session_broadcast queued (queued_by_caller) — justified
  5. Entries stamped before a gateway restart, person-typed, producer-shaped or callback-bound entries refused not_your_entry — justified
  6. One-shot _run_now_queue_id binding so a merge-enabled drain runs the promoted entry alone — justified
  7. Targeted dequeue no longer loads config (its merge result was already discarded, chat_runner.py:9339) — justified
  8. Tool withheld from unattended conductors, blocked for channel agents — justified
  9. Docs, tool title, counts 28→29 updated same-commit — justified

All base helpers the diff leans on exist (required_queue_id, send_origin_*, queue_entry_is_user_origin, queue_promote_by_id); no existing agent-reachable mechanism does this job (only the request-scoped dashboard route, which is reused, not re-spelled).

[FIRST-PRINCIPLES-REVIEWED] c5a815b

Description read

[DESCRIPTION-READ] b237fec442231bd35c06fe4d120cfb9ecbf98c07ed0994ebad469ef5f141493b

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

github-actions Bot commented Sep 30, 2026 •

Copy link
Copy Markdown
Contributor

GPT 5.6 Review (fork) — 🔴 changes requested (blocking)

Reviewed c5a815bd7219524d83140ec6553ae8bc4ab12b05 via the fork AI-review pipeline; updated in place on each push.

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

slot.queue_promote_by_id(queue_id)
Compaction begins after the probe -> stop_turn returns compacting -> the declined operation permanently reorders the queue.
Anchor: residual/crash-data-loss-corruption
Fix: restore the entry’s original position when the late compacting outcome occurs.

BLOCKING -- src/kiro_crew/dashboard/chat_runner.py:8879 -- run-now ownership binding is cleared before successful dispatch

slot._run_now_queue_id = ""
Attached subagents hold the selected entry -> targeted drain loses its binding -> a later merged drain consumes another person’s or session’s message with it.
Anchor: residual/security
Fix: retain the binding until the targeted entry is dispatched or disappears.

[BLOCK-MERGE] c5a815b
[GPT-REVIEWED] c5a815b

Adjudication (Opus 5) — is blocking on each finding proportionate?

F1 — src/kiro_crew/dashboard/chat_handlers.py:6923

Harm rung LOW, not loss or corruption: queue_promote_by_id is a pure pop + insert(0) reorder (src/kiro_crew/dashboard/slot_queue_repository.py:749-755), the entry stays queued, and the position it lands in is the one the caller asked for.
Conditions confirmed: running, non-orchestrating slot with _stop_state == "idle"; _compaction_in_flight False at the pre-claim probe (src/kiro_crew/dashboard/chat_handlers.py:6099); a compaction committing inside the gap that holds no await of ours before state.sessions.stop_turn takes the registry lock (src/kiro_crew/dashboard/chat_handlers.py:6775, window documented at 6786-6793). Recovery: the entry sits at the queue front and drains on the next cycle, the caller gets outcome: "compacting" and may retry, and _run_now_queue_id is cleared — the route on main already settles this case identically (promote at 6709, decline at 6741).
Real fix cost: carrying the pre-promotion index across the stop await and un-reordering under a late outcome, i.e. new state that exists only for this window.

F2 — src/kiro_crew/dashboard/chat_runner.py:8879

No rarity argument is available: the binding is consumed unconditionally before the drain is even attempted, ahead of if slot._queue and not _auth_required and _memory_preparation_admitted (src/kiro_crew/dashboard/chat_runner.py:21346), and the targeted retry passes no allow_user_during_subagents, so hold_users diverts to _dequeue_next_system_message whenever subagents are attached to dashboard:<slot> (src/kiro_crew/dashboard/chat_runner.py:9300-9332).
A slot with attached subagents, a signed-out CLI, or unadmitted memory preparation are all ordinary operating states, not contradicting timing or writer-unreachable inputs; recovery is "none" for the binding itself — the next drain is untargeted and merge-eligible (src/kiro_crew/dashboard/chat_runner.py:9339, src/kiro_crew/dashboard/chat_utils.py:3917-3926).
The evidence record FLAG requires cannot be completed.

[ADJUDICATION] c5a815bd7219524d83140ec6553ae8bc4ab12b05 total=0 uphold=0 downgrade=0
[GPT-ADJUDICATED] c5a815bd7219524d83140ec6553ae8bc4ab12b05

[ADJUDICATION-FENCED] c5a815bd7219524d83140ec6553ae8bc4ab12b05 fenced=2 flagged=1
FLAG F1 src/kiro_crew/dashboard/chat_handlers.py:6923 -- Reaching it needs a compaction to commit inside a gap containing no await of ours (chat_handlers.py:6786-6793), and the residual effect is a pure one-position reorder (slot_queue_repository.py:749-755) toward the position the caller requested, with the entry still queued and the existing route on main already settling the same case the same way.
UPHOLD-FENCED F2 src/kiro_crew/dashboard/chat_runner.py:8879 -- The binding is consumed before the drain guard at chat_runner.py:21346 and lost whenever subagents hold the slot at chat_runner.py:9300-9332, all ordinary states, so no rarity argument supports accepting the residual risk.
[GPT-ADJUDICATED-FENCED] c5a815bd7219524d83140ec6553ae8bc4ab12b05

🏷️ Fenced finding(s) machine-flagged as likely edge case

The 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.)

  • F1 src/kiro_crew/dashboard/chat_handlers.py:6923 — Reaching it needs a compaction to commit inside a gap containing no await of ours (chat_handlers.py:6786-6793), and the residual effect is a pure one-position reorder (slot_queue_repository.py:749-755) toward the position the caller requested, with the entry still queued and the existing route on main already settling the same case the same way.

@github-actions

github-actions Bot commented Sep 30, 2026 •

Copy link
Copy Markdown
Contributor

Opus 5 Review (fork) — ✅ no blocking findings

Reviewed c5a815bd7219524d83140ec6553ae8bc4ab12b05 via the fork AI-review pipeline; updated in place on each push.

Review details

No findings.

[OPUS-REVIEWED] c5a815b

@Pearcekieser

Copy link
Copy Markdown
Contributor Author
  • session_send does not return the queue id

Outcome: rebutted (out of scope for this PR, not a defect in its diff).
The queue id comes from session_queue action=list (#15423), which returns each entry's id and marks the caller's own. That tool is named as the id source in this PR's Not-a-goal section and in #15450.
This PR adds the run-now half only. Changing what session_send returns would widen a tool this PR does not otherwise touch.
Until #15423 merges, a caller has no id to pass, and the tool refuses with entry_not_found. Nothing runs by mistake.

@github-actions github-actions Bot added merge conflict Branch has merge conflicts with its base — author must resolve before merge readiness: action required A blocking check or review needs attention and removed readiness: checking Automated validation is still running labels Sep 30, 2026
@Pearcekieser
Pearcekieser force-pushed the feat/mcp-session-run-queued branch from 48d53fe to 357b330 Compare September 30, 2026 18:00
@Pearcekieser

Copy link
Copy Markdown
Contributor Author
  • running path hardcodes the outcome and ignores stage execution

Outcome: fixed in 357b330.
The running branch of run_queued_slot_turn now refuses a slot in _in_stage_execution with slot_orchestrating before it claims or promotes anything, the same code the idle path uses.
It reports stopping only when stop_turn returned soft or hard. Any other value is idle, and the tool text for idle says nothing was stopped and nothing started.
Tests cover the orchestrating refusal (queue, stop state and stop_turn untouched), an idle stop result, and the idle text.

@Pearcekieser

Copy link
Copy Markdown
Contributor Author
  • broadcast-queued entries also qualify

Outcome: fixed in 357b330 (wording only; the behaviour is intended).
broadcast_to_targets delivers each target through send_to_target, whose queue arm writes the same send_origin_meta stamp, so a queue-mode broadcast entry is the caller's own.
The queued_by_caller docstring, the tool description, the not_your_entry refusal text and docs/session-control.md now say "session_send or session_broadcast".

@github-actions github-actions Bot added readiness: checking Automated validation is still running readiness: action required A blocking check or review needs attention and removed readiness: action required A blocking check or review needs attention merge conflict Branch has merge conflicts with its base — author must resolve before merge readiness: checking Automated validation is still running labels Sep 30, 2026
@Pearcekieser

Copy link
Copy Markdown
Contributor Author
  • queue_id is required but no MCP surface returns it

Outcome: rebutted (out of scope, not a defect in this diff; the same class was ruled on as span 0d67cfb96c8c on 48d53fe).
The caller reads queue ids from session_queue action=list (#15423), which returns each entry's id and marks the caller's own. That PR is the id source named in this PR's Not-a-goal section and in #15450.
Returning the id from session_send would widen a tool this PR does not otherwise touch. The finding itself notes the fix lies outside this diff and "cannot gate the merge".
A wrong or missing id is refused with entry_not_found before anything changes.

@Pearcekieser

Pearcekieser commented Sep 30, 2026 •

Copy link
Copy Markdown
Contributor Author
  • Feature map omits broadcast-queued entries

Outcome: fixed in f0832bf.
The Session control row in docs/feature-map/README.md now says "only entries it queued with session_send or session_broadcast". That matches queued_by_caller, which accepts both because broadcast_to_targets delivers through send_to_target and writes the same sender stamp.
No other doc describes the qualifying entries as session_send-only; src/kiro_crew/docs/session-control.md already names both.

@Pearcekieser
Pearcekieser force-pushed the feat/mcp-session-run-queued branch from 357b330 to f0832bf Compare September 30, 2026 21:01
@github-actions github-actions Bot added readiness: checking Automated validation is still running and removed readiness: action required A blocking check or review needs attention readiness: checking Automated validation is still running labels Sep 30, 2026
@github-actions github-actions Bot added readiness: checking Automated validation is still running readiness: action required A blocking check or review needs attention and removed readiness: action required A blocking check or review needs attention readiness: checking Automated validation is still running labels Oct 1, 2026
@Pearcekieser

Copy link
Copy Markdown
Contributor Author
  • Running Run-now bypasses queue-entry ownership

Outcome: fixed in 227cc05.
When run_queued_slot_turn stops a running turn, it sets a one-shot _ChatSlot._run_now_queue_id (memory only) right after the promotion, with no await in between. The cancelled turn's tail drain takes and clears it and calls _start_next_queued_turn(..., required_queue_id=...), so the existing merge and not required_queue_id suppression applies. With merge_queued_messages on, the promoted entry runs alone and no person's or peer's entry is consumed with it.
The binding is cleared on compacting, on an idle stop result and on an exception. If the entry was cancelled meanwhile, the drain falls back to the ordinary unbound order so the queue does not stall. The human /interrupt route never sets it.
Tests cover the binding set and cleared on each outcome, the take-once helper, and the tail drain passing the bound id. Each test is mutation-checked.

@Pearcekieser
Pearcekieser force-pushed the feat/mcp-session-run-queued branch from 26643ef to 227cc05 Compare October 1, 2026 13:00
@github-actions github-actions Bot added readiness: checking Automated validation is still running readiness: action required A blocking check or review needs attention merge conflict Branch has merge conflicts with its base — author must resolve before merge and removed readiness: action required A blocking check or review needs attention readiness: checking Automated validation is still running labels Oct 1, 2026
…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.
@Pearcekieser

Copy link
Copy Markdown
Contributor Author
  • Queue ownership is not revalidated after cooperative cancellation

Outcome: rebutted, not a defect. No entry the caller does not own runs because of this verb.
The binding added in 227cc05 exists so the post-stop drain cannot fold or substitute other entries (a person's or another session's) into the caller's turn. It does that: the tail matches the one bound id and runs only that entry.
The path in this finding needs the session's own human to edit that exact card from the queue UI during the stop_turn await. The edit keeps the id and position and marks the text human-origin. What then runs is that human's own words, on their own session, from the entry they just edited. No credential, privilege or session boundary is crossed.
Without the binding the result is the same: the unbound tail dequeues the same front entry with the same edited text, and the hold_users arm still holds it while sub-agents run. The dashboard's own Run-now route has the identical window on main.
The suggested latch would make the edit, cancel and reorder routes refuse a claimed card and then discard the human's newer text in favour of the agent's older one. That is worse for the person than today's behaviour.
Override reason for a maintainer (the adjudicator rated this LOW and machine-flagged it as an edge case): "only the session's own human can reach it, by editing the claimed card mid-stop; what runs is that human's edit, the same entry the unbound drain runs, as on the shipped Run-now route".

@Pearcekieser
Pearcekieser force-pushed the feat/mcp-session-run-queued branch from 227cc05 to c5a815b Compare October 2, 2026 09:30
@Pearcekieser

Copy link
Copy Markdown
Contributor Author

Rebased onto current main to clear the conflict with session_reload (#15499). No behaviour change: the conflicts were tool lists, the documented tool count (now 29) and the creator-fence sentence in the session-control spec, which now names session_end_wait, session_reload and session_run_queued. test_session_control_doc.py counts 16 session-control tools. Targeted tests (1,543 across the session-control, registration, docs and dequeue suites) pass, as do the feature-map, docs-lint, comment-history and black gates.

@github-actions github-actions Bot added readiness: checking Automated validation is still running and removed readiness: action required A blocking check or review needs attention merge conflict Branch has merge conflicts with its base — author must resolve before merge labels Oct 2, 2026
@dwu96

dwu96 commented Oct 5, 2026

Copy link
Copy Markdown
Contributor

🤖 Kiro Crew [operator: dwu96#8c08bee0]: This PR has been inactive for 7+ days. I reviewed the blockers but they require your input:

  • Both GPT 5.6 blocking findings are security-class and were withheld from adjudication, so the verdict stands and no adjudication can lift it. On a fork lane the only non-code clearance is a repository writer recording an override.
  • F1 is contested on the merits, and picking a side is a maintainer call rather than automation's. At chat_handlers.py:6923, GPT holds that a compaction committing after the pre-claim probe leaves a refused queue promotion permanently reordering the queue. You dispositioned it rebutted. The adjudication substantially supports your position — it puts the harm rung at LOW rather than loss or corruption, notes queue_promote_by_id is a pure pop + insert(0) so the entry stays queued at the position the caller asked for, records that the caller receives outcome: "compacting" and may retry, and states that the route on main already settles this case identically (promote at 6709, decline at 6741). It also prices the fix as "carrying the pre-promotion index across the stop await and un-reordering under a late outcome, i.e. new state that exists only for this window." So the live question is whether to implement F1 at all, against a lane that cannot be satisfied by argument; implementing it would add state to match a finding your own rebuttal and the adjudicator both undercut, and would diverge this route from main's.
  • F2 looks genuinely actionable and I have left it alone only because it ships in the same commit as F1. At chat_runner.py:8879, slot._run_now_queue_id = "" is consumed unconditionally before the drain is attempted, ahead of the if slot._queue and not _auth_required and _memory_preparation_admitted guard, and the targeted retry passes no allow_user_during_subagents, so hold_users diverts to _dequeue_next_system_message whenever subagents are attached to dashboard:<slot>. The adjudication records no rarity argument available and recovery "none" — a later merged drain can consume another session's message. The named remedy, retaining the binding until the targeted entry is dispatched or disappears, is local.

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 needs-pr-triage and the pipeline will pick it up with that decision recorded.

Not blocking, recorded so a later pass does not re-derive it: Backend Tests (3.12, 3) fails one test out of 17,516, test/test_discord.py::TestDispatcher::test_a_dm_turn_opens_the_crew_log_the_work_ledger_writes_into, on an exclusive-file-lock OSError; Coverage Gate is the fail-closed cascade behind it. The branch is CONFLICTING against current main.

When you've addressed these, the pipeline will re-assess on its next cycle.

@dwu96 dwu96 mentioned this pull request Oct 5, 2026
5 tasks done

Copy link
Copy Markdown
Contributor

Automated rebase attempt: stopped on conflicts, nothing pushed

I tried to rebase feat/mcp-session-run-queued (c5a815b) onto origin/main (cc7e798), which is 606 commits ahead of this branch's merge base d8d052f. The single commit conflicts in six files. Three of those are tool-list and doc tables that would be easy to merge. The other three change the queue hand-off and Run-now admission, the same code paths the open F1 finding is about, so I aborted instead of guessing. The branch is unchanged.

  1. src/kiro_crew/dashboard/chat_runner.py: main moved the end-of-turn duties out of _run_chat into _end_turn_tail (around chat_runner.py:7534), which runs under run_to_completion. It also rewrote _finish_queue_cycle (around :7242) with hold/drain handling and its own required_queue_id=arrived hand-off. The _take_run_now_queue_id(slot) binding and the targeted _start_next_queued_turn(..., required_queue_id=run_now_queue_id) call need to move into that new tail. You also need to decide how they interact with the held-queue path.
  2. src/kiro_crew/dashboard/chat_handlers.py: the idle Run-now re-check on main now uses slot_not_found() and refuses on slot._stopping or slot._stop_state != "idle" (slot_stopping). The extracted _idle_run_now_refusal has to pick up the _stop_state condition, or the new verb will admit a run during a stop that main refuses.
  3. src/kiro_crew/dashboard/server.py: main reworked the app-window/static-route section (_APP_WINDOWS_SUBDIR) next to the session-control route registration. Re-add the session_run_queued route against main's current layout.
  4. src/kiro_crew/mcp_dashboard.py (4 hunks), docs/architecture/mcp.md and docs/feature-map/README.md: tools and docs added on main since your last rebase. Take main's lists and add session_run_queued. Then update the documented tool counts and test_session_control_doc.py.

Please rebase locally (git fetch origin && git rebase origin/main), resolve these files, and re-run the session-run-queued, dequeue and session-control doc suites.

@buluoray

Copy link
Copy Markdown
Contributor

🤖 Kiro Crew Auto-Pipeline [operator: buluoray#ce473fca]: @Pearcekieser, checking in on this PR for #15450 (and #15421).

What blocks it today at c5a815b (last push 2 Oct): the branch conflicts with main and an automated rebase stopped on conflicts on 6 Oct, and the two GPT security-class blocking findings still stand on this head; the 5 Oct inactivity note above has had no reply.

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.

@bolichen97

Copy link
Copy Markdown
Contributor

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.

@bolichen97

Copy link
Copy Markdown
Contributor

[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.

@bolichen97

Copy link
Copy Markdown
Contributor

[operator: bolichen97] Continuing this in #38393; thanks for the start.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

fork Pull request from a fork (external contributor) merge conflict Branch has merge conflicts with its base — author must resolve before merge needs-author-decision PR blocked on author input readiness: action required A blocking check or review needs attention

Projects

None yet

Development

Successfully merging this pull request may close these issues.

feat(mcp): session_run_queued runs one of the caller's queued messages now

5 participants