feat(kanban): add POST /runs/{run_id}/terminate endpoint (salvage #31097)#34449
Merged
Conversation
Closes the termination-control gap left by PR #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: #23762
Contributor
🔎 Lint report:
|
This was referenced May 29, 2026
r266-tech
added a commit
to r266-tech/hermes-agent
that referenced
this pull request
May 29, 2026
1 task
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
Salvages PR #31097 onto current main. Adds
POST /api/plugins/kanban/runs/{run_id}/terminateto the Kanban dashboard plugin API — a clean operator stop primitive for live, well-behaved workers. Closes the termination-control gap left by PR #28432 (which shipped the read-only sibling endpoints/workers/active,/runs/{run_id},/runs/{run_id}/inspectbut no stop control).Pure HTTP wrapper around the existing
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}/reclaimexactly.Changes
plugins/kanban/dashboard/plugin_api.py: newPOST /runs/{run_id}/terminateendpoint (~50 LOC, sits next to the existinginspect_run_endpoint)tests/plugins/test_kanban_worker_runs.py: 5 new test cases (happy path, 404 unknown id, 409 already ended, 409 task not reclaimable, empty-body accepted)scripts/release.py: AUTHOR_MAP entry for @Interstellar-codeBehavior
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.Validation
tests/plugins/test_kanban_worker_runs.py(16 tests, 5 new)0b07d86b4reclaim_task/get_runsignatures matchCloses #23762. Credit @Interstellar-code — original PR was clean, just needed cherry-pick onto current main + AUTHOR_MAP entry.
Infographic