fix(heartbeat): skip pendingFinalDelivery when reply strips to HEARTBEAT_OK#79270
fix(heartbeat): skip pendingFinalDelivery when reply strips to HEARTBEAT_OK#79270hclsys wants to merge 5 commits into
Conversation
|
Codex review: needs real behavior proof before merge. Summary Reproducibility: yes. source-reproducible. The linked report gives deterministic v2026.5.7 steps, and current main source shows the pending write, heartbeat replay attempt update, and defer-window loop; I did not run a live gateway reproduction in this read-only review. Real behavior proof Next step before merge Security Review findings
Review detailsBest possible solution: Keep the PR focused on heartbeat pending delivery, thread the same resolved Do we have a high-confidence way to reproduce the issue? Yes, source-reproducible. The linked report gives deterministic v2026.5.7 steps, and current main source shows the pending write, heartbeat replay attempt update, and defer-window loop; I did not run a live gateway reproduction in this read-only review. Is this the best way to solve the issue? No, not yet. Reusing Full review comments:
Overall correctness: patch is incorrect What I checked:
Likely related people:
Remaining risk / open question:
Codex review notes: model gpt-5.5, reasoning high; reviewed against 297a16453661. |
shouldSkipHeartbeatPendingFinalDelivery was using the default 300-char threshold regardless of per-agent heartbeat config. Replace with inline logic that resolves ackMaxChars from cfg.agents[agentId].heartbeat -> cfg.agents.defaults.heartbeat -> DEFAULT_HEARTBEAT_ACK_MAX_CHARS. Also fix: store the stripped text (remainder after HEARTBEAT_OK) rather than the raw payload text. Previously pendingFinalDeliveryText would have contained the HEARTBEAT_OK prefix, causing heartbeat-runner to re-deliver it verbatim on retry. Resolves clawsweeper P2 review finding on openclaw#79270.
This comment was marked as low quality.
This comment was marked as low quality.
This comment was marked as low quality.
This comment was marked as low quality.
This comment was marked as low quality.
This comment was marked as low quality.
shouldSkipHeartbeatPendingFinalDelivery was using the default 300-char threshold regardless of per-agent heartbeat config. Replace with inline logic that resolves ackMaxChars from cfg.agents[agentId].heartbeat -> cfg.agents.defaults.heartbeat -> DEFAULT_HEARTBEAT_ACK_MAX_CHARS. Also fix: store the stripped text (remainder after HEARTBEAT_OK) rather than the raw payload text. Previously pendingFinalDeliveryText would have contained the HEARTBEAT_OK prefix, causing heartbeat-runner to re-deliver it verbatim on retry. Resolves clawsweeper P2 review finding on #79270.
|
🦞🧹 Reason: re-review requires an open issue or PR. |
shouldSkipHeartbeatPendingFinalDelivery was using the default 300-char threshold regardless of per-agent heartbeat config. Replace with inline logic that resolves ackMaxChars from cfg.agents[agentId].heartbeat -> cfg.agents.defaults.heartbeat -> DEFAULT_HEARTBEAT_ACK_MAX_CHARS. Also fix: store the stripped text (remainder after HEARTBEAT_OK) rather than the raw payload text. Previously pendingFinalDeliveryText would have contained the HEARTBEAT_OK prefix, causing heartbeat-runner to re-deliver it verbatim on retry. Resolves clawsweeper P2 review finding on openclaw#79270.
shouldSkipHeartbeatPendingFinalDelivery was using the default 300-char threshold regardless of per-agent heartbeat config. Replace with inline logic that resolves ackMaxChars from cfg.agents[agentId].heartbeat -> cfg.agents.defaults.heartbeat -> DEFAULT_HEARTBEAT_ACK_MAX_CHARS. Also fix: store the stripped text (remainder after HEARTBEAT_OK) rather than the raw payload text. Previously pendingFinalDeliveryText would have contained the HEARTBEAT_OK prefix, causing heartbeat-runner to re-deliver it verbatim on retry. Resolves clawsweeper P2 review finding on openclaw#79270.
shouldSkipHeartbeatPendingFinalDelivery was using the default 300-char threshold regardless of per-agent heartbeat config. Replace with inline logic that resolves ackMaxChars from cfg.agents[agentId].heartbeat -> cfg.agents.defaults.heartbeat -> DEFAULT_HEARTBEAT_ACK_MAX_CHARS. Also fix: store the stripped text (remainder after HEARTBEAT_OK) rather than the raw payload text. Previously pendingFinalDeliveryText would have contained the HEARTBEAT_OK prefix, causing heartbeat-runner to re-deliver it verbatim on retry. Resolves clawsweeper P2 review finding on openclaw#79270.
Summary
pendingFinalDeliverysoHEARTBEAT_OKdoes not become durable replay textgetReplyFromConfigretries it, preserving normal pending replay for real contentFixes #79258.
Audit
stripHeartbeatToken; no new token parserReal behavior proof
HEARTBEAT_OKorAll clear.\n\nHEARTBEAT_OKmust not become durable pending final-delivery replay state, while real heartbeat notification text must still be preserved for delivery recovery.origin/main(0f31b6424e) using production TypeScript modules throughnode --import tsx, plus the affected project test shards.{ "ack": { "shouldSkip": true, "text": "", "didStrip": true }, "preambleAck": { "shouldSkip": true, "text": "", "didStrip": true }, "real": { "shouldSkip": false, "text": "Sent daily summary to channel.", "didStrip": false } }pnpm check:changedpassed.