Fix cron scheduler: recompute nextRunAtMs in status/list (#11192)#11253
Closed
zhangzhefang-github wants to merge 2 commits intoopenclaw:mainfrom
Closed
Fix cron scheduler: recompute nextRunAtMs in status/list (#11192)#11253zhangzhefang-github wants to merge 2 commits intoopenclaw:mainfrom
zhangzhefang-github wants to merge 2 commits intoopenclaw:mainfrom
Conversation
Member
SutanuNandigrami
pushed a commit
to SutanuNandigrami/openclaw
that referenced
this pull request
Feb 8, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fix: Cron scheduler nextWakeAtMs stuck at null (#11192)
Problem
Cron scheduler was not computing
nextRunAtMswhen callingstatus()orlist()without first callingstart(). This caused:nextWakeAtMs: nullin status outputcron listSolution
Added
recomputeNextRuns()call in bothstatus()andlist()functions to ensurenextRunAtMsis always computed before returning results.Testing
AI-Assisted
This PR was created with AI assistance (Claude). The fix has been reviewed and tested.
Related Issues
Fixes #11192
May also help with: #10955, #11059, #11013
Greptile Overview
Greptile Summary
This change updates the cron service read operations (
status()andlist()) to callrecomputeNextRuns(state)after loading the store. This ensuresnextRunAtMs(and derivednextWakeAtMs) is populated even if the scheduler hasn’t been started yet, preventingnextWakeAtMs: nulland empty/unsortedcron listoutputs when jobs exist but haven’t had their next run computed.Confidence Score: 5/5
nextRunAtMsfrom current time and job schedules. No API shape changes, no persistence changes, and no new dependencies were introduced.(3/5) Reply to the agent's comments like "Can you suggest a fix for this @greptileai?" or ask follow-up questions!