feat(cron): split jobs.json into config and runtime state files#63105
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 55e02618eb
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
Greptile SummaryThis PR splits The three previously-flagged concerns (state-path derivation for non- Confidence Score: 5/5Safe to merge — logic is sound, all three prior P1/P2 concerns are resolved, and the one remaining issue is a minor mtime side-effect that does not affect correctness or git-diff stability. All previously flagged issues (non-.json state path derivation, undefined updatedAtMs for manually-added jobs, redundant chmod) are addressed in the current code. The new concern (spurious jobs.json mtime touch on first persist in fresh-clone scenario) is P2 only — content is byte-for-byte identical so git shows no diff. Migration, round-trip, and runtime-only-churn paths are covered by tests. src/cron/store.ts — the migrating + cache-miss interaction described in the inline comment.
|
|
@greptile review and provide confidence score |
|
Tip: Greploops — Automatically fix all review issues by running Use the Greptile plugin for Claude Code to query reviews, search comments, and manage custom context directly from your terminal. |
|
@greptile review and provide confidence score |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 0a8fbdae3d
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
|
Thank you for this PR! |
|
@Feelw00 are you going to finish this PR? Otherwise I would like to finish it because I really need this feature |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: dfe96d3bfa
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 14d8978cbc
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
|
@Daanvdplas |
|
@Feelw00 perhaps making the CI green would help |
|
He @gumadeiras you reviewed a PR of me 2 weeks ago, could you maybe review this PR? @Feelw00 and I would be super excited for this to get merged. It would essentially allow to put cron definitions in github and have runtime state separated in another file not committed to git. For me at least I have a team working on the same openclaw and thus a clean github repo is super useful. Thanks in advance! |
7bdec62 to
b24451c
Compare
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: b24451c7be
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
c47e74b to
5ead5d4
Compare
|
I read somewhere that they were not allowing more features in for a while to focus on security. Changing the name to |
|
@Daanvdplas
So it's not specifically about security — new features have been intentionally frozen, and while the freeze lifts this week, there's no guarantee anything "new" will actually get merged since it'll be scrutinized closely. |
|
Agree with your approach, I bet they will want this, it just increases flexibility and allows to manage openclaw instances better through github. So in my view it will increase security even. |
d1effd9 to
acfbf76
Compare
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: acfbf76c81
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
7b0f5dc to
37c2b9b
Compare
3939207 to
470bb25
Compare
|
Merged via squash.
Thanks @Feelw00! |
|
Thanks @gumadeiras |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 470bb2561f
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
…claw#63105) Merged via squash. Prepared head SHA: 470bb25 Co-authored-by: Feelw00 <[email protected]> Co-authored-by: gumadeiras <[email protected]> Reviewed-by: @gumadeiras
…claw#63105) Merged via squash. Prepared head SHA: 470bb25 Co-authored-by: Feelw00 <[email protected]> Co-authored-by: gumadeiras <[email protected]> Reviewed-by: @gumadeiras
…claw#63105) Merged via squash. Prepared head SHA: 470bb25 Co-authored-by: Feelw00 <[email protected]> Co-authored-by: gumadeiras <[email protected]> Reviewed-by: @gumadeiras
…claw#63105) Merged via squash. Prepared head SHA: 470bb25 Co-authored-by: Feelw00 <[email protected]> Co-authored-by: gumadeiras <[email protected]> Reviewed-by: @gumadeiras
…claw#63105) Merged via squash. Prepared head SHA: 470bb25 Co-authored-by: Feelw00 <[email protected]> Co-authored-by: gumadeiras <[email protected]> Reviewed-by: @gumadeiras
…claw#63105) Merged via squash. Prepared head SHA: 470bb25 Co-authored-by: Feelw00 <[email protected]> Co-authored-by: gumadeiras <[email protected]> Reviewed-by: @gumadeiras
…claw#63105) Merged via squash. Prepared head SHA: 470bb25 Co-authored-by: Feelw00 <[email protected]> Co-authored-by: gumadeiras <[email protected]> Reviewed-by: @gumadeiras
Summary
jobs.jsonmixes config and runtime state in a single file. Every cron execution rewrites ~10 runtime fields, producing meaningless git diffs even when no configuration changed.saveCronStorenow writes config tojobs.jsonand runtime state tojobs-state.json.loadCronStoremerges both files by job ID. AddedconfigUpdatedAtMsto distinguish config modification time from execution time.persist(),ops.tscontrol flow,timer.tsexecution logic,doctor-cron.tsmigration — all unchanged. Split logic is fully encapsulated instore.ts.Change Type (select all)
Scope (select all touched areas)
Linked Issue/PR
Root Cause (if applicable)
N/A — this is a new feature.
Regression Test Plan (if applicable)
N/A — new feature. Existing tests updated to validate split behavior.
User-visible / Behavior Changes
jobs-state.jsoncreated alongsidejobs.jsonin the cron store directoryjobs.jsonno longer contains runtime state fields (updatedAtMs,state.*) — onlystate: {}stubsconfigUpdatedAtMson cron jobs, tracking when config was last modified (distinct from execution-timeupdatedAtMs)jobs.jsonand gitignorejobs-state.jsonwithout diff noiseDiagram (if applicable)
Security Impact (required)
Repro + Verification
Environment
Steps
openclaw cron add --name test --every 1m --message "ping"openclaw cron run <id> --forcejobs.json— should contain config only withstate: {}jobs-state.json— should contain runtime statejobs.jsonshould remain unchangedExpected
jobs.jsononly changes on config edit (add/update/remove)jobs-state.jsonupdates on every executionActual
jobs.jsonstable after runtime-only changesEvidence
26 tests passing across store, service/store, service/ops, service/timer, doctor-cron.
pnpm checkandpnpm tsgogreen.Human Verification (required)
Review Conversations
Compatibility / Migration
jobs.jsonis auto-migrated on first loadjobs.jsonretainsstate: {}stubs. AllCronJobStatefields are optional, so older versions read empty state without TypeError. Jobs resume with recalculated schedules.Risks and Mitigations
configUpdatedAtMsbackfilled fromcreatedAtMsis inaccurate for jobs modified after creationcreatedAtMsis the best available approximation.jobs-state.jsonwritten first. Runtime state is always recoverable viarecomputeNextRuns.AI Disclosure
pnpm build,pnpm check,pnpm tsgo, and 26 related tests all passingstore.ts,types.ts,ops.ts,timer.ts, andjobs.ts, with multiple rounds of review and self-critique before implementation🤖 Generated with Claude Code