feat(kanban): add POST /runs/{run_id}/terminate endpoint#31097
Closed
Interstellar-code wants to merge 1 commit into
Closed
feat(kanban): add POST /runs/{run_id}/terminate endpoint#31097Interstellar-code wants to merge 1 commit into
Interstellar-code wants to merge 1 commit into
Conversation
Closes the termination-control gap left by PR NousResearch#28432, which shipped the read-only sibling endpoints (/workers/active, /runs/{run_id}, /runs/{run_id}/inspect) but no way to stop a misbehaving worker from the dashboard without dropping to the CLI. The new endpoint resolves run_id -> task_id and delegates to the existing kanban_db.reclaim_task() flow, so the SIGTERM->SIGKILL escalation, run-outcome bookkeeping, and event-log append all match POST /tasks/{task_id}/reclaim exactly. No new termination semantics introduced. Responses: 200 {ok, run_id, task_id} on success 404 unknown run_id 409 run already ended OR task no longer reclaimable Refs: NousResearch#23762
Contributor
|
Merged via PR #34449 (commit 8d57281, rebase-merged). Your commit ( The salvage PR was identical to your original (16/16 tests pass, no functional changes). Cherry-picking onto current main + adding the AUTHOR_MAP entry was the only delta. Closes #23762 as you intended. Thanks for the clean implementation — minimal diff, comprehensive tests, semantic-contract match with the sibling |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
POST /runs/{run_id}/terminateto the Kanban dashboard plugin API/workers/active,/runs/{run_id},/runs/{run_id}/inspect)kanban_db.reclaim_task()flow — no new termination semantics introduced, so the SIGTERM→SIGKILL escalation, run-outcome bookkeeping, and event-log append all matchPOST /tasks/{task_id}/reclaimBehavior
200 {ok, run_id, task_id}ready404run_id409ended_at, or task no longer in a reclaimable stateAuth follows the existing dashboard session-token middleware — same exposure surface as the sibling
/runs/*endpoints.Test plan
tests/plugins/test_kanban_worker_runs.py— 5 new cases covering happy path, 404 unknown id, 409 already ended, 409 task not reclaimable, empty body acceptedruff checkclean on both modified filesCloses #23762
Refs #28432
🤖 Generated with Claude Code