fix: load scheduler jobs from disk JSON files at startup - #671
Merged
Conversation
Add ScheduleManager.loadFromDisk() to read *.json files from memory/schedules/ and populate the in-memory state, so the TUI schedules panel and runNow show persisted jobs. For jobs with a skill field, generate a reflection-style command. For jobs with only command, execute it directly via spawn(). Fix missing await on Cron._writeCrontab() in Cron.sync().
avoidwork
force-pushed
the
feat/scheduler-loadFromDisk
branch
from
August 2, 2026 13:20
8eca3d3 to
43acc03
Compare
The previous implementation called child.stdin.end(opts.input) which ends the stream without writing the data. Split into write() then end() so the input data is actually sent to the child process.
Owner
Author
Audit: Crontab Persistence FixVerdict: PASS — This PR correctly fixes the empty crontab issue and adds valuable persistence support. Issue: Crontab empty after application startThe root cause was two compounding bugs in the startup flow:
What this PR fixes
Additional improvements (nice-to-haves)
Code quality
Minor observations (not blockers)
VerdictPASS. The core fix (crontab persistence) is correct and well-tested. The additional persistence features are well-scoped and don't interfere with the fix. Ready to merge. |
This was referenced Aug 2, 2026
Merged
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.
Description
Add
ScheduleManager.loadFromDisk()to read.jsonfiles frommemory/schedules/and populate the in-memory state, so the TUI schedules panel andrunNowshow persisted jobs. For jobs with askillfield, generate a reflection-style command. For jobs with onlycommand, execute it directly viaspawn(). Fix missingawaitonCron._writeCrontab()inCron.sync().Type of Change
Testing
Added a new test suite
scheduler - ScheduleManager.loadFromDiskwith 12 tests covering: empty dir, valid entries, disabled skip, missing name/cron/skill-or-command, non-json files, malformed JSON, skill-to-command generation, default input and contextFile, custom input, and nonexistent directory. Addedscheduler - ScheduleManager.register with commandwith 6 tests for command-based entries and defaults. Addedscheduler - ScheduleManager.runNow with commandwith 3 tests for direct command execution and timeout. All 1054 tests pass.Coverage
Checklist