openclaw - 💡(How to fix) Fix memory-core dreaming cron may not auto-register on gateway startup [2 comments, 3 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#62327Fetched 2026-04-08 03:05:55
View on GitHub
Comments
2
Participants
3
Timeline
2
Reactions
0
Author
Timeline (top)
commented ×2

memory-core dreaming does not reliably auto-register its managed cron job on gateway startup.

In my environment, /dreaming was enabled and configured to run daily at 0 3 * * *, but no Memory Dreaming Promotion job was present in cron/jobs.json, so the nightly dreaming sweep never got registered automatically.

This appears to be caused by two upstream startup-path issues working together.

Root Cause

This appears to be caused by two upstream startup-path issues working together.

Code Example

clearInternalHooks();
const loadedCount = await loadInternalHooks(...);
RAW_BUFFERClick to expand / collapse

Summary

memory-core dreaming does not reliably auto-register its managed cron job on gateway startup.

In my environment, /dreaming was enabled and configured to run daily at 0 3 * * *, but no Memory Dreaming Promotion job was present in cron/jobs.json, so the nightly dreaming sweep never got registered automatically.

This appears to be caused by two upstream startup-path issues working together.

Version

Observed on openclaw 2026.4.5.

Expected behavior

When memory-core dreaming is enabled, gateway startup should ensure that the managed cron job exists:

  • name: Memory Dreaming Promotion
  • payload text: __openclaw_memory_core_short_term_promotion_dream__

This should happen automatically after gateway startup, without manual edits to cron/jobs.json.

Actual behavior

dreaming was enabled in config, but the managed cron job was missing from cron/jobs.json, so no automatic 03:00 dreaming run was scheduled.

Root cause analysis

1. memory-core may be excluded from startup plugin loading

In src/plugins/channel-plugin-ids.ts, resolveGatewayStartupPluginIds() does not appear to explicitly include enabled kind=memory plugins in the startup plugin set.

That means memory-core may not be loaded early enough for its startup reconciliation hook to run.

Source: https://raw.githubusercontent.com/openclaw/openclaw/main/src/plugins/channel-plugin-ids.ts

2. plugin startup hooks are cleared during sidecar startup

In src/gateway/server-startup.ts, startGatewaySidecars() still does:

clearInternalHooks();
const loadedCount = await loadInternalHooks(...);

But memory-core registers its dreaming reconcile logic through a plugin hook on gateway:startup.

So plugin hooks registered during plugin load can be wiped before the delayed gateway:startup event is triggered.

Source: https://raw.githubusercontent.com/openclaw/openclaw/main/src/gateway/server-startup.ts

Local confirmation

I confirmed locally that after:

  1. ensuring memory-core is included in startup plugin loading
  2. preventing the startup path from wiping plugin-registered hooks

the gateway logs began showing:

memory-core: created managed dreaming cron job.

and cron/jobs.json then contained the managed Memory Dreaming Promotion job with the expected next-run timestamp.

Suggested fix

One possible fix is:

  1. explicitly include enabled kind=memory plugins in resolveGatewayStartupPluginIds()
  2. avoid clearing plugin-registered internal hooks during startGatewaySidecars(), or separate dynamically loaded workspace hooks from plugin hooks so they are not wiped together

Notes

There are two separate layers here:

  • If gateway is not running at 03:00, the job obviously cannot execute.
  • But even when gateway is running, the managed dreaming cron may fail to auto-register because of the startup/plugin hook path above.

extent analysis

TL;DR

Modify resolveGatewayStartupPluginIds() to include enabled kind=memory plugins and prevent clearing plugin-registered internal hooks during startGatewaySidecars() to ensure memory-core dreaming auto-registers its managed cron job.

Guidance

  • Review src/plugins/channel-plugin-ids.ts to ensure resolveGatewayStartupPluginIds() includes kind=memory plugins in the startup plugin set.
  • Examine src/gateway/server-startup.ts to prevent clearing plugin-registered internal hooks during startGatewaySidecars(), possibly by separating dynamically loaded workspace hooks from plugin hooks.
  • Verify that the gateway logs show memory-core: created managed dreaming cron job. after applying the suggested fixes.
  • Check cron/jobs.json for the presence of the managed Memory Dreaming Promotion job with the expected next-run timestamp.

Example

No explicit code example is provided, but the suggested fix involves modifying the resolveGatewayStartupPluginIds() function and the startGatewaySidecars() function to address the startup path issues.

Notes

The issue has two separate layers: ensuring the gateway is running at the scheduled time and addressing the startup/plugin hook path issues. The suggested fix focuses on the latter.

Recommendation

Apply the workaround by modifying resolveGatewayStartupPluginIds() and startGatewaySidecars() to ensure memory-core dreaming auto-registers its managed cron job, as this approach directly addresses the identified root causes.

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

When memory-core dreaming is enabled, gateway startup should ensure that the managed cron job exists:

  • name: Memory Dreaming Promotion
  • payload text: __openclaw_memory_core_short_term_promotion_dream__

This should happen automatically after gateway startup, without manual edits to cron/jobs.json.

Still need to ship something?

×6

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

Back to top recommendations

TRENDING