Repository navigation
fix(cron): deliver final results after heartbeat acknowledgements - #113924
Conversation
|
Codex review: found issues before merge. Reviewed August 8, 2026, 3:45 AM ET / 07:45 UTC. ClawSweeper reviewWhat this changesThe PR changes isolated cron delivery so a heartbeat acknowledgement or trailing empty payload does not suppress a later scheduled-job result. Merge readiness⛔ Blocked by patch quality or review findings - 5 items remain This PR remains necessary, but its exact head still sends an earlier Priority: P1 Review scores
Verification
How this fits togetherScheduled isolated-agent jobs collect agent payloads, decide whether a heartbeat-only response should stay quiet, and dispatch the resulting batch to the configured channel. This change sits between payload selection and outbound channel delivery. flowchart LR
A[Scheduled job] --> B[Isolated agent turn]
B --> C[Selected payload batch]
C --> D[Heartbeat decision]
D --> E[Outbound delivery batch]
E --> F[Configured channel]
Before merge
Findings
Agent review detailsSecurityNone. PR surfaceSource +4, Tests +63. Total +67 across 4 files. View PR surface stats
Review metrics
Merge-risk optionsMaintainer options:
Technical reviewBest possible solution: Canonicalize cron delivery payloads before dispatch: remove pure earlier heartbeat acknowledgements when later substantive content exists, while retaining terminal-heartbeat suppression and media or structured payloads. Do we have a high-confidence way to reproduce the issue? Yes—source establishes that a Is this the best way to solve the issue? No; changing only the suppression boolean is too narrow because payload selection still forwards the earlier control acknowledgement. Filtering at the selected delivery-batch owner is the narrower durable repair. Full review comments:
Overall correctness: patch is incorrect AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against bf0aadbc40c2. LabelsLabel justifications:
EvidenceWhat I checked:
Likely related people:
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
HistoryReview history (3 earlier review cycles)
|
8e94413 to
a0b5f50
Compare
|
@clawsweeper re-review |
|
🦞👀 Command router queued. I will update this comment with the next step. |
|
Merged via squash.
|
What Problem This Solves
Fixes an issue where scheduled agent jobs could silently lose a completed result when an earlier payload contained a heartbeat acknowledgement. Cron treated any acknowledgement anywhere in the payload batch as the terminal outcome, so a later substantive result was never sent.
Why This Change Was Made
Cron payload resolution now records one authoritative delivery disposition from the producer-owned terminal assistant text while it constructs the canonical delivery batch. Earlier standalone heartbeat acknowledgements are removed before delivery, terminal acknowledgements remain intentionally quiet, and structured or media payloads remain visible. The downstream finalizer consumes that recorded disposition instead of re-deriving it from the batch; the obsolete standalone predicate and duplicate tests were removed.
This is the owner-boundary repair rather than the stale branch's last-payload guard: the stale approach would still have sent the control token before the final result, allowing it to leak or fail before the result reached recipient custody.
User Impact
Scheduled reports, alerts, and actionable failures now reach the configured channel when a model first emits a heartbeat acknowledgement and then completes the task. Genuine terminal heartbeat-only responses remain quiet, and media or structured cron output is preserved.
Evidence
a0b5f504a713185eabd12edb7b68f917a2b20543.HEARTBEAT_OKbefore the final result.delivered: falseand made no send.node scripts/run-vitest.mjs src/cron/isolated-agent.helpers.test.ts src/cron/isolated-agent/helpers.test.ts src/cron/isolated-agent/run.interim-retry.test.ts src/cron/isolated-agent/run.meta-error-status.test.ts src/cron/isolated-agent/run.message-tool-policy.test.ts src/cron/isolated-agent.direct-delivery-core-channels.test.ts— 6 files passed, 140 tests passed.deleteAfterRun: 1 file passed, 16 tests passed; exactly one final result was sent and guarded session cleanup ran afterward.node scripts/check-changed.mjs— passed on Blacksmith Testboxtbx_01kzk24h21bbk1bbjd2q88sg5x; formatting, core and test typechecks, lint, boundary checks, dead exports, import cycles, and database-first guards passed. Run: https://github.com/openclaw/openclaw/actions/runs/31309181158a0b5f504a713185eabd12edb7b68f917a2b20543: https://github.com/openclaw/openclaw/actions/runs/31310172102