feat(cron): isolated cron runner on current SQLite base (re-port, supersedes #4)#5
Open
Desicool wants to merge 6 commits into
Open
feat(cron): isolated cron runner on current SQLite base (re-port, supersedes #4)#5Desicool wants to merge 6 commits into
Desicool wants to merge 6 commits into
Conversation
…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 cleaned up. Filter by sessionKey. Co-Authored-By: Claude Opus 4.8 <[email protected]>
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 (the isolated runner cannot execute them) so upgraded stores stay runnable. Co-Authored-By: Claude Opus 4.8 <[email protected]>
…oot reconcile Re-port the isolated-only cron feature onto the SQLite (codec-store) base: detached `openclaw run-cron-job` subprocess (gateway is sole SQLite writer), cross-process scheduler lock, boot-time reconcile of in-flight subprocess jobs, and idempotencyKey dedup. Narrows cron to isolated/agentTurn only (drops every/tz/main/current/session from the create+run surface); recovers idempotencyKey from job_json on load. Removes tests for the deleted paths. Co-Authored-By: Claude Opus 4.8 <[email protected]>
Re-port cron tests for the isolated-only model on the SQLite base: every→cron, drop tz, main/current/session→isolated, systemEvent→agentTurn; preserve intentional legacy shapes via casts in doctor/store migration tests; drop tests for removed paths. Clean under tsgo:core/tsgo:core:test and vitest. Co-Authored-By: Claude Opus 4.8 <[email protected]>
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
8 times, most recently
from
June 28, 2026 05:38
e3ac144 to
6605894
Compare
github-actions
Bot
force-pushed
the
desicool-release
branch
2 times, most recently
from
June 30, 2026 05:31
ac431f9 to
8b7e1cd
Compare
github-actions
Bot
force-pushed
the
desicool-release
branch
7 times, most recently
from
July 7, 2026 07:41
d9067f9 to
93379db
Compare
github-actions
Bot
force-pushed
the
desicool-release
branch
8 times, most recently
from
July 15, 2026 06:18
dd0a38b to
3032eca
Compare
github-actions
Bot
force-pushed
the
desicool-release
branch
7 times, most recently
from
July 22, 2026 06:33
b225548 to
13cc9d3
Compare
github-actions
Bot
force-pushed
the
desicool-release
branch
4 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 isolated-only cron feature onto the current SQLite
desicool-releasebase (supersedes #4, which was built on an older, since-force-pushed base).Cron is narrowed to an isolated agent-turn runner only:
sessionTarget:"isolated"+payload.kind:"agentTurn"(dropskind:"every", scheduletz,main/current/session:targets, andsystemEventcreate/run). Adds: detachedopenclaw run-cron-jobsubprocess (gateway is the sole SQLite writer), cross-process scheduler lock, boot-time reconcile of in-flight subprocess jobs,idempotencyKeydedup,cron purge, doctor--fixlegacy migrations (every→cron, strip tz, non-isolated→isolated, disable legacy systemEvent jobs), and the bundledweekly-reportplugin. Also fixes a plugin regression where scheduled-turn cleanup matched the removedsessionTarget==="session:<key>"instead ofsessionKey.desicool-releaseis a continuously force-pushed fork-overlay branch (theci: re-apply fork overlaycommits) — it was rewritten twice while this work was in progress, so this branch and the base share only a far-back merge-base. GitHub therefore shows a bloated diff (~hundreds of files) that is mostly history-rewrite noise, not real change. The actual cron work is the 5 commits on this branch:feat(cron): isolated cron runner — subprocess exec, scheduler lock, boot reconcilefeat(doctor): cron purge + legacy schema migrations for isolated-onlyfeat(weekly-report): add bundled pluginfix(plugins): match scheduled-turn cleanup by sessionKeytest(cron): migrate fixtures and suites to isolated-only runnerThis branch cannot be cleanly fast-forward-merged while the overlay keeps rewriting the base; the intent is for whoever runs the overlay pipeline to incorporate these commits (or fold the cron feature into the overlay source).
Verification (green on the base this was built on)
pnpm tsgo:core0 errors ·pnpm tsgo:core:test0 errorssrc/cron957 ·doctor/cron136 · gateway cron:server.cron36 /server-cron32 /-lazy14 /-notifications2 /server-methods/cron.validation74 ·cron-tool95 ·cron-cli86 ·scheduled-turns.contract25 ·weekly-report84 · logging 24 · tasks 19Behavior addressed: cron runs as isolated agent turns, survives gateway restart via subprocess reconcile; legacy stores migrate via
doctor --fix; plugin scheduled turns clean up by sessionKey.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 listed 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, live restart-survival /doctor --fixrepro — deferred to Crabbox/Testbox.🤖 Generated with Claude Code