Tasks: allow openclaw tasks cancel for CLI runtime (#62419)#62506
Conversation
Greptile SummaryAdds Confidence Score: 5/5Safe to merge; all findings are P2 style/edge-case issues that do not affect the primary cancel path. The core logic change is correct, covered by a focused new test, and properly documented. Remaining comments are a changelog placement policy violation and a defensive guard-ordering concern for an edge case the PR author acknowledges is not exercised in production. CHANGELOG.md (entry placement); src/tasks/task-registry.ts (childSessionKey guard ordering for the CLI branch).
|
Follow-up (review feedback)Greptile / changelog
Greptile /
|
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 42fcba7dd7
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
Made-with: Cursor
…lock terminal status Made-with: Cursor
43f3f12 to
189fc01
Compare
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 189fc0118f
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
obviyus
left a comment
There was a problem hiding this comment.
Reviewed latest changes; landing now.
|
Landed on main. Thanks @neeravmakwana. |
…@neeravmakwana) * Tasks: allow openclaw tasks cancel for CLI runtime (#62419) Made-with: Cursor * Tasks: address review — changelog order, CLI cancel without session, lock terminal status Made-with: Cursor * fix: freeze terminal task listener updates * fix: clean changelog block for CLI task cancel (#62506) (thanks @neeravmakwana) --------- Co-authored-by: Ayaan Zaidi <hi@obviy.us>
… (thanks @neeravmakwana) * Tasks: allow openclaw tasks cancel for CLI runtime (openclaw#62419) Made-with: Cursor * Tasks: address review — changelog order, CLI cancel without session, lock terminal status Made-with: Cursor * fix: freeze terminal task listener updates * fix: clean changelog block for CLI task cancel (openclaw#62506) (thanks @neeravmakwana) --------- Co-authored-by: Ayaan Zaidi <hi@obviy.us>
… (thanks @neeravmakwana) * Tasks: allow openclaw tasks cancel for CLI runtime (openclaw#62419) Made-with: Cursor * Tasks: address review — changelog order, CLI cancel without session, lock terminal status Made-with: Cursor * fix: freeze terminal task listener updates * fix: clean changelog block for CLI task cancel (openclaw#62506) (thanks @neeravmakwana) --------- Co-authored-by: Ayaan Zaidi <hi@obviy.us>
… (thanks @neeravmakwana) * Tasks: allow openclaw tasks cancel for CLI runtime (openclaw#62419) Made-with: Cursor * Tasks: address review — changelog order, CLI cancel without session, lock terminal status Made-with: Cursor * fix: freeze terminal task listener updates * fix: clean changelog block for CLI task cancel (openclaw#62506) (thanks @neeravmakwana) --------- Co-authored-by: Ayaan Zaidi <hi@obviy.us>
… (thanks @neeravmakwana) * Tasks: allow openclaw tasks cancel for CLI runtime (openclaw#62419) Made-with: Cursor * Tasks: address review — changelog order, CLI cancel without session, lock terminal status Made-with: Cursor * fix: freeze terminal task listener updates * fix: clean changelog block for CLI task cancel (openclaw#62506) (thanks @neeravmakwana) --------- Co-authored-by: Ayaan Zaidi <hi@obviy.us>
… (thanks @neeravmakwana) * Tasks: allow openclaw tasks cancel for CLI runtime (openclaw#62419) Made-with: Cursor * Tasks: address review — changelog order, CLI cancel without session, lock terminal status Made-with: Cursor * fix: freeze terminal task listener updates * fix: clean changelog block for CLI task cancel (openclaw#62506) (thanks @neeravmakwana) --------- Co-authored-by: Ayaan Zaidi <hi@obviy.us>
Summary
openclaw tasks cancelreturned "Task runtime does not support cancellation yet" for CLI-tracked tasks (for example gateway agent runs), so operators could not clear stuckrunningrows.runningwhen follow-up bookkeeping never runs; without a working cancel path there was no supported way to mark them terminal.cancelTaskByIdtreatsruntime === "cli"like other local cancellations: recordcancelledin the task registry (CLI uses the main session aschildSessionKey; there is no separate ACP/subagent session to stop). Docs and changelog updated; unit test covers the path.stale_runningis unchanged (audit remains informational).Change Type
Scope
Linked Issue/PR
Root Cause
cancelTaskByIdonly wired teardown for ACP and subagent runtimes; CLI fell through to the unsupported branch despite using a normal session key.Regression Test Plan
src/tasks/task-registry.test.ts) asserts CLI cancel updates the task tocancelled, does not call ACP/subagent hooks, and delivers the expected terminal message when delivery is pending.User-visible / Behavior Changes
openclaw tasks cancelsucceeds for active CLI-tracked tasks and sets status tocancelledwith operator error text.Diagram
N/A
Security Impact
Repro + Verification
Environment
pnpm test src/tasks/task-registry.test.ts -t "cancels"Steps
childSessionKeyset.cancelTaskById.cancelled: trueand no ACP/subagent control calls.Expected
cancelled.Actual
Evidence
Human Verification
task-registry.test.ts.pnpm check/pnpm build(local tree has unrelated TS/build failures on this checkout).Review Conversations
Compatibility / Migration
Risks and Mitigations
docs/automation/tasks.md.Made with Cursor