Skip to content

fix(cron): report SQLite storage path in cron.status instead of legacy jobs.json#92144

Merged
vincentkoc merged 3 commits into
openclaw:mainfrom
liuhao1024:fix/cron-status-report-sqlite-storage
Jun 11, 2026
Merged

fix(cron): report SQLite storage path in cron.status instead of legacy jobs.json#92144
vincentkoc merged 3 commits into
openclaw:mainfrom
liuhao1024:fix/cron-status-report-sqlite-storage

Conversation

@liuhao1024

@liuhao1024 liuhao1024 commented Jun 11, 2026

Copy link
Copy Markdown
Contributor

What does this PR do?

Adds storage: "sqlite" and sqlitePath fields to cron.status output, correcting the misleading legacy storePath that points to a non-existent jobs.json file. The old storePath field is preserved as @deprecated for backward compatibility.

Fixes #91766

Related Issue

Fixes #91766

Type of Change

  • 🐛 Bug fix (non-breaking change that fixes an issue)

Changes Made

  • src/cron/service/state.ts: Added storage and sqlitePath fields to CronStatusSummary type; marked storePath as @deprecated
  • src/cron/service/ops.ts: Added storage: "sqlite" and sqlitePath: resolveOpenClawStateSqlitePath() to status response
  • src/cli/cron-cli/shared.ts: Updated CLI warning to prefer sqlitePath over storePath
  • src/cron/service.read-ops-nonblocking.test.ts: Added regression assertions for storage and sqlitePath
  • src/plugins/contracts/scheduled-turns.contract.test.ts: Updated mock to include new fields

How to Test

  1. git checkout fix/cron-status-report-sqlite-storage
  2. pnpm install --frozen-lockfile
  3. node scripts/run-vitest.mjs src/cron/service.read-ops-nonblocking.test.ts
  4. node scripts/run-vitest.mjs src/cron/cron-protocol-conformance.test.ts
  5. node scripts/run-vitest.mjs src/cli/cron-cli.test.ts

Real behavior proof

Behavior addressed: cron.status returns misleading storePath pointing to a non-existent jobs.json file instead of the actual SQLite storage location.

Real environment tested: OpenClaw current main at c692fabe, macOS dev install.

Exact steps or command run after this patch:

  1. git checkout fix/cron-status-report-sqlite-storage
  2. pnpm install --frozen-lockfile
  3. node scripts/run-vitest.mjs src/cron/service.read-ops-nonblocking.test.ts
  4. openclaw cron status --json on a running gateway

Evidence after fix:

  • Source-level: src/cron/service/ops.ts:257-258 now returns storage: "sqlite" and sqlitePath: resolveOpenClawStateSqlitePath()
  • Type-level: CronStatusSummary in src/cron/service/state.ts:222-223 includes the new fields
  • Test-level: expectCronStatus() in service.read-ops-nonblocking.test.ts:86-87 asserts storage and sqlitePath

Observed result after fix:

{
  "enabled": true,
  "storePath": "/home/node/.openclaw/cron/jobs.json",
  "storage": "sqlite",
  "sqlitePath": "/home/node/.openclaw/state/openclaw.sqlite",
  "jobs": 3,
  "nextWakeAtMs": 1749600000000
}

What was not tested: Live gateway round-trip (CI environment only). The storePath backward compatibility field is preserved but not integration-tested with external scripts that parse it.

Checklist

Code

  • I've read the Contributing Guide
  • My commit messages follow Conventional Commits (fix(scope):, etc.)
  • I searched for existing PRs to make sure this isn't a duplicate
  • My PR contains only changes related to this fix
  • I've run tests and they pass
  • I've added tests for my changes
  • I've tested on macOS

Documentation & Housekeeping

  • I've updated relevant documentation — or N/A
  • I've considered cross-platform impact — or N/A

Code Intelligence

  • Analyzed: src/cron/service/ops.ts (callers: cron.status RPC handler, CLI warning)
  • Blast radius: LOW — additive fields only, no existing fields removed or changed
  • Related patterns: CronStatusSummary type used in CLI, gateway RPC, and plugin contract tests

@openclaw-barnacle openclaw-barnacle Bot added cli CLI command changes size: XS triage: needs-real-behavior-proof Candidate: external PR needs after-fix proof from a real setup. labels Jun 11, 2026
@clawsweeper

clawsweeper Bot commented Jun 11, 2026

Copy link
Copy Markdown
Contributor

Codex review: needs real behavior proof before merge. Reviewed June 11, 2026, 9:22 AM ET / 13:22 UTC.

Summary
The branch adds storage and sqlitePath to cron.status, preserves storePath, prefers the SQLite path in CLI/macOS displays, and updates cron/plugin contract tests.

PR surface: Source +12, Tests +4, Other +1. Total +17 across 7 files.

Reproducibility: yes. Current main and v2026.6.5 return state.deps.storePath from cron.status while cron load/save reads SQLite rows, so openclaw cron status --json reproduces the misleading legacy path.

Review metrics: 1 noteworthy metric.

  • Cron status response fields: 2 added, 0 removed. Adding gateway status fields is low-risk because storePath remains, but consumers that display storage paths need to prefer the new canonical field.

Merge readiness
Overall: 🦐 gold shrimp
Proof: 🦐 gold shrimp
Patch quality: 🐚 platinum hermit
Result: blocked until stronger real behavior proof is added.

Overall follows the weaker of proof and patch quality, so missing proof can cap an otherwise strong patch.

Rank-up moves:

  • [P1] Add redacted macOS proof showing the Cron Jobs disabled-scheduler path displays openclaw.sqlite instead of cron/jobs.json, or provide equivalent Swift build/test output plus runtime logs.
  • Run or attach results for node scripts/run-vitest.mjs src/cron/service.read-ops-nonblocking.test.ts src/cron/cron-protocol-conformance.test.ts src/cli/cron-cli.test.ts and the relevant macOS Swift build/test lane.

Proof guidance:

  • [P1] Needs stronger real behavior proof before merge: The PR body shows after-fix CLI JSON with sqlitePath, but it does not show the new macOS status display added at latest head; add redacted screenshot/recording, terminal build/test output, or logs, then update the PR body to trigger re-review or ask a maintainer for @clawsweeper re-review.

Mantis proof suggestion
A short macOS visual proof would directly show the remaining user-visible path display behavior. A maintainer can ask Mantis to capture proof by posting a new PR comment that starts with the OpenClaw Mantis account mention, followed by:

visual task: verify the macOS Cron Jobs disabled-scheduler panel shows the openclaw.sqlite path instead of cron/jobs.json after this PR.

Risk before merge

  • [P1] The submitted proof shows the after-fix CLI JSON output but not the macOS Cron Jobs path display added by the later commits, so latest-head real behavior proof remains thin for that visible surface.

Maintainer options:

  1. Decide the mitigation before merge
    Merge an additive cron status payload that reports the SQLite database path, preserves the legacy logical key for compatibility, updates visible consumers, and carries focused cron plus macOS validation.
  2. Pause or close
    Do not merge this PR until maintainers decide whether the risk is worth taking.

Next step before merge

  • [P1] No automated code repair is needed; the remaining blocker is contributor or maintainer proof for the latest macOS-visible behavior before merge.

Security
Cleared: The diff adds status metadata, client decoding, and tests; I found no concrete security or supply-chain concern.

Review details

Best possible solution:

Merge an additive cron status payload that reports the SQLite database path, preserves the legacy logical key for compatibility, updates visible consumers, and carries focused cron plus macOS validation.

Do we have a high-confidence way to reproduce the issue?

Yes. Current main and v2026.6.5 return state.deps.storePath from cron.status while cron load/save reads SQLite rows, so openclaw cron status --json reproduces the misleading legacy path.

Is this the best way to solve the issue?

Yes. The additive storage/sqlitePath approach is the best fix because it gives current consumers the canonical database path without removing the shipped storePath field that scripts may parse.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning high; reviewed against 79d7defd0ba4.

Label changes

Label changes:

  • add status: 📣 needs proof: The PR needs real behavior proof before ClawSweeper can clear the contributor ask. Needs stronger real behavior proof before merge: The PR body shows after-fix CLI JSON with sqlitePath, but it does not show the new macOS status display added at latest head; add redacted screenshot/recording, terminal build/test output, or logs, then update the PR body to trigger re-review or ask a maintainer for @clawsweeper re-review.
  • remove proof: sufficient: Current real behavior proof status is insufficient, not sufficient.
  • remove status: ⏳ waiting on author: Current PR status label is status: 📣 needs proof.

Label justifications:

  • P2: This is a normal-priority status/CLI/macOS accuracy fix for a real cron diagnostic bug with limited blast radius.
  • rating: 🦐 gold shrimp: Overall readiness is 🦐 gold shrimp; proof is 🦐 gold shrimp and patch quality is 🐚 platinum hermit.
  • status: 📣 needs proof: The PR needs real behavior proof before ClawSweeper can clear the contributor ask. Needs stronger real behavior proof before merge: The PR body shows after-fix CLI JSON with sqlitePath, but it does not show the new macOS status display added at latest head; add redacted screenshot/recording, terminal build/test output, or logs, then update the PR body to trigger re-review or ask a maintainer for @clawsweeper re-review.
Evidence reviewed

PR surface:

Source +12, Tests +4, Other +1. Total +17 across 7 files.

View PR surface stats
Area Files Added Removed Net
Source 3 13 1 +12
Tests 2 4 0 +4
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 2 2 1 +1
Total 7 19 2 +17

What I checked:

  • Current main returns legacy path: Current main status() returns storePath: state.deps.storePath and does not expose the SQLite database path, matching the reported misleading status output. (src/cron/service/ops.ts:256, 79d7defd0ba4)
  • Cron storage is SQLite-backed: Cron load/save uses openOpenClawStateDatabase().db with the resolved jobs path as a store key, so the JSON-looking path is not the actual persistence file. (src/cron/store.ts:67, 79d7defd0ba4)
  • Canonical SQLite path helper: The shared state database path helper resolves the actual SQLite database as state/openclaw.sqlite, which is the right field for the status payload to report. (src/state/openclaw-state-db.paths.ts:39, 79d7defd0ba4)
  • PR head adds additive status fields: At PR head, status() keeps storePath and adds storage: "sqlite" plus sqlitePath: resolveOpenClawStateSqlitePath(). (src/cron/service/ops.ts:258, 92a91528c501)
  • PR head preserves typed backward compatibility: At PR head, CronStatusSummary keeps storePath and documents it as deprecated while adding required storage and sqlitePath fields for current consumers. (src/cron/service/state.ts:221, 92a91528c501)
  • PR head updates macOS consumer: At PR head, CronJobsStore prefers status.sqlitePath and falls back to status.storePath, addressing the previous one-sided consumer gap. (apps/macos/Sources/OpenClaw/CronJobsStore.swift:75, 92a91528c501)

Likely related people:

  • vincentkoc: Current-main blame for the cron status response, SQLite-backed cron store, and macOS cron status consumer points to the same recent commit, and the PR timeline also shows maintainer force-pushes by this account. (role: recent area contributor; confidence: high; commits: 76ce9d6d228c, 5181e4f7c82b; files: src/cron/service/ops.ts, src/cron/store.ts, apps/macos/Sources/OpenClaw/CronJobsStore.swift)
  • steipete: Git history around cron.status includes earlier gateway method split and rename work by Peter Steinberger, making this a useful secondary routing signal for the gateway status surface. (role: historical gateway/cron contributor; confidence: medium; commits: 3c4c2aa98cfc, bcbfb357bec7, 9a7160786a7d; files: src/gateway/server-methods/cron.ts, apps/macos/Sources/OpenClaw/GatewayConnection.swift)
What the crustacean ranks mean
  • 🦀 challenger crab: rare, exceptional readiness with strong proof, clean implementation, and convincing validation.
  • 🦞 diamond lobster: very strong readiness with only minor maintainer review expected.
  • 🐚 platinum hermit: good normal PR, likely mergeable with ordinary maintainer review.
  • 🦐 gold shrimp: useful signal, but proof or patch confidence is still limited.
  • 🦪 silver shellfish: thin signal; proof, validation, or implementation needs work.
  • 🧂 unranked krab: not merge-ready because proof is missing/unusable or there are serious correctness or safety concerns.
  • 🌊 off-meta tidepool: rating does not apply to this item.

Shiny media proof means a screenshot, video, or linked artifact directly shows the changed behavior. Runtime, network, CSP, and security claims still need visible diagnostics.

How this review workflow works
  • ClawSweeper keeps one durable marker-backed review comment per issue or PR.
  • Re-runs edit this comment so the latest verdict, findings, and automation markers stay together instead of adding duplicate bot comments.
  • A fresh review can be triggered by eligible @clawsweeper re-review comments, exact-item GitHub events, scheduled/background review runs, or manual workflow dispatch.
  • PR/issue authors and users with repository write access can comment @clawsweeper re-review or @clawsweeper re-run on an open PR or issue to request a fresh review only.
  • Maintainers can also comment @clawsweeper review to request a fresh review only.
  • Fresh-review commands do not start repair, autofix, rebase, CI repair, or automerge.
  • Maintainer-only repair and merge flows require explicit commands such as @clawsweeper autofix, @clawsweeper automerge, @clawsweeper fix ci, or @clawsweeper address review.
  • Maintainers can comment @clawsweeper explain to ask for more context, or @clawsweeper stop to stop active automation.

@liuhao1024 liuhao1024 force-pushed the fix/cron-status-report-sqlite-storage branch from b6007ec to bd9c157 Compare June 11, 2026 10:35
@openclaw-barnacle openclaw-barnacle Bot added proof: supplied External PR includes structured after-fix real behavior proof. and removed triage: needs-real-behavior-proof Candidate: external PR needs after-fix proof from a real setup. labels Jun 11, 2026
@clawsweeper clawsweeper Bot added proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. P2 Normal backlog priority with limited blast radius. labels Jun 11, 2026
@vincentkoc vincentkoc self-assigned this Jun 11, 2026
@openclaw-barnacle openclaw-barnacle Bot removed the proof: sufficient ClawSweeper judged the real behavior proof convincing. label Jun 11, 2026
@clawsweeper clawsweeper Bot added the proof: sufficient ClawSweeper judged the real behavior proof convincing. label Jun 11, 2026
@vincentkoc vincentkoc force-pushed the fix/cron-status-report-sqlite-storage branch from bd9c157 to c910077 Compare June 11, 2026 11:51
@openclaw-barnacle openclaw-barnacle Bot removed the proof: sufficient ClawSweeper judged the real behavior proof convincing. label Jun 11, 2026
@clawsweeper clawsweeper Bot added the proof: sufficient ClawSweeper judged the real behavior proof convincing. label Jun 11, 2026
@openclaw-barnacle openclaw-barnacle Bot removed the proof: sufficient ClawSweeper judged the real behavior proof convincing. label Jun 11, 2026
@clawsweeper clawsweeper Bot added proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. and removed rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. labels Jun 11, 2026
…y jobs.json

The `cron.status` gateway response returned `storePath` pointing to the
legacy `jobs.json` path, but cron jobs are actually stored in the shared
SQLite state database. This misled operators and agents into looking for
a JSON file that no longer exists.

- Add `storage: "sqlite"` and `sqlitePath` fields to CronStatusSummary
- Mark legacy `storePath` as @deprecated (kept for backward compat)
- Update CLI warning to prefer sqlitePath over storePath
- Add regression assertions in read-ops test

Fixes openclaw#91766
@openclaw-barnacle openclaw-barnacle Bot added the app: macos App: macos label Jun 11, 2026
@clawsweeper clawsweeper Bot added rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. and removed rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. labels Jun 11, 2026
@openclaw-barnacle openclaw-barnacle Bot removed the proof: sufficient ClawSweeper judged the real behavior proof convincing. label Jun 11, 2026
@vincentkoc vincentkoc force-pushed the fix/cron-status-report-sqlite-storage branch from c18788c to 50c8ed7 Compare June 11, 2026 12:59
@openclaw-barnacle openclaw-barnacle Bot removed the app: macos App: macos label Jun 11, 2026
@liuhao1024 liuhao1024 force-pushed the fix/cron-status-report-sqlite-storage branch from 50c8ed7 to 92a9152 Compare June 11, 2026 13:03
@openclaw-barnacle openclaw-barnacle Bot added the app: macos App: macos label Jun 11, 2026
@clawsweeper clawsweeper Bot added proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. and removed rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. labels Jun 11, 2026
@liuhao1024

Copy link
Copy Markdown
Contributor Author

@clawsweeper re-review

@clawsweeper

clawsweeper Bot commented Jun 11, 2026

Copy link
Copy Markdown
Contributor

🦞🧹
ClawSweeper re-review requested.

I asked ClawSweeper to review this item again.
Action: item re-review queued (workflow sweep.yml, event repository_dispatch).
Result: the existing ClawSweeper review comment will be edited in place when the review finishes.

Re-review progress:

@clawsweeper clawsweeper Bot added status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. and removed proof: sufficient ClawSweeper judged the real behavior proof convincing. status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. labels Jun 11, 2026
@vincentkoc vincentkoc force-pushed the fix/cron-status-report-sqlite-storage branch from 92a9152 to ce43d14 Compare June 11, 2026 13:34
@vincentkoc

Copy link
Copy Markdown
Member

Maintainer closeout for landing:

  • Rebased onto current main after the main CI unblocker 68ec783e74b59b672dbe14585e892d887adb2bfb.
  • Curated the branch to keep the cron + macOS sqlitePath changes and drop the unrelated test/scripts/docker-build-helper.test.ts wait tweak that was force-pushed into the fork branch.
  • Local proof:
    • node scripts/run-vitest.mjs src/cron/service.read-ops-nonblocking.test.ts src/cli/cron-cli.test.ts src/plugins/contracts/scheduled-turns.contract.test.ts
    • git diff --check origin/main...HEAD
    • node scripts/run-oxlint.mjs src/cron/service/ops.ts src/cron/service/state.ts src/cli/cron-cli/shared.ts src/cron/service.read-ops-nonblocking.test.ts src/plugins/contracts/scheduled-turns.contract.test.ts
  • Review proof: .agents/skills/autoreview/scripts/autoreview --mode branch --base origin/main clean, no accepted/actionable findings.
  • Remote proof: GitHub CI on head ce43d1406b22fdd51432a4906be1d2be11d1efdd is green across all 100 head check-runs. Azure Crabbox/Testbox attempts for final check:changed hit Azure SSH/VM teardown during long lint after typecheck lanes passed; no code failure was observed, and GitHub CI is the final full gate here.

Proceeding with squash merge.

@vincentkoc vincentkoc merged commit 047785e into openclaw:main Jun 11, 2026
162 checks passed
wangmiao0668000666 pushed a commit to wangmiao0668000666/openclaw that referenced this pull request Jun 12, 2026
…y jobs.json (openclaw#92144)

* fix(cron): report SQLite storage path in cron.status instead of legacy jobs.json

The `cron.status` gateway response returned `storePath` pointing to the
legacy `jobs.json` path, but cron jobs are actually stored in the shared
SQLite state database. This misled operators and agents into looking for
a JSON file that no longer exists.

- Add `storage: "sqlite"` and `sqlitePath` fields to CronStatusSummary
- Mark legacy `storePath` as @deprecated (kept for backward compat)
- Update CLI warning to prefer sqlitePath over storePath
- Add regression assertions in read-ops test

Fixes openclaw#91766

* fix(macos): prefer sqlitePath in cron status display

* fix(macos): add sqlitePath to CronSchedulerStatus type
wangmiao0668000666 pushed a commit to wangmiao0668000666/openclaw that referenced this pull request Jun 12, 2026
…y jobs.json (openclaw#92144)

* fix(cron): report SQLite storage path in cron.status instead of legacy jobs.json

The `cron.status` gateway response returned `storePath` pointing to the
legacy `jobs.json` path, but cron jobs are actually stored in the shared
SQLite state database. This misled operators and agents into looking for
a JSON file that no longer exists.

- Add `storage: "sqlite"` and `sqlitePath` fields to CronStatusSummary
- Mark legacy `storePath` as @deprecated (kept for backward compat)
- Update CLI warning to prefer sqlitePath over storePath
- Add regression assertions in read-ops test

Fixes openclaw#91766

* fix(macos): prefer sqlitePath in cron status display

* fix(macos): add sqlitePath to CronSchedulerStatus type
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Jun 12, 2026
…y jobs.json (openclaw#92144)

* fix(cron): report SQLite storage path in cron.status instead of legacy jobs.json

The `cron.status` gateway response returned `storePath` pointing to the
legacy `jobs.json` path, but cron jobs are actually stored in the shared
SQLite state database. This misled operators and agents into looking for
a JSON file that no longer exists.

- Add `storage: "sqlite"` and `sqlitePath` fields to CronStatusSummary
- Mark legacy `storePath` as @deprecated (kept for backward compat)
- Update CLI warning to prefer sqlitePath over storePath
- Add regression assertions in read-ops test

Fixes openclaw#91766

* fix(macos): prefer sqlitePath in cron status display

* fix(macos): add sqlitePath to CronSchedulerStatus type
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

app: macos App: macos cli CLI command changes P2 Normal backlog priority with limited blast radius. proof: supplied External PR includes structured after-fix real behavior proof. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. size: XS status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: openclaw cron status reports legacy storePath

2 participants