#Heartbeat session

9 messages · Page 1 of 1 (latest)

hushed crow
#

If I set heartbeat.session=agent:main:discord:direct:XXX, will it get all the context of the session when fired? or will it still be isolated

pulsar boughBOT
swift canyonBOT
#

To help others find answers, you can mark your question as solved via Right click solution message -> Apps -> âś… Mark Solution

pulsar boughBOT
oblique merlinBOT
#

If heartbeat.isolatedSession is false (the default), then heartbeat.session = agent:main:discord:direct:XXX makes the heartbeat run in that session, so it uses that session’s transcript/context.

If heartbeat.isolatedSession is true, it is still isolated. In that case OpenClaw creates a fresh sibling session with a :heartbeat suffix, so it does not reuse the full conversation history.

A couple of gotchas:

  • session changes the run context, not the delivery target.
  • Use the exact canonical session key from openclaw sessions --json, because DM/session shape depends on your session.dmScope config.
  • Subagent session keys are ignored and fall back to main.

Docs:

If you want, I can show the exact config for “reuse this DM’s context” vs “same DM, but cheap isolated heartbeat.”

hushed crow
#

so if the heartbeat runs in the same session and responds, later when agent resume the session it will know full context of recent responds?

oblique merlinBOT
#

Yes, if the heartbeat runs in the same non-isolated session, its turn becomes part of that session history.

So later, when the agent continues that same session, it can see those heartbeat turns too, subject to the normal limits:

  • session reset/new session = old context not automatically carried over
  • compaction/trimming can summarize or drop older details over time
  • HEARTBEAT_OK-only acks are treated specially, so those are not useful context

So the short version is:

  • same heartbeat.session + isolatedSession: false → shared context
  • isolatedSession: true → separate heartbeat context
  • same session later resumes → it will know the heartbeat replies, as long as it’s still that same session

Docs: https://docs.openclaw.ai/gateway/heartbeat and https://docs.openclaw.ai/concepts/session

hushed crow
#

possible to have 2 versions of heartbeat, 1 isolated, 1 continuing, for 1 agent?

oblique merlinBOT
#

Not as two native heartbeat configs on one agent, no.

Heartbeat is a single config block per agent, so for one agent you effectively get one heartbeat mode at a time.

If you want both behaviors, the usual options are:

  1. One agent + heartbeat + cron

    • use heartbeat for the continuing/shared-context checks
    • use cron for the isolated checks
  2. Two agents

    • one agent with shared heartbeat
    • one agent with isolated heartbeat

If you want both on the same agent, I’d recommend heartbeat + cron. That’s the cleanest fit, and cron is the thing meant for separate isolated runs.

Docs: