openclaw - 💡(How to fix) Fix requestHeartbeat with intent: "immediate" does not wake idle agent

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…

When calling requestHeartbeat with intent: "immediate" from a plugin runtime API, the heartbeat does not fire an agent turn when the system has been idle. The system event is correctly enqueued, but the wake is not delivered until the next scheduled heartbeat or external user message.

Error Message

Gateway logs at the time of the wake attempt:

05:18:44+00:00 error [openclaw-voice-bridge] Resolved OpenAI key via modelAuth (source: profile:openai:default)
05:18:46+00:00 error [openclaw-voice-bridge] Transcript: "What is your worst memory?"
05:18:46+00:00 error [openclaw-voice-bridge] Enqueued system event via runtime API
05:18:46+00:00 error [openclaw-voice-bridge] requestHeartbeat called
05:18:46+00:00 error [openclaw-voice-bridge] /hooks/wake response: 200 {"ok":true,"mode":"now"}

No agent turn processed between 05:18 and 05:26 (7+ minute gap). The voice input was only processed at 05:26 when a manual user message triggered a turn.

Root Cause

When calling requestHeartbeat with intent: "immediate" from a plugin runtime API, the heartbeat does not fire an agent turn when the system has been idle. The system event is correctly enqueued, but the wake is not delivered until the next scheduled heartbeat or external user message.

Fix Action

Workaround

Reducing heartbeat.every to a shorter interval (e.g., 2-5 minutes) reduces the delay, but does not fix the underlying issue that intent: "immediate" does not work as documented.

Code Example

api.runtime.system.enqueueSystemEvent("🎤 Voice input: test", { sessionKey: "main:main" });
api.runtime.system.requestHeartbeat({
  source: "hook",
  intent: "immediate",
  reason: "voice-input",
  sessionKey: "main:main",
  heartbeat: { target: "last" },
});

---

05:18:44+00:00 error [openclaw-voice-bridge] Resolved OpenAI key via modelAuth (source: profile:openai:default)
05:18:46+00:00 error [openclaw-voice-bridge] Transcript: "What is your worst memory?"
05:18:46+00:00 error [openclaw-voice-bridge] Enqueued system event via runtime API
05:18:46+00:00 error [openclaw-voice-bridge] requestHeartbeat called
05:18:46+00:00 error [openclaw-voice-bridge] /hooks/wake response: 200 {"ok":true,"mode":"now"}
RAW_BUFFERClick to expand / collapse

Description

When calling requestHeartbeat with intent: "immediate" from a plugin runtime API, the heartbeat does not fire an agent turn when the system has been idle. The system event is correctly enqueued, but the wake is not delivered until the next scheduled heartbeat or external user message.

Environment

  • OpenClaw 2026.5.18 (50a2481)
  • Running on Raspberry Pi (arm64)
  • Main agent: ollama/glm-5.1:cloud
  • Heartbeat config: agents.defaults.heartbeat.every: "30m", target: "last"

Reproduction

  1. Plugin calls:
api.runtime.system.enqueueSystemEvent("🎤 Voice input: test", { sessionKey: "main:main" });
api.runtime.system.requestHeartbeat({
  source: "hook",
  intent: "immediate",
  reason: "voice-input",
  sessionKey: "main:main",
  heartbeat: { target: "last" },
});
  1. Also calls /hooks/wake with { text, mode: "now" } as redundancy — both return success
  2. /hooks/wake returns {"ok":true,"mode":"now"}
  3. No agent turn fires for 7+ minutes until next scheduled heartbeat or manual user message

Expected behavior

requestHeartbeat with intent: "immediate" should trigger an agent turn within ~250ms (the default coalescence window).

Actual behavior

The system event sits in the queue and is not processed until the next scheduled heartbeat (30 min) or an external message triggers a turn.

Logs

Gateway logs at the time of the wake attempt:

05:18:44+00:00 error [openclaw-voice-bridge] Resolved OpenAI key via modelAuth (source: profile:openai:default)
05:18:46+00:00 error [openclaw-voice-bridge] Transcript: "What is your worst memory?"
05:18:46+00:00 error [openclaw-voice-bridge] Enqueued system event via runtime API
05:18:46+00:00 error [openclaw-voice-bridge] requestHeartbeat called
05:18:46+00:00 error [openclaw-voice-bridge] /hooks/wake response: 200 {"ok":true,"mode":"now"}

No agent turn processed between 05:18 and 05:26 (7+ minute gap). The voice input was only processed at 05:26 when a manual user message triggered a turn.

Additional context

  • The requests-in-flight skip reason should be retryable (1s retry), but no retry wake was observed
  • Three other agents were previously crashing with model errors and blocking lanes — fixed, but the wake failure persisted even after those were resolved
  • Gateway was freshly restarted (~4 min before the wake attempt) when the 7-minute delay was observed
  • The setHeartbeatWakeHandler appears to be set (the gateway processes scheduled heartbeats normally)
  • No stuck running=true state was found in session data

Workaround

Reducing heartbeat.every to a shorter interval (e.g., 2-5 minutes) reduces the delay, but does not fix the underlying issue that intent: "immediate" does not work as documented.

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…

FAQ

Expected behavior

requestHeartbeat with intent: "immediate" should trigger an agent turn within ~250ms (the default coalescence window).

Still need to ship something?

×6

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

Back to top recommendations

TRENDING