feat(cron): usercron hot-reload via external cronjob.toml#629
Merged
thepagent merged 10 commits intoopenabdev:mainfrom Apr 29, 2026
Merged
feat(cron): usercron hot-reload via external cronjob.toml#629thepagent merged 10 commits intoopenabdev:mainfrom
thepagent merged 10 commits intoopenabdev:mainfrom
Conversation
Add usercron_path config option that points to an external cronjob.toml. The scheduler checks the file mtime every tick and reloads when modified, enabling agents to manage schedules at runtime without redeployment. - config.rs: add usercron_path field to Config - cron.rs: add load_usercron_file(), parse_job_list(), mtime-based reload - main.rs: pass usercron_path and configured_platforms to scheduler - 5 new tests for usercron loading/validation - docs: add Usercron section to cronjob.md Closes openabdev#628
- Add design decision comment for same-tick reload collision in cron.rs - Fix docs K8s section: usercron_path is a config.toml field, not env var
Collaborator
Author
|
Discord Discussion: https://discord.com/channels/1490282656913559673/1498821935059042384 |
Relative paths like 'cronjob.toml' now resolve to $HOME/cronjob.toml. Absolute paths are used as-is. Updated docs accordingly.
Add usercron_enabled flag (default: false). Usercron hot-reload only activates when explicitly enabled in config.toml.
…]] top-level [cron] section holds usercron_enabled and usercron_path. [[cronjobs]] stays as a top-level array for baseline jobs (no breaking change). Config layout: [cron] usercron_enabled = true usercron_path = "cronjob.toml" [[cronjobs]] schedule = "0 9 * * 1-5" ...
BREAKING CHANGE: [[cronjobs]] is now [[cron.jobs]] under the [cron] section. usercron settings also live under [cron]. Config layout: [cron] usercron_enabled = true usercron_path = "cronjob.toml" [[cron.jobs]] schedule = "0 9 * * 1-5" channel = "123" message = "hello" External cronjob.toml uses [[jobs]] (same fields).
…empty file - validate_cronjobs: valid/invalid cron/tz/unknown platform/unconfigured - file_mtime: detects change after write - CronConfig: [cron] + [[cron.jobs]] TOML parses correctly, defaults when omitted - load_usercron: empty file returns empty vec
thepagent
approved these changes
Apr 29, 2026
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
Add usercron support and consolidate all cron config under
[cron].BREAKING CHANGE:
[[cronjobs]]→[[cron.jobs]]Closes #628
Flow
Config
External
cronjob.tomluses[[jobs]](same fields).Changes
CronConfigstruct withusercron_enabled,usercron_path,jobs;[[cronjobs]]→[[cron.jobs]]load_usercron_file(),parse_job_list(), mtime-based hot-reload; external file uses[[jobs]][cron].usercron_enabled, resolve relative paths from$HOME[cron][cron]sectionTesting
Discord Discussion: https://discord.com/channels/1491295327620169908/1491365150664560881/1498838230018298026