You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When agents.defaults.heartbeat.to is configured, all outgoing messages (including normal replies to user DMs) get incorrectly routed to the heartbeat target channel. Moreover, the content sent to the wrong channel is different from the content sent to the correct channel — as if two independent LLM generations occurred.
This is a privacy breach: private chat responses are leaked to a group/channel, and the leaked content may not even match what the user receives.
The response appears in the heartbeat target group (oc_8d6a0a64d5d4bb05a9f19c707c03ca6a) with content A
The user receives a DIFFERENT response with content B in the private chat
Or, in some cases:
The DM reply goes to the group
The heartbeat reply goes to the DM
Both contents are different
It appears that the routing context (deliveryContext.to) is being overwritten globally by the heartbeat configuration, and the message generation is triggered twice (once for each destination) with different outputs.
Shows that heartbeat config in defaults is buggy in multiple ways.
Supports the hypothesis that agents.defaults.heartbeat.* should not be applied globally.
Root Cause Hypothesis
When agents.defaults.heartbeat.to is set, the heartbeat's routing target is being incorrectly applied to the session's deliveryContext as a side effect. Since OpenClaw uses deliveryContext.to to determine where to send outgoing messages, all messages (not just heartbeat) get routed to the heartbeat target.
Furthermore, the system seems to queue the message for both destinations (original and heartbeat target), generating two independent LLM responses. This explains the content divergence.
Workaround (Validated ✅)
Move the heartbeat configuration from agents.defaults to the specific agent that needs it:
Summary
When
agents.defaults.heartbeat.tois configured, all outgoing messages (including normal replies to user DMs) get incorrectly routed to the heartbeat target channel. Moreover, the content sent to the wrong channel is different from the content sent to the correct channel — as if two independent LLM generations occurred.This is a privacy breach: private chat responses are leaked to a group/channel, and the leaked content may not even match what the user receives.
Configuration
{ "agents": { "defaults": { "heartbeat": { "every": "30m", "activeHours": { "start": "08:00", "end": "22:00" }, "target": "feishu", "to": "oc_8d6a0a64d5d4bb05a9f19c707c03ca6a" } } } }Observed Behavior
oc_8d6a0a64d5d4bb05a9f19c707c03ca6a) with content AOr, in some cases:
It appears that the routing context (
deliveryContext.to) is being overwritten globally by the heartbeat configuration, and the message generation is triggered twice (once for each destination) with different outputs.Related Issues
This is similar to but distinct from:
[Bug]: Heartbeat set to reply to Telegram group gets mixed up with direct chat #28639 - "Heartbeat set to reply to Telegram group gets mixed up with direct chat"
[Bug]: Heartbeat prompts incorrectly routed to Discord DMs #25871 - "Heartbeat prompts incorrectly routed to Discord DMs"
[Bug]:
agents.defaults.heartbeat.modelConfig Ignored #19445 - "agents.defaults.heartbeat.modelConfig Ignored"defaultsis buggy in multiple ways.agents.defaults.heartbeat.*should not be applied globally.Root Cause Hypothesis
When
agents.defaults.heartbeat.tois set, the heartbeat's routing target is being incorrectly applied to the session's deliveryContext as a side effect. Since OpenClaw usesdeliveryContext.toto determine where to send outgoing messages, all messages (not just heartbeat) get routed to the heartbeat target.Furthermore, the system seems to queue the message for both destinations (original and heartbeat target), generating two independent LLM responses. This explains the content divergence.
Workaround (Validated ✅)
Move the heartbeat configuration from
agents.defaultsto the specific agent that needs it:{ "agents": { "defaults": { // Remove heartbeat from here }, "list": [ { "id": "main", // ... "heartbeat": { "every": "30m", "activeHours": { "start": "08:00", "end": "22:00" }, "target": "feishu", "to": "oc_8d6a0a64d5d4bb05a9f19c707c03ca6a" } } ] } }Validation results (after Gateway restart):
deliveryContext.toremainsuser:ou_xxx)Test method:
defaults, added tomain)openclaw gateway restart)deliveryContext.toin active session points to DM, not groupfeishu_im_user_message: sendentry for the test messageNote: This workaround is validated for single-agent setups. Multi-agent with different heartbeat targets needs further testing.
Impact & Severity
OpenClaw Version
2026.4.10(fromopenclaw.jsonmeta.lastTouchedVersion)Request
agents.defaults.heartbeathandling.agents.defaults.heartbeat.Workaround Status: ✅ Validated — Configuration change applied, Gateway restarted, routing verified correct in production. Heartbeat functionality preserved. Multi-agent scenarios untested.