openclaw - 💡(How to fix) Fix Feature Request: Heartbeat should only fire when session is idle [1 participants]

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…
GitHub stats
openclaw/openclaw#59567Fetched 2026-04-08 02:43:06
View on GitHub
Comments
0
Participants
1
Timeline
1
Reactions
1
Participants
Timeline (top)
cross-referenced ×1

Fix Action

Fix / Workaround

Current Workaround

Code Example

{
  "heartbeat": {
    "every": "5m",
    "idleOnly": true
  }
}

---

{
  "heartbeat": {
    "every": "5m",
    "triggerWhen": "idle"
  }
}
RAW_BUFFERClick to expand / collapse

Problem

The heartbeat mechanism fires on a fixed interval (e.g. every 5 minutes) regardless of whether the user is actively chatting or not. This means:

  • During active conversations, the heartbeat injects a system prompt into the main session, interrupting the user's conversation flow
  • The heartbeat always shows up as a message in the chat history
  • This makes the agent feel mechanical - one question, one answer, then a heartbeat message appears

Use Case

Users want to use the heartbeat to enable intelligent context follow-up:

  • Checking for unfinished tasks
  • Remembering what the user asked about earlier
  • Proactively continuing research or reminders
  • The goal is to overcome the mechanical Q&A pattern

But the current behavior interrupts active sessions, making it unsuitable.

Proposed Solution

Add an option to make heartbeat trigger only when the session is idle/inactive:

Option 1 - Simple flag:

{
  "heartbeat": {
    "every": "5m",
    "idleOnly": true
  }
}

Option 2 - Trigger condition:

{
  "heartbeat": {
    "every": "5m",
    "triggerWhen": "idle"
  }
}

The agent would only receive the heartbeat prompt after the session has been silent for some time.

Benefits

  1. No interruption during active conversations
  2. Enables proactive context follow-up without disturbing the user
  3. Makes the agent feel more continuous and intelligent
  4. Combines background intelligence with main session context awareness

Current Workaround

Using isolated cron jobs (e.g. running in separate sessions) can avoid interrupting the conversation, but those can't actively follow up in the main conversation context - they can only passively record. The heartbeat running in the main session has full context awareness, which is what we need for intelligent follow-up.

extent analysis

TL;DR

Implement an "idleOnly" or "triggerWhen" option for the heartbeat mechanism to prevent interruptions during active conversations.

Guidance

  • Consider adding a flag or trigger condition to the heartbeat configuration to enable idle-only triggering, as proposed in the issue.
  • Evaluate the benefits of implementing this change, including reduced interruptions, improved context follow-up, and enhanced agent intelligence.
  • Assess the current workaround using isolated cron jobs and determine if the proposed solution provides sufficient advantages to warrant implementation.
  • Test the new heartbeat behavior with various conversation scenarios to ensure it meets the desired use case requirements.

Example

{
  "heartbeat": {
    "every": "5m",
    "idleOnly": true
  }
}

This example illustrates the proposed "idleOnly" flag, which can be used to configure the heartbeat mechanism.

Notes

The proposed solution assumes that the heartbeat mechanism can be modified to support idle-only triggering. The effectiveness of this solution depends on the specific implementation and the ability to accurately detect idle sessions.

Recommendation

Apply the workaround by implementing the "idleOnly" or "triggerWhen" option, as it provides a more integrated and context-aware solution for intelligent follow-up compared to using isolated cron jobs.

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING

openclaw - 💡(How to fix) Fix Feature Request: Heartbeat should only fire when session is idle [1 participants]