fix(cron): add standalone cron daemon mode - #41167
fix(cron): add standalone cron daemon mode#41167alaamohanad169-ship-it wants to merge 3 commits into
Conversation
…g provider When running `hermes model` to add/configure a provider without intending to switch the default, the wizard previously overwrote model.base_url and model.provider, breaking the previously-working default model. This fix adds a confirmation prompt: 'Make <provider> your default provider?' If the user answers 'no', the provider is configured (credentials, base_url) without changing the active default model. Fixes #40862
Add `hermes cron daemon` command to run the cron scheduler independently of the gateway. This fixes the issue where cron jobs don't execute on systems where the gateway isn't running (e.g., Windows without service installation, or when running headless). The daemon runs the same tick loop as the gateway's internal cron ticker, but as a standalone process that can be started with: hermes cron daemon [--interval 60] This allows cron jobs to execute on any platform without requiring the gateway to be running.
|
Scope concern — two unrelated features in one PR The diff contains two separate features that should be separate PRs:
Bundling unrelated changes makes review harder and increases the chance of one feature blocking the other. Consider splitting the provider config changes into a separate PR. Also a minor note: |
|
Closing in favor of clean PR #41363 which only contains the cron daemon changes without the unrelated model wizard changes. |
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