feat(cron): isolated cron runner on SQLite base (desicool-release)#4
Open
Desicool wants to merge 8 commits into
Open
feat(cron): isolated cron runner on SQLite base (desicool-release)#4Desicool wants to merge 8 commits into
Desicool wants to merge 8 commits into
Conversation
Ports the weekly-report cron-triggered plugin from openclaw_cron onto the desicool-release (SQLite) base. No SDK import reconciliation needed; manifest ships contracts.tools and minHostVersion is satisfied. Lockfile gains the weekly-report workspace importer. Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
Net-new infra util (Node built-ins only) used by the forthcoming subprocess boot-reconcile to distinguish a live cron subprocess from a recycled pid. Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
…ggerMs (P3 onto SQLite base)
…oot reconcile Port the openclaw_cron feature onto the SQLite desicool-release base as an isolated agent-turn runner. Detached `openclaw run-cron-job` subprocess (gateway is the sole SQLite writer; subprocess reads job + writes a result file), a cross-process scheduler lock, boot-time reconcile of in-flight subprocess jobs (replacing mark-as-failed), and idempotencyKey dedup. Narrows cron to isolated/agentTurn only. Co-Authored-By: Claude Opus 4.8 <[email protected]>
Add `cron purge` (CLI + doctor --fix safe-subset) and fold legacy cron-schema repair into the doctor pipeline: migrate kind:"every"→cron, strip tz, rewrite non-isolated sessionTarget→isolated, and disable legacy systemEvent jobs (which the isolated runner cannot execute) so upgraded stores stay runnable. Co-Authored-By: Claude Opus 4.8 <[email protected]>
…ed-only cron Scheduled session turns are created as isolated cron jobs with the session binding in sessionKey, but the tag-cleanup filter still matched the removed sessionTarget==="session:<key>" form, so turns were created yet never found or cleaned up. Filter by sessionKey instead. Co-Authored-By: Claude Opus 4.8 <[email protected]>
Re-port cron tests for the isolated-only model: kind:"every"→cron, drop tz, sessionTarget:"main"/"session:*"→isolated, systemEvent→agentTurn; preserve intentional legacy shapes via casts in doctor/store migration tests; drop tests for removed paths (main-session routing, opaque session ids). Fixes the full cron test suite under `tsgo:core:test` (76 type errors → 0) while keeping vitest green. Co-Authored-By: Claude Opus 4.8 <[email protected]>
github-actions
Bot
force-pushed
the
desicool-release
branch
from
June 6, 2026 05:25
a5ec9d5 to
4ba2396
Compare
github-actions
Bot
force-pushed
the
desicool-release
branch
7 times, most recently
from
June 13, 2026 05:39
027abb3 to
787f6af
Compare
github-actions
Bot
force-pushed
the
desicool-release
branch
7 times, most recently
from
June 20, 2026 05:37
14c6006 to
a4fb765
Compare
github-actions
Bot
force-pushed
the
desicool-release
branch
6 times, most recently
from
June 26, 2026 05:34
c026b30 to
3018bf1
Compare
github-actions
Bot
force-pushed
the
desicool-release
branch
7 times, most recently
from
July 3, 2026 07:24
41ea1f6 to
2b2ee39
Compare
github-actions
Bot
force-pushed
the
desicool-release
branch
8 times, most recently
from
July 11, 2026 06:16
26717a7 to
b8913d4
Compare
github-actions
Bot
force-pushed
the
desicool-release
branch
8 times, most recently
from
July 19, 2026 06:34
f70d338 to
92230fb
Compare
github-actions
Bot
force-pushed
the
desicool-release
branch
7 times, most recently
from
July 26, 2026 06:41
f9fbd00 to
6a44021
Compare
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.
Summary
Re-ports the
openclaw_croncron feature onto the SQLitedesicool-releasebase as an isolated cron runner (isolated agent-turn jobs only), and completes the isolated-only narrowing the WIP branch had left half-finished.openclaw run-cron-job <jobId> --run-id <uuid>subprocess; the gateway stays the sole SQLite writer (subprocess reads the job and writes a unique result file), cross-process scheduler lock, and boot-time reconcile of in-flight subprocess jobs (replaces mark-as-failed). AddsidempotencyKeydedup.sessionTarget:"isolated"+payload.kind:"agentTurn"only.kind:"every", scheduletz, non-isolated session targets, andsystemEventreminders are removed from the create/run path.openclaw doctor --fixmigrates legacy stores:every→cron, stripstz, rewrites non-isolatedsessionTarget→isolated, and disables legacysystemEventjobs (the isolated runner can't execute them) so upgraded stores stay runnable. Addscron purge.sessionKey, but tag-cleanup still filtered on the removedsessionTarget==="session:<key>", so turns were created yet never cleaned up. Now filters bysessionKey.tsgo:core:test(esbuild strips types) — now 0 type errors.Verification
Local (linked worktree,
node scripts/run-vitest.mjs+pnpm tsgo):pnpm tsgo:core(prod) → 0 errors;pnpm tsgo:core:test→ 0 errors (was 76)src/cron958 ·doctor/cron150 · gatewayserver.cron17 /server-cron16 /-lazypass ·cron-tool82 ·scheduled-turns.contract25 ·captured-registration2 ·weekly-report84Behavior addressed: cron jobs run as isolated agent turns and survive gateway restart; legacy stores migrate via
doctor --fix; plugin scheduled turns clean up.Real environment tested: not yet — unit + typecheck only.
Exact steps or command run after this patch:
pnpm tsgo:core,pnpm tsgo:core:test,node scripts/run-vitest.mjs src/cron(+ the suites above).Evidence after fix: all suites green; both tsgo lanes 0 errors.
Observed result after fix: green.
What was not tested:
pnpm build,check:import-cycles, fullpnpm check, extensions typecheck, and the live restart-survival /doctor --fixrepro — deferred to Crabbox/Testbox before land (no module-boundary or dynamic-import changes, so low risk).🤖 Generated with Claude Code