Repository navigation
fix: preserve agent timeouts after background commands complete - #148388
Conversation
Completion turns resume unfinished agent work through the heartbeat runner. Use the existing prepared exec-completion classification to leave their deadline with the ordinary agent timeout resolver, while retaining heartbeat budgets for monitor and scheduled-task prompts. Regression proof: six cases fail before the fix; 84 focused tests pass afterward. Changed checks, documentation checks, deslop, and independent review pass.
|
🦞👀 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 14, 2026, 1:03 PM ET / 17:03 UTC. ClawSweeper reviewWhat this changesCommand-completion continuations use the ordinary agent timeout, while scheduled heartbeat work retains its existing limits, with regression coverage and documentation. Merge readiness✅ Ready for maintainer review The fix remains necessary: current main and the latest release still impose heartbeat deadlines on command-completion continuations. No actionable correctness or security defect was found in the introduced patch. Priority: P1 Review scores
Verification
How this fits togetherOpenClaw’s heartbeat runner handles both scheduled monitoring and events that resume agent work after background commands finish. It prepares the turn and passes timeout options to the shared reply runtime. flowchart TD
A[Background command completes] --> C[Prepare heartbeat turn]
B[Scheduled monitoring] --> C
C --> D{Completion continuation?}
D -->|Yes| E[Ordinary agent timeout]
D -->|No| F[Heartbeat timeout]
E --> G[Shared reply runtime]
F --> G
Before mergeNone. Agent review detailsSecurityNone. PR surfaceSource +2, Tests +91, Docs +1. Total +94 across 4 files. View PR surface stats
Review metricsNone. Technical reviewBest possible solution: Keep timeout policy with the existing agent resolver for completion continuations and the heartbeat resolver for monitoring turns. Do we have a high-confidence way to reproduce the issue? Yes, from source: an exec-completion turn with a 30-minute heartbeat cadence and no explicit agent timeout receives a 600-second override on current main. Runtime reproduction was not executed. Is this the best way to solve the issue? Yes. Reusing the prepared completion classification and existing agent timeout resolver is a narrow repair that preserves scheduled-task precedence without adding configuration or another timeout policy. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against cb5c760d943e. LabelsLabel changes:
Label justifications:
EvidenceWhat I checked:
Likely related people:
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
|
|
Merged via squash.
|
Remove the unreachable message-specific configuration branch after the dynamic-tool resolver early return. Inline the private announcement failure formatter into its only exported caller, preserving exact output and timeout behavior. Validation: 353 focused tests, changed-file checks, and independent review through P2 passed. Follow-up cleanup from the timeout ownership audit after #148388.
* refactor: simplify timeout and announcement helpers Remove the unreachable message-specific configuration branch after the dynamic-tool resolver early return. Inline the private announcement failure formatter into its only exported caller, preserving exact output and timeout behavior. Validation: 353 focused tests, changed-file checks, and independent review through P2 passed. Follow-up cleanup from the timeout ownership audit after #148388. * fix(ci): remove duplicate Wizard recovery test registration The compact Node planner correctly refuses repeated file identities. Remove the second registry entry while preserving all 68 unique database-worker consumers and their execution owner. This is the same inherited CI correction identified in #148423 and #148425. Validation: reproduced the original preflight error, all six planner profiles now generate, 76 planner tests and scoped changed checks pass, and independent review of the complete candidate is clean through P2.
…claw#148388) Completion turns resume unfinished agent work through the heartbeat runner. Use the existing prepared exec-completion classification to leave their deadline with the ordinary agent timeout resolver, while retaining heartbeat budgets for monitor and scheduled-task prompts. Regression proof: six cases fail before the fix; 84 focused tests pass afterward. Changed checks, documentation checks, deslop, and independent review pass.
* refactor: simplify timeout and announcement helpers Remove the unreachable message-specific configuration branch after the dynamic-tool resolver early return. Inline the private announcement failure formatter into its only exported caller, preserving exact output and timeout behavior. Validation: 353 focused tests, changed-file checks, and independent review through P2 passed. Follow-up cleanup from the timeout ownership audit after openclaw#148388. * fix(ci): remove duplicate Wizard recovery test registration The compact Node planner correctly refuses repeated file identities. Remove the second registry entry while preserving all 68 unique database-worker consumers and their execution owner. This is the same inherited CI correction identified in openclaw#148423 and openclaw#148425. Validation: reproduced the original preflight error, all six planner profiles now generate, 76 planner tests and scoped changed checks pass, and independent review of the complete candidate is clean through P2.
What Problem This Solves
Fixes unfinished agent tasks timing out ten minutes after a background command completes and wakes the session, even while the agent is actively making progress.
User Impact
Command-completion continuations use the ordinary agent timeout, including configured finite limits and
0for no timeout. Scheduled heartbeat work retains its existing limits. No configuration changes or migrations are required.Why This Change Was Made
The heartbeat runner also transports command-completion events. Select the timeout from the prepared prompt's owner: an actual exec completion leaves timeout resolution to the existing agent owner, while monitor turns retain the heartbeat override. This also covers completions carried by hooks and preserves scheduled-task precedence over queued completions.
Evidence
git diff --checkpassed.6aed14fca6e1d3d78dd0f59ebd455fa9717cec49.