Bug Report: Heartbeat session Target Not Working for Non-Main Agents
OpenClaw Version: 2026.2.19-2 (45d9b20)
Platform: macOS 26.2 (arm64)
Date: 2026-02-20
Summary
When configuring heartbeat.session to target a Discord channel for non-main agents, heartbeats do not fire. The same configuration works correctly for the main agent.
Configuration
{
"agents": {
"list": [
{
"id": "main",
"name": "Kuki",
"workspace": "/Users/yesilay/.openclaw/workspace",
"heartbeat": {
"every": "30m",
"session": "discord:channel:1473606310695010463"
}
},
{
"id": "avci",
"name": "Avcı",
"workspace": "/Users/yesilay/.openclaw/workspace/agents/avci",
"heartbeat": {
"every": "1h",
"session": "discord:channel:1473606349039599723"
}
},
{
"id": "arin",
"name": "Arin",
"workspace": "/Users/yesilay/.openclaw/workspace/agents/arin",
"heartbeat": {
"every": "10m",
"session": "discord:channel:1473606609610739857"
}
}
]
}
}
Expected Behavior
All agents should fire heartbeats to their configured Discord channels at the specified intervals.
Actual Behavior
- Main agent (Kuki): ✅ Heartbeats fire correctly to Discord channel every 30 minutes
- Non-main agents (Avcı, Leo, Yoda, Nova, Arin): ❌ Heartbeats do NOT fire to Discord channels
- Last heartbeat timestamps show:
- Kuki: Active (just now)
- Arin: Last active 1+ hour ago (10-minute interval missed 6+ times)
- Others: Similar pattern
Session Store Verification
Sessions exist in each agent's store file:
$ cat ~/.openclaw/agents/avci/sessions/sessions.json | jq 'keys'
["agent:avci:discord:channel:1473606349039599723"]
$ cat ~/.openclaw/agents/arin/sessions/sessions.json | jq 'keys'
["agent:arin:discord:channel:1473606609610739857"]
Log Evidence
Gateway logs show heartbeats being "started" but no evidence of them actually running for non-main agents after the initial startup:
2026-02-20T13:58:35.657Z [heartbeat] started
2026-02-20T13:58:36.776Z [discord] [arin] starting provider (@Arin)
No subsequent heartbeat runs logged for arin after 13:58 (current time is ~17:00+).
Analysis
From code inspection of health--JybOkd4.js:
-
resolveHeartbeatSession() resolves the session key correctly:
discord:channel:XXX → agent:{agentId}:discord:channel:XXX
-
Session lookup: store[canonical] requires the session to exist in the store
- Sessions DO exist (verified above)
-
The heartbeat runner may be:
- Silently skipping non-main agents
- Failing to resolve the agent's store path correctly
- Only processing the default/main agent in the heartbeat loop
Workaround
Using cron jobs to fire heartbeat prompts directly to Discord channels works:
openclaw cron add --name "avci-heartbeat-discord" \
--schedule "0 * * * *" \
--targetId "1473606349039599723" \
--message "Read HEARTBEAT.md if it exists..."
Steps to Reproduce
- Configure multiple agents with
heartbeat.session targeting Discord channels
- Restart gateway:
openclaw gateway restart
- Wait for heartbeat intervals to pass
- Check
openclaw system heartbeat last — only main agent appears
- Check agent sessions'
updatedAt timestamps — non-main agents not updating
Environment
- OS: macOS 26.2 (Sequel) arm64
- Node: v25.4.0
- Gateway: local, ws://127.0.0.1:18789
- Discord: Multiple bot accounts (one per agent), all properly authenticated
Additional Context
This is a hub-and-spoke multi-agent setup with 6 agents:
- main (Kuki) - orchestrator
- avci - YouTube analytics
- leo - Finance
- yoda - Code
- nova - Research
- arin - System monitoring
All agents share the same Discord guild but have dedicated channels and bot tokens.
Bug Report: Heartbeat
sessionTarget Not Working for Non-Main AgentsOpenClaw Version: 2026.2.19-2 (45d9b20)
Platform: macOS 26.2 (arm64)
Date: 2026-02-20
Summary
When configuring
heartbeat.sessionto target a Discord channel for non-main agents, heartbeats do not fire. The same configuration works correctly for the main agent.Configuration
{ "agents": { "list": [ { "id": "main", "name": "Kuki", "workspace": "/Users/yesilay/.openclaw/workspace", "heartbeat": { "every": "30m", "session": "discord:channel:1473606310695010463" } }, { "id": "avci", "name": "Avcı", "workspace": "/Users/yesilay/.openclaw/workspace/agents/avci", "heartbeat": { "every": "1h", "session": "discord:channel:1473606349039599723" } }, { "id": "arin", "name": "Arin", "workspace": "/Users/yesilay/.openclaw/workspace/agents/arin", "heartbeat": { "every": "10m", "session": "discord:channel:1473606609610739857" } } ] } }Expected Behavior
All agents should fire heartbeats to their configured Discord channels at the specified intervals.
Actual Behavior
Session Store Verification
Sessions exist in each agent's store file:
Log Evidence
Gateway logs show heartbeats being "started" but no evidence of them actually running for non-main agents after the initial startup:
No subsequent heartbeat runs logged for arin after 13:58 (current time is ~17:00+).
Analysis
From code inspection of
health--JybOkd4.js:resolveHeartbeatSession()resolves the session key correctly:discord:channel:XXX→agent:{agentId}:discord:channel:XXXSession lookup:
store[canonical]requires the session to exist in the storeThe heartbeat runner may be:
Workaround
Using cron jobs to fire heartbeat prompts directly to Discord channels works:
Steps to Reproduce
heartbeat.sessiontargeting Discord channelsopenclaw gateway restartopenclaw system heartbeat last— only main agent appearsupdatedAttimestamps — non-main agents not updatingEnvironment
Additional Context
This is a hub-and-spoke multi-agent setup with 6 agents:
All agents share the same Discord guild but have dedicated channels and bot tokens.