Repository navigation
fix(heartbeat): avoid claiming excluded outcomes were recorded - #125207
Conversation
|
🦞👀 Pull request received. I will update this pull request when review starts. |
|
Codex review: needs maintainer review before merge. Reviewed August 17, 2026, 6:53 AM ET / 10:53 UTC. ClawSweeper reviewWhat this changesThe PR replaces heartbeat tool claims that an outcome was recorded with an accepted-for-post-turn-handling contract, including the tool catalog, tests, and Codex prompt snapshots. Regression provenancePossible regression — probable (reviewed change; failure trace). No predecessor PR is attributed. Merge readinessKeep open for maintainer handling: the branch addresses the prior catalog wording finding and the OpenClaw lifecycle fix is coherent, but the required direct Codex source check cannot be completed because the sibling checkout is absent in this read-only environment. Priority: P2 Review scores
Verification
How this fits togetherA heartbeat agent submits an outcome and optional notification through a one-shot tool. The runner later chooses visible delivery or persistence of eligible silent outcomes, while the Codex bridge returns the tool’s text to the model. flowchart LR
A[Heartbeat agent] --> B[Heartbeat response tool]
B --> C[Runtime tool result]
C --> D[Heartbeat runner]
D --> E[SQLite silent handoff]
D --> F[Visible notification]
Before merge
Agent review detailsSecurityNone. PR surfaceSource 0, Tests +6. Total +6 across 8 files. View PR surface stats
Review metrics
Stored data modelPersistent data-model change detected: Merge-risk optionsMaintainer options:
Technical reviewBest possible solution: Merge only after a reviewer directly checks the pinned Codex tool-output source and confirms that the changed JSON text is the model-visible value; retain the accepted-versus-persisted lifecycle split. Do we have a high-confidence way to reproduce the issue? Yes. Current main returns Is this the best way to solve the issue? Yes for the OpenClaw lifecycle: the tool can only accept a response, while the runner owns later delivery and persistence. The dependent Codex transport contract still needs the required direct source inspection. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against bb95d106d813. 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
History |
|
ClawSweeper rank-up moves are complete on
Exact-head CI is green: https://github.com/openclaw/openclaw/actions/runs/32021792565 |
|
Merged via squash.
|
…law#125207) * fix(heartbeat): report accepted outcomes honestly * test(heartbeat): refresh response tool snapshots * fix(heartbeat): align tool catalog wording
What Problem This Solves
Fixes an issue where heartbeat responses told the model
status: recordedeven when the outcome was intentionally excluded from the SQLite handoff. Live QA observed this for quietno_changeheartbeats and visibleneeds_attentionnotifications, leaving the model-facing result inconsistent withheartbeat_outcomes.Why This Change Was Made
The SQLite store remains scoped to meaningful silent work (
progress,done,blocked, or silentneeds_attention) that the next user turn needs as hidden context.no_changeremains an operator heartbeat event, whilenotify=trueremains owned by visible delivery. The tool now reportsstatus: accepted, which accurately describes the only fact known at tool-call time before post-turn persistence or delivery.This is AI-assisted. The implementation and storage/read lifecycle were reviewed against both OpenClaw runtimes and the Codex tool-output transport.
User Impact
Models no longer receive a false persistence claim after quiet no-change checks or urgent visible notifications. Existing heartbeat delivery and next-turn silent-result handoff behavior are unchanged.
Evidence
node scripts/run-vitest.mjs src/agents/tools/heartbeat-response-tool.test.tsfailed both new regressions because the quiet and urgent cases returnedrecordedinstead ofaccepted.node scripts/run-vitest.mjs src/agents/tools/heartbeat-response-tool.test.ts src/agents/embedded-agent-subscribe.subscribe-embedded-agent-session.subscribeembeddedagentsession.test.ts src/agents/embedded-agent-subscribe.block-reply-rejections.test.ts extensions/codex/src/app-server/dynamic-tools.test.ts src/infra/heartbeat-outcome-store.test.ts src/infra/heartbeat-runner.tool-response.test.ts— 263 passed across four shards.node scripts/check-changed.mjs— passed core/extension typecheck, lint, architecture, SQLite, and guard lanes.pnpm prompt:snapshots:checkandnode scripts/run-vitest.mjs test/scripts/prompt-snapshots.test.ts— current; 13 passed.no_changeand urgentneeds_attentionboth returnedstatus: acceptedwith outcome, notify, and notification text preserved.openai/codex@9ded177ce7c1c0bd2047f902936c177612ab3434:JsonToolOutput::to_response_itemsends the JSON value as model-facing text, whileFunctionCallOutputPayloadserializes that body directly on the function/custom-tool output wire contract and keeps success metadata internal.