-
-
Notifications
You must be signed in to change notification settings - Fork 79.1k
[Bug]: Heartbeat-driven agent replies leave pendingFinalDelivery stuck, blocking subsequent heartbeats #83184
Copy link
Copy link
Open
Labels
P1High-priority user-facing bug, regression, or broken workflow.High-priority user-facing bug, regression, or broken workflow.clawsweeper:linked-pr-openClawSweeper found an open linked pull request for this issue.ClawSweeper found an open linked pull request for this issue.clawsweeper:no-new-fix-prClawSweeper does not recommend queueing a new automated fix PR for this issue.ClawSweeper does not recommend queueing a new automated fix PR for this issue.clawsweeper:source-reproClawSweeper found a high-confidence source-level issue reproduction.ClawSweeper found a high-confidence source-level issue reproduction.impact:message-lossChannel message delivery can be lost, duplicated, or misrouted.Channel message delivery can be lost, duplicated, or misrouted.impact:session-stateSession, memory, transcript, context, or agent state can drift or corrupt.Session, memory, transcript, context, or agent state can drift or corrupt.issue-rating: 🦞 diamond lobsterVery strong issue quality with high-confidence source-level or clear reproduction.Very strong issue quality with high-confidence source-level or clear reproduction.
Metadata
Metadata
Assignees
Labels
P1High-priority user-facing bug, regression, or broken workflow.High-priority user-facing bug, regression, or broken workflow.clawsweeper:linked-pr-openClawSweeper found an open linked pull request for this issue.ClawSweeper found an open linked pull request for this issue.clawsweeper:no-new-fix-prClawSweeper does not recommend queueing a new automated fix PR for this issue.ClawSweeper does not recommend queueing a new automated fix PR for this issue.clawsweeper:source-reproClawSweeper found a high-confidence source-level issue reproduction.ClawSweeper found a high-confidence source-level issue reproduction.impact:message-lossChannel message delivery can be lost, duplicated, or misrouted.Channel message delivery can be lost, duplicated, or misrouted.impact:session-stateSession, memory, transcript, context, or agent state can drift or corrupt.Session, memory, transcript, context, or agent state can drift or corrupt.issue-rating: 🦞 diamond lobsterVery strong issue quality with high-confidence source-level or clear reproduction.Very strong issue quality with high-confidence source-level or clear reproduction.
Type
Fields
Give feedbackNo fields configured for issues without a type.
Bug type
Behavior bug (incorrect output/state without crash)
Beta release blocker
No
Summary
runHeartbeatOncewriteslastHeartbeatText/lastHeartbeatSentAtafter a successful send but never nulls thependingFinalDelivery*fields, so any heartbeat-driven agent run that previously setpendingFinalDelivery: trueleaves the session permanently stuck on the get-reply redelivery short-circuit.Steps to reproduce
getReplyFromConfigproduces a substantive (non-HEARTBEAT_OK) text payload. The reply-agent path (src/auto-reply/reply/agent-runner.ts:2169) setspendingFinalDelivery: trueon the session at the end of substantive runs regardless of trigger.sendDurableMessageBatchsucceeds andrunHeartbeatOncewriteslastHeartbeatText/lastHeartbeatSentAt(src/infra/heartbeat-runner.ts:2011-2022).Expected behavior
After step 2,
pendingFinalDelivery*is cleared (the same way the user-message dispatch path does it viaclearPendingFinalDeliveryAfterSuccessatsrc/auto-reply/reply/dispatch-from-config.ts:365-391, called from:1671). Subsequent heartbeats observe a clean session and invoke the agent normally.Actual behavior
pendingFinalDeliveryremainstrueindefinitely. On the next heartbeat, the get-reply fast path treats the session as having an unresolved final delivery and short-circuits before invoking the agent. The user observes silent loss: no notifications, no model calls, no errors surfaced.OpenClaw version
Verified affected:
2026.5.7through2026.5.16-beta.2. Diagnosis applies to currentmain(2026.5.17).Operating system
Linux (Docker deployment).
Install method
docker
Model
NOT_ENOUGH_INFO (model-independent; bug is in core heartbeat send path).
Provider / routing chain
NOT_ENOUGH_INFO (provider-independent).
Additional provider/model setup details
NOT_ENOUGH_INFO
Logs, screenshots, and evidence
Impact and severity
HEARTBEAT_OK) text. Heartbeat-only setups silently lose every subsequent heartbeat after the first substantive run.Additional information
Suggested fix: extend the existing
updateSessionStorecall atsrc/infra/heartbeat-runner.ts:2011-2022to also null the sevenpendingFinalDelivery*fields, mirroringclearPendingFinalDeliveryAfterSuccess. A regression test seedingpendingFinalDelivery: true+ a heartbeat-ackpendingFinalDeliveryText(so the heartbeat-defer check at:1328does not short-circuit), runningrunHeartbeatOncewith a substantive reply, and asserting all seven fields areundefinedafterward reproduces the bug and pins the fix.PR follow-up will be linked here.