openclaw - ✅(Solved) Fix Memory dreaming managed cron job deleted on gateway restart but never recreated [1 pull requests, 3 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#64043Fetched 2026-04-11 06:16:28
View on GitHub
Comments
3
Participants
3
Timeline
8
Reactions
0
Timeline (top)
commented ×3cross-referenced ×3mentioned ×1subscribed ×1

Fix Action

Fix / Workaround

临时 Workaround

PR fix notes

PR #64076: fix(memory-core): retry dreaming cron reconciliation on startup

Description (problem / solution / changelog)

Summary

  • retry managed dreaming cron reconciliation during gateway startup when cron is still unavailable
  • stop retrying once the managed dreaming cron job is available, disabled, or otherwise no longer unavailable
  • add regression tests covering delayed cron readiness during gateway startup

Closes #64043

Testing

  • attempted:  ERR_PNPM_NO_IMPORTER_MANIFEST_FOUND  No package.json (or package.yaml, or package.json5) was found in "/root/.openclaw/workspace".
  • blocked locally in this worktree by
  • attempted direct follow-up validation, but this worktree does not have installed dev binaries (, , ), so I am sending this for CI verification

Notes

  • commit used because the worktree lacks local hook dependencies ( not found)

Changed files

  • extensions/memory-core/src/dreaming.test.ts (modified, +149/-0)
  • extensions/memory-core/src/dreaming.ts (modified, +82/-7)

Code Example

{
  "plugins": {
    "entries": {
      "memory-core": {
        "enabled": true,
        "config": {
          "dreaming": {
            "enabled": true
          }
        }
      }
    }
  }
}

---

2026-04-08T12:05:45.239+08:00 [plugins] memory-core: created managed dreaming cron job.
2026-04-08T12:25:01.499+08:00 [plugins] memory-core: removed 1 managed dreaming cron job(s).
# 之后无 "created" 日志
RAW_BUFFERClick to expand / collapse

Bug 描述

标题: Memory dreaming managed cron job deleted on gateway restart but never recreated

问题描述:

memory-core 的 dreaming 功能通过 gateway:startup hook 自动创建 managed cron job。但每次 gateway 重启时,该 cron job 会被删除,随后未能重建。

复现步骤

  1. 启用 dreaming 配置:
{
  "plugins": {
    "entries": {
      "memory-core": {
        "enabled": true,
        "config": {
          "dreaming": {
            "enabled": true
          }
        }
      }
    }
  }
}
  1. 启动/重启 gateway
  2. 观察:首次启动时 dreaming cron 成功创建(日志:memory-core: created managed dreaming cron job.)
  3. 重启 gateway
  4. 观察:日志显示 memory-core: removed 1 managed dreaming cron job(s).,但没有 created 日志

根因分析

extensions/memory-core/src/dreaming.tsresolveCronServiceFromStartupSource() 依赖 gateway:startup 事件中的 context.crondeps.cron 来获取 cron service。如果 startup 时 cron service 尚未就绪,函数返回 null,reconcileShortTermDreamingCronJob 跳过创建。

关键代码路径:

  1. registerShortTermPromotionDreaming 注册 gateway:startup hook
  2. startup hook 调用 reconcileManagedDreamingCron({ reason: "startup" })
  3. resolveCronServiceFromStartupSource(startupCronSource) 返回 null
  4. reconcileShortTermDreamingCronJob({ cron: null, ... }) 返回 { status: "unavailable" }
  5. 未创建 cron job

环境信息

  • OpenClaw 版本:2026.4.5 和 2026.4.9 均复现
  • OS:macOS Darwin 25.3.0 (arm64)
  • Node.js:v25.8.0

日志证据

2026-04-08T12:05:45.239+08:00 [plugins] memory-core: created managed dreaming cron job.
2026-04-08T12:25:01.499+08:00 [plugins] memory-core: removed 1 managed dreaming cron job(s).
# 之后无 "created" 日志

重启多次(包括升级到 2026.4.9 后)均复现相同行为。

临时 Workaround

通过 HEARTBEAT.md 检查 + openclaw cron add 手动补建,每次 heartbeat 验证 cron 是否存在。

extent analysis

TL;DR

The issue can be temporarily worked around by manually adding the missing cron job using openclaw cron add after each gateway restart.

Guidance

  • Verify that the dreaming configuration is enabled in the memory-core plugin settings.
  • Check the logs for the presence of memory-core: created managed dreaming cron job. after a gateway restart to confirm if the cron job is being recreated.
  • Use the openclaw cron add command to manually add the missing cron job as a temporary workaround.
  • Consider reviewing the resolveCronServiceFromStartupSource() function in extensions/memory-core/src/dreaming.ts to understand why it returns null after a gateway restart.

Example

No code snippet is provided as the issue does not require a code change, but rather a temporary workaround.

Notes

The root cause of the issue seems to be related to the resolveCronServiceFromStartupSource() function returning null after a gateway restart, causing the cron job to not be recreated. The temporary workaround using openclaw cron add can help mitigate the issue, but a permanent fix would require addressing the underlying cause.

Recommendation

Apply the temporary workaround using openclaw cron add to manually add the missing cron job after each gateway restart, as a permanent fix is not available at this time. This will ensure that the cron job is present and functional until a more permanent solution can be implemented.

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