Repository navigation
fix: prevent helper completions from restarting stopped work - #156124
Conversation
|
🦞👀 Pull request received. I will update this pull request when review starts. ClawSweeper review completeClawSweeper finished reviewing this revision. The review result is being finalized. |
|
Codex review: needs maintainer review before merge. Reviewed September 22, 2026, 11:26 PM ET / September 23, 2026, 03:26 UTC (Revision 2). ClawSweeper reviewWhat this changesStop now cancels pending helper-completion continuations, including retries from finished helpers, while retaining their results and restoring continuation state when persistence refuses cancellation. Merge readiness✅ Ready for maintainer review This remains a useful fix with no blocking findings. The completed validation evidence resolves the previous review’s explicit hold. Priority: P1 Review scores
Verification
How this fits togetherCompleted helpers leave durable continuations that can wake their parent conversation. Gateway Stop requests pass through cancellation ownership checks before the lifecycle owner retires those continuations and their retry timers. flowchart TD
A[User presses Stop] --> B[Gateway authorization]
B --> C[Select owned helper batch]
D[Completed helper and pending retry] --> C
C --> E[Lifecycle cancellation]
E --> F{Persistence outcome}
F -->|Committed| G[Retire retry and retain result]
F -->|Refused| H[Restore continuation]
Before mergeNone. Agent review detailsSecurityNone. PR surfaceSource +239, Tests +511, Docs +6. Total +756 across 13 files. View PR surface stats
Review metrics
Root-cause clusterRelationship: Members:
Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything. Technical reviewBest possible solution: Keep continuation cancellation with the existing lifecycle owner so accepted Stop prevents automatic restart without discarding results or blocking later human input. Do we have a high-confidence way to reproduce the issue? Yes: the supplied reproduction and current-main source identify a completed helper whose surviving wake retries after accepted Stop; this review verified the mechanism without executing it. Is this the best way to solve the issue? Yes: extending the existing cancellation walker and lifecycle persistence owner is a focused repair, and sharing admission identity avoids a competing retry-matching implementation. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 6cbf27b004fb. LabelsLabel changes:
Label justifications:
EvidenceWhat I checked:
Likely related people:
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
HistoryReview history (1 earlier review cycle)
|
|
Fixed: Stop now retires pending helper-completion retries without discarding captured results or blocking new human input. |
…w#156124) Stop retires pending helper-completion retries for cancelled work while preserving completed results and later human input. Closes openclaw#156090.
Closes #156090
What Problem This Solves
Stop could cancel a helper-completion turn and still be followed by a fresh automatic retry. The completed child's pending continuation survived cancellation, so delivery treated the closed run authority as a retryable failure. A completion still waiting for admission could also start after session-wide Stop.
Stop now retires the selected work's pending completion continuation, including when the helper has already finished. Captured results and successful execution outcomes remain available, and a new human message works normally.
How It Works
The existing cancellation walker now visits completed children with pending requester wakes. Exact-run selection recognizes the completion batch's original or retry identity through the same identity builder used for admission. The pending-agent
chat.abortbranch uses the same accepted-cancellation boundary while preserving its expected-payload comparison before awaited descendant work.The lifecycle owner persists the existing suppression marker and wake removal under current ownership checks. Committed cancellation releases only the matching continuation and timer. A definitely refused write restores the previous wake and any retained delivery result or replay budget before scheduling resumes. Declined or failed parent cancellation preserves completed descendants' still-owned wakes.
This adds no schema, serialized field, configuration, public protocol, goal-state change, or persistent session ban. Genuine transient delivery failures still retry. The stopping documentation covers the completed-child case.
Verification
All results below cover
60142c7d551cdae94673926a5d0dd0a8cbf6549e.chat.abort/sessions.abortauthority and persistence paths. Replacement/rearmed owners, unrelated turns, mixed public/private completion identity, and retained child results remain covered./stop, automatic model requests are 1 before the fix and 0 afterward across the stored retry deadline. No humanchat.sendoccurred before that measurement. A subsequent real human request receives its rendered reply; the old wake is absent from SQLite and the helper result survives. The isolated provider supplies synthetic responses; Gateway admission, persistence, scheduling, WebSocket traffic, and UI are real.Test costs use
pnpm test <file> --maxWorkers=1on the retained Testbox. Command wall time includes compiler and runner preparation. CI figures sum reported case durations and exclude module/import/worker overhead; they are not per-file wall times.subagent-announce.requester-settle-cancel.test.tssubagent-completion-admission.cancel-rollback.test.tsThe corresponding shared CI test steps took 425 seconds and 455 seconds, including other files. The other 20 affected files passed in 115.209 seconds of Testbox command wall time. The real browser scenario took 63.0 seconds, or 90.6 seconds including its Vitest setup.
Visual evidence
Exact-head /stop, no automatic restart, and successful new human input
[email protected]
Visual verification
60142c7d551cdae94673926a5d0dd0a8cbf6549eThe baseline recording shows the acknowledged Stop followed by the unwanted automatic retry.