Bug Description
CLI tasks that get stuck in stale_running state cannot be cancelled or cleared through any normal means. The openclaw tasks cancel command explicitly returns "Task runtime does not support cancellation yet", making it impossible to clean up orphaned tasks.
Steps to Reproduce
- Have several CLI tasks (e.g., exec-approval-followup type) that get stuck in
stale_running state
- Try to cancel them with
openclaw tasks cancel <task-id>
- Observe: returns "Task runtime does not support cancellation yet"
- Try
openclaw tasks maintenance --apply
- Observe: outputs "0 reconcile · 0 cleanup · 0 prune" - does nothing
- Try gateway restart
- Observe: stale_running tasks persist after restart
Expected Behavior
- Users should be able to manually cancel stuck CLI tasks
- The
tasks cancel command should actually work for CLI runtime tasks
- The
maintenance command should detect and clean up stale_running orphaned tasks
- Gateway restart should clear stale task markers
Actual Behavior
openclaw tasks cancel returns "Task runtime does not support cancellation yet" for ALL CLI tasks
openclaw tasks maintenance --apply does 0 reconciliation/cleanup/prune for stale_running tasks
- Gateway restart does not clear stale_running markers
- No CLI command or workaround exists to clear these tasks
Task Details (for reference)
7 stuck tasks (all exec-approval-followup, exit code 0 but followup never transitioned):
05b80529-5f55-4a06-a12a-3a25810906d7
87cdf907-6a2c-4679-82be-a1c6138c2780
b2104428-f9a0-4d69-9734-0a7e46600fb0
c9fa3163-428d-479b-8465-75c28c301c42
bfaf23f7-53b3-4b31-825f-cde488ba1aae
6e3d7c42-0b8c-4c85-9f54-28b758b894f0
35a4140c-df91-4273-9ccd-0f29f03a1c09
Environment
- OpenClaw: 2026.4.5
- Platform: macOS
- Node: v22.22.0
- Tasks audit output: 7 stale_running errors
Bug Description
CLI tasks that get stuck in
stale_runningstate cannot be cancelled or cleared through any normal means. Theopenclaw tasks cancelcommand explicitly returns "Task runtime does not support cancellation yet", making it impossible to clean up orphaned tasks.Steps to Reproduce
stale_runningstateopenclaw tasks cancel <task-id>openclaw tasks maintenance --applyExpected Behavior
tasks cancelcommand should actually work for CLI runtime tasksmaintenancecommand should detect and clean upstale_runningorphaned tasksActual Behavior
openclaw tasks cancelreturns "Task runtime does not support cancellation yet" for ALL CLI tasksopenclaw tasks maintenance --applydoes 0 reconciliation/cleanup/prune for stale_running tasksTask Details (for reference)
7 stuck tasks (all exec-approval-followup, exit code 0 but followup never transitioned):
05b80529-5f55-4a06-a12a-3a25810906d787cdf907-6a2c-4679-82be-a1c6138c2780b2104428-f9a0-4d69-9734-0a7e46600fb0c9fa3163-428d-479b-8465-75c28c301c42bfaf23f7-53b3-4b31-825f-cde488ba1aae6e3d7c42-0b8c-4c85-9f54-28b758b894f035a4140c-df91-4273-9ccd-0f29f03a1c09Environment