openclaw - ✅(Solved) Fix [Bug]: cron systemEvent payload.text lost in main-session handoff — agent receives bare heartbeat poll without payload (regression from 4.25 transient runtime context) [1 pull requests, 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#73189Fetched 2026-04-29 06:22:20
View on GitHub
Comments
0
Participants
1
Timeline
2
Reactions
0
Participants
Timeline (top)
cross-referenced ×2

Cron jobs with sessionTarget: "main" + payload.kind: "systemEvent" fire on schedule but the payload.text is not injected into the session context. The agent only receives a bare [OpenClaw heartbeat poll] with no actual system event payload, resulting in "ghost runs" — the cron run records status: ok but the intended prompt never reaches the agent.

Error Message

  • #72677 — "fix(cron): warn on main heartbeat handoff ghost runs" — attempted fix (adds ghost-run detection), but not merged
  • No error or warning is surfaced — runs look successful in the cron dashboard

Root Cause

Likely Root Cause

PR fix notes

PR #72677: fix(cron): warn on main heartbeat handoff ghost runs

Description (problem / solution / changelog)

Fixes #63106.

Summary

  • add a scoped warning for fast ok main-session systemEvent jobs using wakeMode=next-heartbeat
  • annotate cron run logs with possible-main-next-heartbeat-ghost-run for that handoff path
  • add cron.ghostRunWarningThresholdMs config with schema/help metadata

Tests

  • node --no-maglev node_modules/vitest/vitest.mjs run --config test/vitest/vitest.gateway.config.ts src/gateway/server-cron.test.ts
  • node --no-maglev node_modules/vitest/vitest.mjs run --config test/vitest/vitest.config.ts src/config/zod-schema.cron-retention.test.ts src/config/schema.base.generated.test.ts src/config/schema.help.quality.test.ts src/cron/run-log.test.ts
  • node --import tsx scripts/generate-base-config-schema.ts --check
  • node_modules/.bin/oxlint --tsconfig tsconfig.oxlint.core.json src/gateway/server-cron.ts src/gateway/server-cron.test.ts src/config/types.cron.ts src/config/zod-schema.ts src/config/schema.help.ts src/config/schema.labels.ts src/cron/run-log.ts

Note: local tsgo checks currently fail before this change on unrelated dependency/type issues (missing typebox and existing model compat errors).

Changed files

  • src/config/schema.base.generated.ts (modified, +13/-0)
  • src/config/schema.help.ts (modified, +2/-0)
  • src/config/schema.labels.ts (modified, +1/-0)
  • src/config/types.cron.ts (modified, +5/-0)
  • src/config/zod-schema.ts (modified, +1/-0)
  • src/cron/run-log.ts (modified, +10/-0)
  • src/gateway/server-cron.test.ts (modified, +115/-0)
  • src/gateway/server-cron.ts (modified, +66/-1)

Code Example

{
  "sessionTarget": "main",
  "wakeMode": "now",
  "payload": {
    "kind": "systemEvent",
    "text": "💕 Some system event text here"
  }
}

---

'[OpenClaw heartbeat poll]'   ← payload.text missing!

---

prompt: '[OpenClaw heartbeat poll]'
messages: [18 prior chat messages, no system event]
RAW_BUFFERClick to expand / collapse

Summary

Cron jobs with sessionTarget: "main" + payload.kind: "systemEvent" fire on schedule but the payload.text is not injected into the session context. The agent only receives a bare [OpenClaw heartbeat poll] with no actual system event payload, resulting in "ghost runs" — the cron run records status: ok but the intended prompt never reaches the agent.

Environment

  • OpenClaw 2026.4.26 (be8c246) (also reproduces on 4.25)
  • Linux (WSL2 Ubuntu, Node v24.14.0)
  • Cron job: sessionTarget: "main", payload.kind: "systemEvent", wakeMode: "now"

Steps to Reproduce

  1. Create a cron job targeting the main session with a system event payload:
{
  "sessionTarget": "main",
  "wakeMode": "now",
  "payload": {
    "kind": "systemEvent",
    "text": "💕 Some system event text here"
  }
}
  1. Wait for the cron to fire, or trigger it manually with cron run

  2. Check the session trajectory (trajectory.jsonl) at the corresponding timestamp

  3. Observe prompt.submitted.data.prompt:

'[OpenClaw heartbeat poll]'   ← payload.text missing!
  1. The messages array contains only prior chat history — no system message with payload.text

Actual Behavior

The session trajectory at prompt.submitted shows:

prompt: '[OpenClaw heartbeat poll]'
messages: [18 prior chat messages, no system event]

The cron's payload.text is entirely absent from the compiled session prompt. The cron run log says status: "ok" but the agent never sees the intended system event.

Expected Behavior

The cron's payload.text should be injected into the session context as a system-level message (or equivalent), so the agent can act on the cron's instructions.

Evidence

From the trajectory JSONL (prompt.submitted entry for a cron-triggered session run):

  • data.prompt = "[OpenClaw heartbeat poll]" (bare tag, no payload)
  • data.systemPrompt = (SOUL.md, AGENTS.md, etc. — no cron text)
  • data.messages = 18 conversation history messages only
  • channel = cron-event (correctly identified)

Meanwhile cron runs correctly shows the full payload.text in the run summary — so the cron service has the text, but it doesn't survive the handoff to the session.

Likely Root Cause

The 4.25 changelog entry:

"Agents/runtime: submit heartbeat, cron, and exec wakeups as transient runtime context instead of visible user prompts, keeping synthetic system work out of chat transcripts. Fixes #66496 and #66814."

This change moved cron/heartbeat wakeups from visible user prompts to "transient runtime context", which appears to have broken the injection pipeline for payload.text. The text is held by the cron scheduler (visible in run summaries) but never reaches the session prompt compilation.

Related Issues/PRs

  • #63106 — "cron: ghost runs recorded as ok when gateway is down" — describes the same symptom (systemEvent silently dropped) from a different angle (gateway down)
  • #72677 — "fix(cron): warn on main heartbeat handoff ghost runs" — attempted fix (adds ghost-run detection), but not merged
  • #73149 — "Cron/heartbeat no-op runs can leak visible messages" — related (no-op handling), different angle

Impact

  • Cron-based system events for the main session are effectively broken since 4.25
  • Workflows depending on cron system events (reminders, scheduled prompts, heartbeat-driven actions) silently fail
  • No error or warning is surfaced — runs look successful in the cron dashboard

extent analysis

TL;DR

The cron job's payload.text is not being injected into the session context due to a change in how cron wakeups are submitted, and a workaround may involve modifying the cron job configuration or the session prompt compilation logic.

Guidance

  • Review the changelog entry for version 4.25 to understand the changes made to cron wakeups and how they might be affecting the injection of payload.text.
  • Investigate the trajectory.jsonl file to see if there are any clues about what is happening to the payload.text during the session prompt compilation process.
  • Consider modifying the cron job configuration to use a different wakeMode or sessionTarget to see if that resolves the issue.
  • Look into the related issues and PRs (e.g. #63106, #72677, #73149) to see if they provide any insight or potential fixes for this problem.

Example

No code snippet is provided as the issue is more related to configuration and workflow rather than a specific code problem.

Notes

The root cause of the issue seems to be related to the change in how cron wakeups are submitted, and it's not clear if this is a bug or an intended behavior. More investigation is needed to determine the best course of action.

Recommendation

Apply a workaround by modifying the cron job configuration or the session prompt compilation logic, as it's not clear if there is a fixed version that resolves this issue. The reason is that the change in cron wakeups seems to be the root cause, and a workaround might be necessary until a proper fix is available.

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 - ✅(Solved) Fix [Bug]: cron systemEvent payload.text lost in main-session handoff — agent receives bare heartbeat poll without payload (regression from 4.25 transient runtime context) [1 pull requests, 1 participants]