openclaw - 💡(How to fix) Fix Transfer pending system event entries across isolated heartbeat session boundary [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#72394Fetched 2026-04-27 05:30:33
View on GitHub
Comments
0
Participants
1
Timeline
0
Reactions
0
Author
Participants

When heartbeat.isolatedSession: true is enabled, the heartbeat runner uses a separate :heartbeat session key for the model run. Pending system event entries enqueued on the base direct session are not transferred to the isolated session.

Root Cause

…but neither path transfers the system event entries themselves. The prompt builders work today because the heartbeat preflight reads pending events from the base session and either inlines them into the prompt body or detects them for branching.

Code Example

cronSession.store[isolatedSessionKey] = cronSession.sessionEntry;
RAW_BUFFERClick to expand / collapse

Summary

When heartbeat.isolatedSession: true is enabled, the heartbeat runner uses a separate :heartbeat session key for the model run. Pending system event entries enqueued on the base direct session are not transferred to the isolated session.

Asymmetry with cron path

The cron path already transfers the session entry across the boundary:

cronSession.store[isolatedSessionKey] = cronSession.sessionEntry;

…but neither path transfers the system event entries themselves. The prompt builders work today because the heartbeat preflight reads pending events from the base session and either inlines them into the prompt body or detects them for branching.

Why this is latent today

The only current consumer of peekSystemEventEntries(runSessionKey) on the isolated session is the trust-flag check at the post-isolation block. No current code path reads exec or cron event content on the isolated session.

Why it should be fixed eventually

Future features (audit logs, delivery context enrichment, dreaming triggers, additional heartbeat reasons) that read system events on the active session key will see an empty set on isolated sessions for events that were queued on the base session. The next maintainer who builds on peekSystemEventEntries will hit this without warning.

Proposed fix shape

Two viable options:

  1. Mirror the cron entry-transfer pattern: explicitly clone or move pending system event entries from the base session to the isolated session inside the useIsolatedSession block, before the model run.
  2. Restructure event consumption so the isolated-session run reads from the base session for events queued before isolation.

Option 1 is closer to the existing cron pattern. Option 2 has cleaner consumption semantics but a larger blast radius.

Linked

Companion narrow fix: forthcoming PR inlines exec event text into the wake prompt and adds a breadcrumb comment that links here.

extent analysis

TL;DR

To fix the issue, either mirror the cron entry-transfer pattern by cloning pending system event entries from the base session to the isolated session or restructure event consumption to read from the base session for events queued before isolation.

Guidance

  • Identify the useIsolatedSession block and consider adding code to explicitly clone or move pending system event entries from the base session to the isolated session before the model run.
  • Evaluate the trade-offs between the two proposed fix options, considering the existing cron pattern and the potential blast radius of changing event consumption semantics.
  • Review the companion narrow fix PR to understand how inlining exec event text into the wake prompt may impact the overall solution.
  • Test any proposed fix to ensure that system event entries are correctly transferred or read from the base session.

Example

// Example of mirroring the cron entry-transfer pattern
useIsolatedSession(runSessionKey) {
  // Clone pending system event entries from base session to isolated session
  const baseSessionEventEntries = peekSystemEventEntries(baseSessionKey);
  baseSessionEventEntries.forEach((eventEntry) => {
    storeSystemEventEntry(isolatedSessionKey, eventEntry);
  });
  // ... rest of the model run code
}

Notes

The choice between the two proposed fix options depends on the specific requirements and constraints of the system, including performance, complexity, and maintainability considerations.

Recommendation

Apply workaround by mirroring the cron entry-transfer pattern, as it is closer to the existing cron pattern and may have a smaller blast radius.

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