Summary
heartbeat.isolatedSession: true is documented to run each heartbeat in a "fresh session with no prior conversation history" using "the same isolation pattern as cron sessionTarget: isolated."
In practice, the heartbeat session file accumulates messages across multiple runs and eventually triggers auto-compaction. This produces empty compaction summaries that poison the context, causing the model to stop executing tool calls (e.g., exec for scripts referenced in HEARTBEAT.md).
Environment
- OpenClaw version: 2026.3.24 (cff6dc9)
- OS: macOS (Darwin 25.3.0, arm64)
- Node: v25.8.0
- Heartbeat model: openai-codex/gpt-5.4-mini
Config
{
"heartbeat": {
"every": "65m",
"model": "openai-codex/gpt-5.4-mini",
"target": "none",
"lightContext": true,
"isolatedSession": true,
"ackMaxChars": 300,
"suppressToolErrorWarnings": true
}
}
Expected Behavior
Each heartbeat run should start with a completely fresh session — no prior messages, no compaction history. The session file should either be new each time or the old one should be cleared.
Actual Behavior
The heartbeat reuses the same session key (agent:<name>:main:heartbeat) and appends to the same session file. Over days/weeks:
- Messages accumulate in the session file across heartbeat runs
- Auto-compaction triggers when the file approaches the context limit
- Compaction produces empty summaries ("Goal: none, Progress: none")
- The model sees these empty summaries and learns to skip tool calls
- Heartbeat becomes non-functional — model returns HEARTBEAT_OK without reading HEARTBEAT.md or executing any commands
Evidence
One agent (Morpheus) accumulated 6 compaction entries in its heartbeat session file over ~3 days, all with identical empty summaries:
## Goal
(none) - Session initialized without prior context or task description.
## Progress
### Done
- [x] (none)
## Next Steps
1. Await user input to define the coding task or goal.
Meanwhile, the same agent's heartbeat config with isolatedSession: true should have prevented any history accumulation.
Other agents (Vesper, Selena) showed similar patterns — heartbeat sessions with stale content from days ago, models not executing scripts.
Workaround
Periodically delete the heartbeat session file and remove the session entry from sessions.json. This forces a truly fresh start. We built an automated watchdog script that checks for degenerate sessions (>2 compactions) and auto-resets them.
Suggested Fix
Either:
- Actually create a new session file for each heartbeat run when
isolatedSession: true (matching the documented behavior)
- Clear/truncate the session file before each heartbeat run
- Prevent auto-compaction on isolated heartbeat sessions entirely
Summary
heartbeat.isolatedSession: trueis documented to run each heartbeat in a "fresh session with no prior conversation history" using "the same isolation pattern as cronsessionTarget: isolated."In practice, the heartbeat session file accumulates messages across multiple runs and eventually triggers auto-compaction. This produces empty compaction summaries that poison the context, causing the model to stop executing tool calls (e.g.,
execfor scripts referenced in HEARTBEAT.md).Environment
Config
{ "heartbeat": { "every": "65m", "model": "openai-codex/gpt-5.4-mini", "target": "none", "lightContext": true, "isolatedSession": true, "ackMaxChars": 300, "suppressToolErrorWarnings": true } }Expected Behavior
Each heartbeat run should start with a completely fresh session — no prior messages, no compaction history. The session file should either be new each time or the old one should be cleared.
Actual Behavior
The heartbeat reuses the same session key (
agent:<name>:main:heartbeat) and appends to the same session file. Over days/weeks:Evidence
One agent (Morpheus) accumulated 6 compaction entries in its heartbeat session file over ~3 days, all with identical empty summaries:
Meanwhile, the same agent's heartbeat config with
isolatedSession: trueshould have prevented any history accumulation.Other agents (Vesper, Selena) showed similar patterns — heartbeat sessions with stale content from days ago, models not executing scripts.
Workaround
Periodically delete the heartbeat session file and remove the session entry from
sessions.json. This forces a truly fresh start. We built an automated watchdog script that checks for degenerate sessions (>2 compactions) and auto-resets them.Suggested Fix
Either:
isolatedSession: true(matching the documented behavior)