Skip to content

fix(memory-core): suppress false cron unavailable warning on startup - #69983

Closed
Noor-ul-ain001 wants to merge 11 commits into
openclaw:mainfrom
Noor-ul-ain001:fix/memory-core-startup-cron-warning-upstream
Closed

Noor-ul-ain001 wants to merge 11 commits into
openclaw:mainfrom
Noor-ul-ain001:fix/memory-core-startup-cron-warning-upstream

Conversation

@Noor-ul-ain001

Copy link
Copy Markdown

Summary

  • Suppresses the false "cron service unavailable" warning that fires on every gateway startup for 3-5 minutes
  • Root cause: reconcileManagedDreamingCron() fires on gateway:startup before deps.cron is attached (250ms deferred init race)
  • Fix: added params.reason !== "startup" guard so the warning only fires for genuine runtime unavailability

Test plan

  • Gateway starts with no false cron warning in logs
  • Warning still appears if cron is genuinely unavailable at runtime
  • Cron job runs on schedule as before
  • All existing tests pass: pnpm test

Fixes #69939

🤖 Generated with Claude Code

Noor-ul-ain001 and others added 10 commits April 21, 2026 13:38
…agments

The U+FE0F variation selector on 🎙️ and 🖼️ caused markdownlint MD051
to reject the ToC anchor links. Stripping the selector makes the slug
generation consistent with the other emoji headings.

Co-Authored-By: Claude Sonnet 4.6 <[email protected]>
…startup

The reconcileManagedDreamingCron() fires on gateway:startup before
deps.cron is attached due to a 250ms setTimeout in server.impl.
Cron is always available within seconds — the warning is a false positive.
Suppress the warning when called from the startup hook.

Fixes openclaw#69939

Co-Authored-By: Claude Sonnet 4.6 <[email protected]>
…n-warning

fix(memory-core): suppress false cron unavailable warning on startup
@greptile-apps

greptile-apps Bot commented Apr 22, 2026 •

Copy link
Copy Markdown
Contributor

Greptile Summary

This PR suppresses the false "cron service unavailable" warning emitted on gateway startup by adding a params.reason !== "startup" guard to the outer condition in reconcileManagedDreamingCron. The README.md changes are a content/formatting refresh.

  • The outer guard does successfully prevent the warning from firing on startup, but the inner if (params.reason === \"startup\") debug-log branch (lines 726-729) is unreachable dead code because the outer condition already excludes reason === \"startup\". The intended debug message will never be logged.

Confidence Score: 3/5

The PR achieves its stated goal (warning suppressed on startup), but contains a dead-code bug that should be fixed before merging.

There is a clear P1 dead-code defect: the inner if (params.reason === "startup") branch is structurally unreachable because the outer condition already filters it out. The debug log the comment promises will never fire, which is a correctness issue in the implementation even though the user-visible behavior (no false warning) happens to be correct.

extensions/memory-core/src/dreaming.ts — the reconcileManagedDreamingCron inner if-else block at lines 720-736.

Comments Outside Diff (1)

  1. extensions/memory-core/src/dreaming.ts, line 720-736 (link)

    P1 Dead code — inner startup branch is unreachable

    The outer if already requires params.reason !== "startup" (line 720), so the inner if (params.reason === "startup") on line 726 can never be true. The api.logger.debug?.() call is dead code and will never execute.

    The warning suppression itself works (the outer guard achieves that), but the intended debug log for the startup path is silently dropped. The fix should restructure the condition so the startup branch is reachable:

    if (!cron && config.enabled && !unavailableCronWarningEmitted) {
      if (params.reason === "startup") {
        api.logger.debug?.(
          "memory-core: cron service not yet available at gateway:startup; deferring to runtime reconciliation.",
        );
      } else {
        api.logger.warn(
          "memory-core: managed dreaming cron could not be reconciled (cron service unavailable).",
        );
        unavailableCronWarningEmitted = true;
      }
    }
    Prompt To Fix With AI
    This is a comment left during a code review.
    Path: extensions/memory-core/src/dreaming.ts
    Line: 720-736
    
    Comment:
    **Dead code — inner `startup` branch is unreachable**
    
    The outer `if` already requires `params.reason !== "startup"` (line 720), so the inner `if (params.reason === "startup")` on line 726 can never be `true`. The `api.logger.debug?.()` call is dead code and will never execute.
    
    The warning suppression itself works (the outer guard achieves that), but the intended debug log for the startup path is silently dropped. The fix should restructure the condition so the startup branch is reachable:
    
    ```typescript
    if (!cron && config.enabled && !unavailableCronWarningEmitted) {
      if (params.reason === "startup") {
        api.logger.debug?.(
          "memory-core: cron service not yet available at gateway:startup; deferring to runtime reconciliation.",
        );
      } else {
        api.logger.warn(
          "memory-core: managed dreaming cron could not be reconciled (cron service unavailable).",
        );
        unavailableCronWarningEmitted = true;
      }
    }
    ```
    
    How can I resolve this? If you propose a fix, please make it concise.
Prompt To Fix All With AI
This is a comment left during a code review.
Path: extensions/memory-core/src/dreaming.ts
Line: 720-736

Comment:
**Dead code — inner `startup` branch is unreachable**

The outer `if` already requires `params.reason !== "startup"` (line 720), so the inner `if (params.reason === "startup")` on line 726 can never be `true`. The `api.logger.debug?.()` call is dead code and will never execute.

The warning suppression itself works (the outer guard achieves that), but the intended debug log for the startup path is silently dropped. The fix should restructure the condition so the startup branch is reachable:

```typescript
if (!cron && config.enabled && !unavailableCronWarningEmitted) {
  if (params.reason === "startup") {
    api.logger.debug?.(
      "memory-core: cron service not yet available at gateway:startup; deferring to runtime reconciliation.",
    );
  } else {
    api.logger.warn(
      "memory-core: managed dreaming cron could not be reconciled (cron service unavailable).",
    );
    unavailableCronWarningEmitted = true;
  }
}
```

How can I resolve this? If you propose a fix, please make it concise.

Reviews (1): Last reviewed commit: "Merge pull request #1 from Noor-ul-ain00..." | Re-trigger Greptile

…ing entirely

The outer guard `params.reason !== "startup"` was preventing the inner
if/else branch from executing, which meant the debug-level log on the
startup path never fired. Remove the redundant outer guard so the inner
startup vs runtime branching works correctly.

Fixes openclaw#69939

Co-Authored-By: Claude Sonnet 4.6 <[email protected]>
@prtags

prtags Bot commented Apr 23, 2026

Copy link
Copy Markdown

Related work from PRtags group witty-dane-m34j

Title: Open PR duplicate: memory-core startup cron warning suppression

Number Title
#69941 fix(memory-core): suppress startup "cron service unavailable" warning (closes #69939)
#69983* fix(memory-core): suppress false cron unavailable warning on startup

* This PR

@vincentkoc vincentkoc added dedupe:child Duplicate issue/PR child in dedupe cluster close:not-planned PR close reason labels Apr 25, 2026
@vincentkoc vincentkoc self-assigned this Apr 25, 2026
@vincentkoc

Copy link
Copy Markdown
Member

Thanks for the report/work here. This PR is not mergeable as-is: the title/body describe a memory-core runtime fix, but the current diff is a large README rewrite and no longer contains the implicated memory-core change.

Closing this as stale/noise for this cleanup pass. A focused PR that only changes the memory-core startup warning path would be reviewable separately.

@vincentkoc

Copy link
Copy Markdown
Member

Closed during maintainer cleanup; see the preceding comment for the specific reason.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

close:not-planned PR close reason dedupe:child Duplicate issue/PR child in dedupe cluster size: L

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Bug: memory-core logs 'cron service unavailable' on every gateway startup (2026.4.20)

2 participants