Summary
When aggressive session pruning removes agent:main:main from sessions, the Control UI session picker no longer shows the primary session. Heartbeat ticks keep agent:main:main:heartbeat alive, so that becomes the only visible session in the picker. The webchat input then routes user messages directly into the heartbeat-suffixed session — resulting in human↔AI conversation accumulating in a background session rather than the intended main session.
When the next heartbeat tick fires, the Control UI swaps to a newer heartbeat sessionId, effectively clobbering the conversation view mid-chat.
Steps to Reproduce
- Configure session maintenance with aggressive pruning:
maintenance: { mode: "enforce", pruneAfter: "3d", maxEntries: 50 }
- Configure heartbeat with
isolatedSession: true, model: "anthropic/claude-haiku-4-5", lightContext: true, target unset (defaults to "none").
- Wait for daily session reset (or trigger prune) —
agent:main:main gets pruned from sessions.json.
- Heartbeat ticks continue to run, keeping
agent:main:main:heartbeat alive.
- Open Control UI webchat. Observe session picker.
- Type a user message in the chat input.
Expected Behavior
- The session picker should always surface
agent:main:main (or auto-create it if missing/pruned).
- Webchat input should be bound to the primary (
main:main) session by default.
- Heartbeat-suffixed sessions (
:heartbeat) should be hidden from the picker, or clearly labeled as "background" / read-only, so users cannot accidentally route input into them.
Actual Behavior
- Session picker only showed
main:heartbeat (no main:main).
- User typed messages; webchat routed input into
agent:main:main:heartbeat.
- Hours of human↔AI conversation accumulated in the heartbeat session.
- On the next heartbeat tick, Control UI swapped to a newer heartbeat sessionId, appearing to clobber the conversation view.
Environment
- OpenClaw version: 2026.4.27 (cbc2ba0)
- Channel: webchat (Control UI)
- Heartbeat config:
every: "1h", model: "anthropic/claude-haiku-4-5", lightContext: true, isolatedSession: true, target not set
- Session maintenance config (at time of issue):
mode: "enforce", pruneAfter: "3d", maxEntries: 50
Workaround
Relax session pruning so agent:main:main is never pruned (e.g., increase pruneAfter / maxEntries, or exempt the primary session from pruning rules).
Related Issues
Summary
When aggressive session pruning removes
agent:main:mainfrom sessions, the Control UI session picker no longer shows the primary session. Heartbeat ticks keepagent:main:main:heartbeatalive, so that becomes the only visible session in the picker. The webchat input then routes user messages directly into the heartbeat-suffixed session — resulting in human↔AI conversation accumulating in a background session rather than the intended main session.When the next heartbeat tick fires, the Control UI swaps to a newer heartbeat sessionId, effectively clobbering the conversation view mid-chat.
Steps to Reproduce
maintenance: { mode: "enforce", pruneAfter: "3d", maxEntries: 50 }isolatedSession: true,model: "anthropic/claude-haiku-4-5",lightContext: true,targetunset (defaults to"none").agent:main:maingets pruned from sessions.json.agent:main:main:heartbeatalive.Expected Behavior
agent:main:main(or auto-create it if missing/pruned).main:main) session by default.:heartbeat) should be hidden from the picker, or clearly labeled as "background" / read-only, so users cannot accidentally route input into them.Actual Behavior
main:heartbeat(nomain:main).agent:main:main:heartbeat.Environment
every: "1h",model: "anthropic/claude-haiku-4-5",lightContext: true,isolatedSession: true,targetnot setmode: "enforce",pruneAfter: "3d",maxEntries: 50Workaround
Relax session pruning so
agent:main:mainis never pruned (e.g., increasepruneAfter/maxEntries, or exempt the primary session from pruning rules).Related Issues
target: "last"skipping with no-target (related but distinct)