fix(cron): add standalone cron daemon mode - #41363
Closed
alaamohanad169-ship-it wants to merge 1 commit into
Closed
Conversation
7 tasks
Collaborator
alaamohanad169-ship-it
force-pushed
the
fix/cron-daemon-standalone-clean
branch
from
June 8, 2026 13:51
825e781 to
f75a10d
Compare
- Add hermes cron daemon subcommand for headless/standalone operation
- Add gateway lifecycle command defense (#30719) in cron_create()
- Fix null-repeat bug in cron_list (job.get('repeat') or {})
- _GATEWAY_LIFECYCLE_PATTERNS to block gateway restart/stop/kill in cron jobs
Co-authored-by: Ash <alaamohanad169-ship-it@users.noreply.github.com>
alaamohanad169-ship-it
force-pushed
the
fix/cron-daemon-standalone-clean
branch
from
June 8, 2026 13:55
f75a10d to
8dec99a
Compare
5 tasks
This was referenced Aug 3, 2026
Open
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.
What does this PR do?
Adds
hermes cron daemoncommand to run the cron scheduler as a standalone process, independent of the gateway.Problem: Cron jobs don't execute on systems where the gateway isn't running (Windows without service installation, headless servers, etc.). The cron scheduler only runs inside the gateway process, so if the gateway isn't started, cron jobs never fire.
Solution: New
hermes cron daemoncommand that runs the same tick loop as the gateway's internal cron ticker, but as a standalone process.Changes Made
hermes_cli/cron.py: Addedcron_daemon()function that runs the cron tick loop with signal handlinghermes_cli/main.py: Addeddaemonsubcommand parser with--intervaloption (default 60s)How to Test
Create a cron job:
Start the cron daemon:
Verify the job executes (check
hermes cron listforlast_run_at)Stop with Ctrl+C
Related Issue
Fixes #41037 (Cron jobs never execute: last_run_at always null after manual trigger)
Type of Change
Checklist