Repository navigation
Conversation
b5e6fa4 to
6cd640d
Compare
|
Codex review: needs real behavior proof before merge. Reviewed August 11, 2026, 12:08 PM ET / 16:08 UTC. ClawSweeper reviewWhat this changesThe PR carries the agent turn’s terminal result into heartbeat finalization so failure alerts do not acknowledge retryable work, dedupe state, or inspected events as successful. Merge readiness⛔ Blocked until real behavior proof from a real setup is added - 7 items remain Keep open: the new terminal-status bridge maps cancelled agent turns to failures, so intentional restart/user aborts become runner-failure heartbeat outcomes. It also needs real production-boundary proof before merge. Priority: P1 Review scores
Verification
How this fits togetherHeartbeat invokes an embedded agent, classifies its reply, then either delivers an alert or updates retry and dedupe state. The PR adds a private handoff from the reply runner to heartbeat classification so an agent failure remains failed after a visible alert. flowchart LR
A[Heartbeat wake] --> B[Embedded agent turn]
B --> C[Reply operation state]
C --> D[Heartbeat classification]
D --> E[Failure notice]
D --> F[Retry and dedupe state]
E --> G[Channel delivery]
Before merge
Findings
Agent review detailsSecurityNone. PR surfaceSource +32, Tests +189. Total +221 across 10 files. View PR surface stats
Review metrics
Merge-risk optionsMaintainer options:
Technical reviewBest possible solution: Preserve the canonical cancelled-versus-failed terminal category through heartbeat classification, retain unacknowledged work for both non-success outcomes, and attach a redacted injected-failure trace that shows a retained event followed by a successful retry. Do we have a high-confidence way to reproduce the issue? Yes for a source-level reproduction: an aborted reply-run outcome is explicitly possible and the new bridge converts it to failed; no live current-head run was performed. Is this the best way to solve the issue? No: the handoff is at the right owner boundary, but it must preserve cancellation separately from failure rather than collapsing every non-settled result into a runner failure. Full review comments:
Overall correctness: patch is incorrect AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against 903af8bef557. LabelsLabel changes:
Label justifications:
EvidenceWhat I checked:
Likely related people:
Rank-up movesOptional improvements that raise the rating; they are not merge blockers.
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
HistoryReview history (7 earlier review cycles)
|
6cd640d to
9f6fd24
Compare
|
@clawsweeper re-review Rank-up moves from the August 7 review:
The refreshed PR body contains the exact upstream Codex terminal-turn contract, 211 focused tests, static checks, LOC split, and clean max-P2 autoreview. |
|
🦞🧹 I asked ClawSweeper to review this item again. Re-review progress:
|
9f6fd24 to
4899712
Compare
Treat visible runner-failure notices as failed heartbeat turns, preserving queued cron and exec events plus prior heartbeat dedupe state for a later successful run. Co-authored-by: Emma <[email protected]>
d87a98f to
d67c8e4
Compare
|
Merged via squash.
|
* fix(heartbeat): keep failed work pending after alerts Treat visible runner-failure notices as failed heartbeat turns, preserving queued cron and exec events plus prior heartbeat dedupe state for a later successful run. Co-authored-by: Emma <[email protected]> * fix(heartbeat): narrow failure reply payload * fix(heartbeat): preserve failure reply privacy * fix(heartbeat): isolate suppressed failure payloads * refactor(heartbeat): keep terminal failure type private * fix(heartbeat): consume terminal failure type * refactor(heartbeat): keep terminal status internal --------- Co-authored-by: Peter Steinberger <[email protected]> Co-authored-by: Emma <[email protected]>
Related: #94536
What Problem This Solves
Fixes an issue where users could receive a heartbeat runner-failure alert while OpenClaw still finalized the underlying heartbeat as successful. Retryable cron or exec events could be consumed, prior successful-heartbeat dedupe state could be replaced, and due work could be treated as completed even though the agent turn failed.
Why This Change Was Made
The root cause was ownership: heartbeat delivery inferred runner failure from rendered reply text after the agent runner had already produced the authoritative terminal outcome. That let a host-authored failure notice continue through successful-heartbeat bookkeeping.
The maintainer rewrite records the terminal agent-turn fact at the reply-operation owner, carries it into heartbeat classification, and routes both runner failures and terminal tool failures through one failure-notice finalizer. A visible notice remains a failed heartbeat: retryable events and prior dedupe state stay intact, while a successfully delivered notice clears only the exact pending-final recovery record it satisfies. Source-suppressed failure payloads remain private, and generic foreground failure copy is rewritten for heartbeat delivery even when an earlier heartbeat response was captured.
This preserves Emma's generic invariant and contributor credit while replacing the original text-inference patch with the canonical status-owner repair. The credited commit retains
Co-authored-by: Emma <[email protected]>.User Impact
When a heartbeat agent turn fails, users can still receive a useful alert, but OpenClaw keeps the underlying work pending for a later successful heartbeat. Message-tool-only private replies remain private, and failure alerts no longer contain foreground-only recovery guidance.
Evidence
d67c8e45b71b2724dc9e544555b7cf04098f4d21: 4 files, 211 tests passed (the initial rewrite proof was 209 tests; two review-driven privacy/selection regressions raised the final count to 211).oxfmt --check, core Oxlint,git diff --check origin/main...HEAD, and changed-gate dry-run passed. The dry-run selected onlycoreandcoreTests.tbx_01kzrrfyte696grctmgkac22nfpassedpnpm plugin-sdk:api:checkwithout changing the generated baseline (run).openai/codex@279b93242cfef379e65da97e87e44b83c5934fd7:turn/completedcarries an explicit terminal status,TurnStatusincludesFailed, and app-server maps a recorded terminal error toTurnStatus::Failedwhile withholding a successful final agent message (source).