Repository navigation
fix(llm-task): stop canceled tasks from returning JSON - #124673
Conversation
|
🦞👀 Pull request received. I will update this pull request when review starts. |
|
Codex review: needs maintainer review before merge. Reviewed August 16, 2026, 11:51 AM ET / 15:51 UTC. ClawSweeper reviewWhat this changesThe PR forwards the existing tool-call cancellation signal from the llm-task plugin into its isolated model-completion request. Merge readinessKeep open. Current main drops the invocation signal at the llm-task plugin boundary, while the branch forwards it to the host cancellation owner; the focused regression test fails before that forwarding exists. No blocking correctness findings. Priority: P2 Review scores
Verification
How this fits togetherThe llm-task plugin turns an agent tool call into an isolated model completion through the plugin runtime. The invocation cancellation signal must reach the host runtime, which races cancellation against the completion and returns an abort outcome instead of stale JSON. flowchart LR
A[Agent tool call] --> B[Plugin tool wrapper]
B --> C[llm-task plugin]
C --> D[Host completion request]
D --> E[Isolated model runtime]
E --> F[JSON result or cancellation]
Before merge
Agent review detailsSecurityNone. PR surfaceSource +1, Tests +14. Total +15 across 2 files. View PR surface stats
Review metrics
Merge-risk optionsMaintainer options:
Technical reviewBest possible solution: Keep cancellation owned by the host runtime: forward the existing tool signal directly and retain the boundary regression test rather than adding plugin-local abort races or timeouts. Do we have a high-confidence way to reproduce the issue? Yes—source-reproducible: the tool wrapper supplies a signal, current main's llm-task tool drops it, and the host has an established abort race once it receives it. This read-only review did not execute the test suite. Is this the best way to solve the issue? Yes. Directly forwarding the existing signal is the narrow owner-aligned repair because the host already owns pre-abort handling, abort races, timeout normalization, and cleanup. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against 5f561999a9d8. LabelsLabel changes:
Label justifications:
EvidenceWhat I checked:
Likely related people:
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
|
|
Land-ready proof for exact head Root cause: Exact proof: Hosted CI: https://github.com/openclaw/openclaw/actions/runs/31956571918 — exact head matched; ClawSweeper: #124673 (comment) — no correctness/security findings, 5/6 readiness. Rank-up moves:
LOC: Production Known proof gap: no external provider call was run because the claim is entirely within the local |
|
Merged via squash.
|
What Problem This Solves
Fixes an issue where users canceling an
llm-tasktool call could still receive a stale successful JSON result when the nested isolated completion ignored cancellation.The agent runtime already supplied an
AbortSignalto the registered tool, but the plugin dropped it before calling the host completion runtime.Why This Change Was Made
The plugin now forwards the existing tool-call signal into
runtime.llm.complete. The host remains the single owner of pre-abort checks, mid-flight abort races, timeout handling, stable error normalization, and cleanup; no plugin-local timeout, race, retry, or compatibility path was added.User Impact
Canceled
llm-taskcalls now stop at the host completion boundary instead of later returning JSON. Uncanceled calls behave unchanged.This PR is AI-assisted. The implementation, ownership boundary, tests, and runtime behavior were reviewed and verified by the author.
Evidence
Pre-fix boundary reproduction on the frozen baseline failed because the canceled promise resolved with
details.json = { "ok": true }instead of rejecting.Post-rebase focused proof:
Source-blind registered-tool proof used the real plugin registration and host runtime with a controlled isolated backend that never settled:
Post-rebase static and changed gates:
Fresh Codex autoreview on exact head
0ef9ae5ff5f9d1d95bf97be65afa127977ace868: no accepted/actionable findings; patch judged correct with 0.99 confidence.Production LOC:
+2/-1(net+1) | Tests:+14/-0.ClawSweeper exact-head review: #124673 (comment)
+1production line is the unavoidable direct request field, and no coherent net-neutral owner fix exists.