Repository navigation
feat(session-control): session_continue picks up a peer session's cut-short turn - #15459
Pearcekieser wants to merge 2 commits into
Conversation
|
Intent: let an agent hand a session it created back to that session's agent through the Continue button's own path, so a turn cut short by a restart or a killed process can be picked up without re-sending the prompt. Stacked on #15436: until it merges this branch carries its commit, and the second commit is this PR's change. This stays a draft until #15436 lands and the branch is rebased onto main. |
|
👋 Hi! This PR is currently in draft status. Workflow runs won't be auto-approved until it's marked as ready for review. When you're ready, click "Ready for review" and the workflows will be approved on the next cycle automatically. |
00a8128 to
713c1ce
Compare
|
Rebased onto #15436's new head c32fb19. One conflict in the shared continuation helper: it now uses |
|
👋 Hi! This PR is currently in draft status. Workflow runs won't be auto-approved until it's marked as ready for review. When you're ready, click "Ready for review" and the workflows will be approved on the next cycle automatically. |
1 similar comment
|
👋 Hi! This PR is currently in draft status. Workflow runs won't be auto-approved until it's marked as ready for review. When you're ready, click "Ready for review" and the workflows will be approved on the next cycle automatically. |
713c1ce to
ef06902
Compare
|
👋 Hi! This PR is currently in draft status. Workflow runs won't be auto-approved until it's marked as ready for review. When you're ready, click "Ready for review" and the workflows will be approved on the next cycle automatically. |
ef06902 to
ae4b46e
Compare
|
Rebased onto #15436's new head 5b950cd. |
|
👋 Hi! This PR is currently in draft status. Workflow runs won't be auto-approved until it's marked as ready for review. When you're ready, click "Ready for review" and the workflows will be approved on the next cycle automatically. |
|
👋 Hi! This PR is currently in draft status. Workflow runs won't be auto-approved until it's marked as ready for review. When you're ready, click "Ready for review" and the workflows will be approved on the next cycle automatically. |
ae4b46e to
8f670d1
Compare
|
👋 Hi! This PR is currently in draft status. Workflow runs won't be auto-approved until it's marked as ready for review. When you're ready, click "Ready for review" and the workflows will be approved on the next cycle automatically. |
3 similar comments
|
👋 Hi! This PR is currently in draft status. Workflow runs won't be auto-approved until it's marked as ready for review. When you're ready, click "Ready for review" and the workflows will be approved on the next cycle automatically. |
|
👋 Hi! This PR is currently in draft status. Workflow runs won't be auto-approved until it's marked as ready for review. When you're ready, click "Ready for review" and the workflows will be approved on the next cycle automatically. |
|
👋 Hi! This PR is currently in draft status. Workflow runs won't be auto-approved until it's marked as ready for review. When you're ready, click "Ready for review" and the workflows will be approved on the next cycle automatically. |
8f670d1 to
d2bd2eb
Compare
|
👋 Hi! This PR is currently in draft status. Workflow runs won't be auto-approved until it's marked as ready for review. When you're ready, click "Ready for review" and the workflows will be approved on the next cycle automatically. |
1 similar comment
|
👋 Hi! This PR is currently in draft status. Workflow runs won't be auto-approved until it's marked as ready for review. When you're ready, click "Ready for review" and the workflows will be approved on the next cycle automatically. |
d2bd2eb to
f318517
Compare
|
👋 Hi! This PR is currently in draft status. Workflow runs won't be auto-approved until it's marked as ready for review. When you're ready, click "Ready for review" and the workflows will be approved on the next cycle automatically. |
1 similar comment
|
👋 Hi! This PR is currently in draft status. Workflow runs won't be auto-approved until it's marked as ready for review. When you're ready, click "Ready for review" and the workflows will be approved on the next cycle automatically. |
|
👋 Hi! This PR is currently in draft status. Workflow runs won't be auto-approved until it's marked as ready for review. When you're ready, click "Ready for review" and the workflows will be approved on the next cycle automatically. |
6 similar comments
|
👋 Hi! This PR is currently in draft status. Workflow runs won't be auto-approved until it's marked as ready for review. When you're ready, click "Ready for review" and the workflows will be approved on the next cycle automatically. |
|
👋 Hi! This PR is currently in draft status. Workflow runs won't be auto-approved until it's marked as ready for review. When you're ready, click "Ready for review" and the workflows will be approved on the next cycle automatically. |
|
👋 Hi! This PR is currently in draft status. Workflow runs won't be auto-approved until it's marked as ready for review. When you're ready, click "Ready for review" and the workflows will be approved on the next cycle automatically. |
|
👋 Hi! This PR is currently in draft status. Workflow runs won't be auto-approved until it's marked as ready for review. When you're ready, click "Ready for review" and the workflows will be approved on the next cycle automatically. |
|
👋 Hi! This PR is currently in draft status. Workflow runs won't be auto-approved until it's marked as ready for review. When you're ready, click "Ready for review" and the workflows will be approved on the next cycle automatically. |
|
👋 Hi! This PR is currently in draft status. Workflow runs won't be auto-approved until it's marked as ready for review. When you're ready, click "Ready for review" and the workflows will be approved on the next cycle automatically. |
|
👋 Hi! This PR is currently in draft status. Workflow runs won't be auto-approved until it's marked as ready for review. When you're ready, click "Ready for review" and the workflows will be approved on the next cycle automatically. |
3 similar comments
|
👋 Hi! This PR is currently in draft status. Workflow runs won't be auto-approved until it's marked as ready for review. When you're ready, click "Ready for review" and the workflows will be approved on the next cycle automatically. |
|
👋 Hi! This PR is currently in draft status. Workflow runs won't be auto-approved until it's marked as ready for review. When you're ready, click "Ready for review" and the workflows will be approved on the next cycle automatically. |
|
👋 Hi! This PR is currently in draft status. Workflow runs won't be auto-approved until it's marked as ready for review. When you're ready, click "Ready for review" and the workflows will be approved on the next cycle automatically. |
|
👋 Hi! This PR is currently in draft status. Workflow runs won't be auto-approved until it's marked as ready for review. When you're ready, click "Ready for review" and the workflows will be approved on the next cycle automatically. |
3 similar comments
|
👋 Hi! This PR is currently in draft status. Workflow runs won't be auto-approved until it's marked as ready for review. When you're ready, click "Ready for review" and the workflows will be approved on the next cycle automatically. |
|
👋 Hi! This PR is currently in draft status. Workflow runs won't be auto-approved until it's marked as ready for review. When you're ready, click "Ready for review" and the workflows will be approved on the next cycle automatically. |
|
👋 Hi! This PR is currently in draft status. Workflow runs won't be auto-approved until it's marked as ready for review. When you're ready, click "Ready for review" and the workflows will be approved on the next cycle automatically. |
…-short turn Adds a kirocrew-dashboard MCP tool and POST /api/session-control/continue. It calls continue_slot_turn without require_interrupted, the way the Continue button does, so a force-quit turn that left no error row (and that session_retry refuses as turn_not_failed) can be picked up. continue_slot_turn now returns which body it queued, and the result and the allowed audit line report it as body=resumed|continued. retry_target and continue_target share one authorize / re-check / dispatch helper. The tool takes no prompt text, is blocked for channel agents, and is in no auto-grant tuple, so a member or conductor is asked before each call. Supersedes #15459, rebuilt on main after #15436 merged. Closes #15446 Co-authored-by: Pearce Kieser <5055971+Pearcekieser@users.noreply.github.com>
|
🤖 Kiro Crew Auto-Pipeline [operator: buluoray#ce473fca]: Taking this over in #19590 since it has been idle; you are credited as co-author on the commits. Thanks for the groundwork. |
…-short turn Adds a kirocrew-dashboard MCP tool and POST /api/session-control/continue. It calls continue_slot_turn without require_interrupted, the way the Continue button does, so a force-quit turn that left no error row (and that session_retry refuses as turn_not_failed) can be picked up. continue_slot_turn now returns which body it queued, and the result and the allowed audit line report it as body=resumed|continued. retry_target and continue_target share one authorize / re-check / dispatch helper. The tool takes no prompt text, is blocked for channel agents, and is in no auto-grant tuple, so a member or conductor is asked before each call. Supersedes #15459, rebuilt on main after #15436 merged. Closes #15446 Co-authored-by: Pearce Kieser <5055971+Pearcekieser@users.noreply.github.com>
…-short turn (#19590) Adds a kirocrew-dashboard MCP tool and POST /api/session-control/continue. It calls continue_slot_turn without require_interrupted, the way the Continue button does, so a force-quit turn that left no error row (and that session_retry refuses as turn_not_failed) can be picked up. continue_slot_turn now returns which body it queued, and the result and the allowed audit line report it as body=resumed|continued. retry_target and continue_target share one authorize / re-check / dispatch helper. The tool takes no prompt text, is blocked for channel agents, and is in no auto-grant tuple, so a member or conductor is asked before each call. Supersedes #15459, rebuilt on main after #15436 merged. Closes #15446 Co-authored-by: Pearce Kieser <5055971+Pearcekieser@users.noreply.github.com>
|
Thank you for this work, @Pearcekieser. The same change landed on main through #19590 (commit 005f1ae, "feat(session-control): session_continue picks up a peer session's cut-short turn"), which also closed #15446. Closing this one as superseded. If we got that wrong and something here is still missing from main, please reopen. |
Problem / Motivation
Goal: an agent can pick up a session it dispatched after that session's turn was cut short by a gateway restart or a killed process, the same way a person presses Continue.
A force-quit turn runs no
finally, so it leaves no error row and reads like a finished turn. The dashboard's Continue control (POST /api/chat/slots/{slot}/continue) handles it. Agents have no equivalent.session_retry(#15436) refuses exactly this case withturn_not_failed, and re-sending the prompt withsession_sendadds a second copy of the request and does not tell the model it was interrupted.Why it matters
Conductor and patrol sessions restart their workers after every gateway restart. Today they re-send the last prompt by hand, which duplicates it in the worker's transcript and makes the model start over instead of checking what it already did.
Not a goal
target.session_retry.What changed (motivation → approach → change)
Stacked on #15436. Until that PR merges, this branch carries its commit (
session_retryand the extraction ofcontinue_slot_turnout ofapi_chat_slot_continue). Once it lands, this branch is rebased onto main and only the second commit remains. Please review the second commit.The Continue endpoint already chooses between two bodies: the interrupted pick-up when
_is_interruptedsays the last turn was cut short, and a carry-on message otherwise.session_continuecalls the samecontinue_slot_turnwithoutrequire_interrupted, so every refusal the button makes applies unchanged.continue_slot_turnindashboard/chat_handlers.pyreturns which body it queued,resumedorcontinued.continue_targetandretry_targetindashboard/session_control.pynow share one helper,_continue_turn_of_target: prewarm,authorize_target, the remote-crew refusal, the synchronous re-check under the slot lock, and the audit line, which now records the body. The two verbs differ only inrequire_interrupted.POST /api/session-control/continue(handler indashboard/handlers/session_control.py), registered and added to_STRICT_INTERNAL_API_PATHSindashboard/server.py.session_continue(target)inmcp_dashboard.py. The reply names the body sent. It joinsSESSION_CONTROL_TOOLS,CHANNEL_AGENT_BLOCKED_TOOLSinchannel.py,MCP_DASHBOARD_SCHEMASinvalidation.py, andmcp_tool_titles.json.session_continuesection indocs/session-control.md, the tool count indocs/index.md, and rows indocs/architecture/mcp.md,docs/feature-map/README.mdanddocs/system-specs/modules/session-control.md.Backwards compatibility
Compatible: a new tool and route.
retry_targetkeeps its result shape and refusal codes. Its audit line gains abodydetail, and the advisory text of itsremote_target_unsupportedrefusal changes wording.Tests
test/test_session_control_continue.py:body: continued.session_retryrefuses this same shape, so this is the case the tool exists for.body: resumed.session_start_repeat, remote-bound, and a target that becomes channel-linked while the slot lock is awaited.Updated: the tool lists in
test_mcp_dashboard_registration.pyandtest_mcp_dashboard_folders.py, and the tool count intest_session_control_doc.py. Thesession_retrytests pass unchanged on the shared helper.Manual verification
N/A, unit coverage sufficient: the route and the tool are thin wrappers over
continue_slot_turn, which the Continue button already exercises, and the tests drive it on real slots with only the turn dispatcher stubbed.Related Issues
Fixes #15446
Checklist
feat|fix|docs|style|refactor|perf|test|chore|ci|build|revert: ...)