Repository navigation
fix: preserve heartbeat outcomes across retries and cancellation - #144377
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 10, 2026, 5:06 PM ET / 21:06 UTC (Revision 3). ClawSweeper reviewWhat this changesPreserves accepted heartbeat alerts and private monitor notes across retries and compaction, and records cancellation outcomes before deferred cleanup finishes. Merge readiness✅ Ready for maintainer review Keep open: current main still contains the response-loss and cancellation-classification gaps. The focused patch addresses them through existing owners, with supporting Gateway observations and no actionable introduced defect found. Priority: P1 Review scores
Verification
How this fits togetherHeartbeats run background agent checks and turn accepted responses into alerts or silent outcomes. The agent runtime carries those responses to dispatch, which controls delivery and revision-checked updates to private monitor notes. flowchart TD
A[Heartbeat check] --> B[Agent accepts response]
B --> C[Retry and compaction carryover]
C --> D[Final run outcome]
E[Stop or preemption] --> D
D --> F[Heartbeat dispatch]
F --> G[Revision-checked private notes]
F --> H[Alert or intentional silence]
Before mergeNone. Agent review detailsSecurityNone. PR surfaceSource +8, Tests +226. Total +234 across 9 files. View PR surface stats
Review metricsNone. Technical reviewBest possible solution: Keep accepted responses within the existing run lifecycle while leaving privacy, revision checks, cancellation suppression, and delivery reconciliation with their established owners. Do we have a high-confidence way to reproduce the issue? Yes: accept a heartbeat response, trigger a provider overload, and complete the retry without another tool call. Current-main source and the reporter’s correlated trace establish the loss mechanism; this review did not execute it. Is this the best way to solve the issue? Yes: the patch repairs the existing carryover and cancellation owners without adding another persistence path, configuration option, or plugin API. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 83129f42703f. LabelsLabel justifications:
EvidenceWhat I checked:
Likely related people:
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
History |
|
landpr-approve-unrelated-red |
|
Landed in 490ca57. Thanks @JLahullier for the correlated retry trace.
CI remains red for three unrelated 30-second child-process timeouts in The tested main parent The normal guarded merger accepted the standing unrelated-CI approval. No assertion, timeout, or proof requirement was weakened. The isolated runtime is terminated and its access key is removed; full private evidence and failure history are retained. |
…nclaw#144377) ## What Problem This Solves Fixes an issue where a heartbeat loses its accepted alert and private scratch update when the provider overloads after `heartbeat_respond` and the normal retry completes without another tool call. Compaction could also clear that response. Cancellation checks exposed related gaps: user Stop could emit a failure notice, and foreground preemption could be reported as busy before cleanup finished. Closes openclaw#144148. Thanks @JLahullier for the correlated retry trace. Related: openclaw#143278; this proof does not establish that report's Telegram delivery path. ## Why This Change Was Made Retain the latest complete accepted response in the existing run carryover and during compaction. Preserve the established direct-abort reason at the deferred owner, and record the exact held reply operation before an aborted dispatch returns. ## User Impact Successful heartbeat retries retain their alert and scratch proposal. Quiet heartbeats remain quiet. Cancellation and preemption suppress delivery and report their actual outcome. Scratch revision checks and uncertain-delivery handling remain with their existing owners. ## Evidence - Compiled Gateway and actual QA recipient: baseline accepted a response, overloaded, then completed its retry with scratch revision 0 and no intended alert. The candidate stores the exact proposal at revision 1 and delivers the intended alert once, without another tool call or outward fallback. - All twelve public scenarios passed on the canonical CI integration build `67e2f8c1744c`, whose PR parent is `7b4304321c32`: notifying/quiet responses, no-tool retries, failure, cancellation, preemption, concurrent/stale writes, protected monitor removal, byte limits, uncertain acknowledgment recovery, and privacy with a real finished run-history row. - Lost-acknowledgment proof records real upstream acceptance, a failed/unconfirmed terminal, restart recovery refusing blind replay, and later reads showing the same one message and scratch revision. Historical fixture failures and their independent method corrections remain preserved. - Hidden missing-monitor and tool-size guards have separate source-boundary proof. All 11,426 deployed compiled files match the hosted artifact; plugin/runtime selection was independently verified. No live Telegram or Control UI validation is claimed. - Owner regression tests failed before correction. The resolved merge passes 151 focused checks and formatting; the final test-type correction also passed its focused checks. Hosted lint and type checks pass. - CI run [34527083283](https://github.com/openclaw/openclaw/actions/runs/34527083283) completed with three proxy CLI subprocess timeouts in `checks-node-compact-small-23`; the aggregate gate reflects that job. Source and child-command analysis found them unrelated to the heartbeat paths. The exact timeout cause remains unknown; no timeout or assertion was weakened. Co-authored-by: Ayaan Zaidi <[email protected]>
Closes #144148.
Thanks @JLahullier for the correlated retry trace.
Related: #143278.
What Problem This Solves
Fixes an issue where a heartbeat lost an accepted alert and scratch update after overload retry completed without another tool call. Compaction and cancellation could also lose or misreport the outcome.
Why This Change Was Made
Keep the latest complete accepted response in run carryover and compaction. Preserve direct-abort reasons and record held reply operations before aborted dispatch returns.
User Impact
Retries retain alerts and scratch proposals; quiet heartbeats stay quiet. Stop and preemption suppress delivery and report their actual result. Existing revision and uncertain-delivery safeguards remain.
Evidence
The compiled Gateway reproduced lost output, then stored the proposal and delivered one alert after the fix. Twelve public scenarios passed, including retry, quiet output, cancellation, concurrent writes and lost acknowledgement. Restart recovery refused blind replay. The integration passed 151 focused checks; live Telegram delivery was not tested.