Bug Description
When the Gateway internal heartbeat poll and a user message arrive in the same processing cycle, the heartbeat ACK (HEARTBEAT_OK) overrides the normal reply. The user only receives HEARTBEAT_OK and the actual reply is lost.
Steps to Reproduce
- User sends a message to the agent
- At approximately the same time, the Gateway internal heartbeat poll fires
- Agent responds with HEARTBEAT_OK instead of the actual reply
- User sees no response or only
HEARTBEAT_OK
Observed Behavior
- On 2026-03-20 ~00:55 (topic 9566): Long reply about "vibe coding learning resources" was truncated. Error: "No response generated. Please try again"
- On 2026-03-20 ~10:58 (topic 9566): User sent "ok" — only received
HEARTBEAT_OK, actual reply was not sent
System Status
- OS: macOS 26.3.1 (arm64) · Node 25.8.0
- Heartbeat: 6h (main agent configured via HEARTBEAT.md)
- Sessions: 39 active
- Current session model: MiniMax-M2.7 / Default: gpt-5.4
Analysis
The Gateway has an internal system-level heartbeat mechanism that is independent of the user-configured HEARTBEAT.md cron. When this heartbeat poll arrives simultaneously with a user message in the same processing cycle, the heartbeat ACK takes priority over the normal reply, effectively suppressing it.
The two heartbeat systems are:
- HEARTBEAT.md cron (user-configured, 3/9/15/21 points) — this is what the user controls
- Gateway internal poll — system-level, not visible or configurable by the user
Expected Behavior
Heartbeat ACKs should not override or suppress normal replies. The two should be independent — a heartbeat poll should never cause a valid user-facing reply to be lost.
Suggested Fix Direction
- Heartbeat responses should be handled in a separate context from user message responses
- Or the gateway should queue heartbeat ACKs rather than letting them race with message responses
- At minimum: log when this collision occurs so it can be diagnosed
Environment
- OpenClaw version: 2026.3.13
Bug Description
When the Gateway internal heartbeat poll and a user message arrive in the same processing cycle, the heartbeat ACK (HEARTBEAT_OK) overrides the normal reply. The user only receives
HEARTBEAT_OKand the actual reply is lost.Steps to Reproduce
HEARTBEAT_OKObserved Behavior
HEARTBEAT_OK, actual reply was not sentSystem Status
Analysis
The Gateway has an internal system-level heartbeat mechanism that is independent of the user-configured HEARTBEAT.md cron. When this heartbeat poll arrives simultaneously with a user message in the same processing cycle, the heartbeat ACK takes priority over the normal reply, effectively suppressing it.
The two heartbeat systems are:
Expected Behavior
Heartbeat ACKs should not override or suppress normal replies. The two should be independent — a heartbeat poll should never cause a valid user-facing reply to be lost.
Suggested Fix Direction
Environment