Skip to content

Heartbeat stops firing after context compression #2935

@mkoslacz

Description

@mkoslacz

Problem

Heartbeat configured in agents.defaults.heartbeat stops firing after context compression occurs.

Config

"heartbeat": {
  "every": "30m",
  "activeHours": {
    "start": "07:00",
    "end": "23:00",
    "timezone": "Europe/Warsaw"
  },
  "target": "telegram",
  "to": "8029162297"
}

Symptoms

  1. Heartbeat works fine initially ([heartbeat] started in logs)
  2. After context compression (due to token limits), heartbeat stops
  3. Logs show: No session found: telegram:8029162297
  4. No more heartbeat polls until gateway restart

Expected Behavior

Heartbeat should continue working after context compression by:

  1. Creating a new session if the previous one doesn't exist
  2. Or maintaining heartbeat polling independent of session state

Logs

2026-01-27T18:53:16.080Z [heartbeat] started
# ... context compression happens ...
2026-01-27T19:18:09.517Z [ws] ⇄ res ✗ sessions.resolve errorMessage=No session found: telegram:8029162297
# ... no more heartbeat polls until manual restart ...

Workaround

Manual gateway restart (gateway action=restart) brings heartbeat back.

Environment

  • Clawdbot: 2026.1.24-3
  • OS: macOS Darwin 24.6.0
  • Channel: Telegram

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions