Skip to content

[Bug]: Heartbeat isolatedSession: true does not create fresh sessions #56941

Description

@yubingjiaocn

isolatedSession: true does not actually isolate heartbeat sessions

Related: #51542 (locked)

Environment

  • OpenClaw 2026.3.28 (f9b1079)
  • Linux 6.17.0-1009-aws (x64), Node 24.14.0

Config

{
  "heartbeat": {
    "every": "30m",
    "target": "last",
    "directPolicy": "allow",
    "isolatedSession": true
  }
}

Observed behavior

  • A heartbeat session created on 2026-03-27 was reused continuously for 2+ days (543 JSONL entries, same session ID 97ba1b61-*)
  • HEARTBEAT.md was updated on 2026-03-29 05:07 UTC (changed "B站UP主" → "微博博主"), but the heartbeat kept outputting the old text from the cached system prompt
  • The session contained 111 references to the old text and 0 references to the updated text
  • Gateway restart (new PID) did not create a fresh session — the old one was loaded from persistent storage

Expected behavior

Per docs: isolatedSession: true should provide "fresh session each run (no conversation history)". Each heartbeat tick should:

  1. Create a new session
  2. Re-read HEARTBEAT.md into the system prompt
  3. Not carry over context from previous heartbeat runs

Workaround

Manually delete the session file + remove heartbeat keys from sessions.json:

rm ~/.openclaw/agents/<agent>/sessions/<session-id>.jsonl
# + remove heartbeat session entries from sessions.json

Root cause hypothesis

isolatedSession: true is either:

  1. Not being checked when deciding whether to reuse an existing heartbeat session, or
  2. The isolation logic creates a "new" session but restores from persistent storage using the same session key, negating isolation

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    Priority

    None yet

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions