Bug Description
The cron scheduler (cron/scheduler.py) does not load or pass fallback_model from config.yaml to the AIAgent constructor. This means cron jobs have no fallback chain when the primary model endpoint is unreachable. The gateway (gateway/run.py) and CLI (cli.py) both correctly load and pass fallback_model, so this is an inconsistency specific to cron.
Steps to Reproduce
- Configure a cron job in
config.yaml with a per-job model pointing to a local endpoint (e.g., a local LM Studio instance).
- Shut down or make the local endpoint unreachable (e.g., reboot the machine overnight).
- Wait for the cron job to trigger.
- Observe that the
AIAgent stalls with message_count=0 and ended_at=None — no fallback model is attempted.
Expected Behavior
Cron jobs should respect the fallback_model / fallback_providers configuration in config.yaml, matching the behavior of gateway and CLI sessions. When the per-job primary model is unreachable, the agent should attempt the configured fallback before giving up.
Actual Behavior
When a cron job's per-job model endpoint is unreachable (e.g., a local LM Studio instance on a machine that rebooted overnight), the AIAgent stalls with message_count=0 and ended_at=None. No fallback model is attempted because self._fallback_chain is empty.
Affected Component
Agent Core (conversation loop, context compression, memory)
Messaging Platform (if gateway-related)
No response
Operating System
Linux (Ubuntu 24.04 / Windows 11 WSL2)
Python Version
Python 3.11.x
Hermes Version
latest as of April 9, 2026
Relevant Logs / Traceback
Root Cause Analysis (optional)
cron/scheduler.py line ~653 constructs AIAgent(...) without a fallback_model parameter. The _cfg dict from config.yaml is already loaded at line ~578 but fallback_model / fallback_providers is never read from it.
For comparison:
gateway/run.py lines 1010-1028: _load_fallback_model() reads cfg.get("fallback_providers") or cfg.get("fallback_model") and passes it at lines 4587, 4761, 6692.
cli.py lines 1492-1497: same pattern, reads from CLI_CONFIG and passes at lines 2462, 4837, 4972.
Proposed Fix (optional)
After the smart_routing load (~line 621), add:
# Fallback provider chain — mirrors gateway/run.py._load_fallback_model()
_fallback_model = _cfg.get("fallback_providers") or _cfg.get("fallback_model") or None
Then in the AIAgent constructor call (~line 653), add the fallback_model kwarg:
agent = AIAgent(
...
fallback_model=_fallback_model,
...
)
No other changes needed. The _cfg dict is already in scope and the AIAgent class already accepts fallback_model as an optional kwarg.
Are you willing to submit a PR for this?
Bug Description
The cron scheduler (
cron/scheduler.py) does not load or passfallback_modelfromconfig.yamlto theAIAgentconstructor. This means cron jobs have no fallback chain when the primary model endpoint is unreachable. The gateway (gateway/run.py) and CLI (cli.py) both correctly load and passfallback_model, so this is an inconsistency specific to cron.Steps to Reproduce
config.yamlwith a per-job model pointing to a local endpoint (e.g., a local LM Studio instance).AIAgentstalls withmessage_count=0andended_at=None— no fallback model is attempted.Expected Behavior
Cron jobs should respect the
fallback_model/fallback_providersconfiguration inconfig.yaml, matching the behavior of gateway and CLI sessions. When the per-job primary model is unreachable, the agent should attempt the configured fallback before giving up.Actual Behavior
When a cron job's per-job model endpoint is unreachable (e.g., a local LM Studio instance on a machine that rebooted overnight), the AIAgent stalls with
message_count=0andended_at=None. No fallback model is attempted becauseself._fallback_chainis empty.Affected Component
Agent Core (conversation loop, context compression, memory)
Messaging Platform (if gateway-related)
No response
Operating System
Linux (Ubuntu 24.04 / Windows 11 WSL2)
Python Version
Python 3.11.x
Hermes Version
latest as of April 9, 2026
Relevant Logs / Traceback
Root Cause Analysis (optional)
cron/scheduler.pyline ~653 constructsAIAgent(...)without afallback_modelparameter. The_cfgdict fromconfig.yamlis already loaded at line ~578 butfallback_model/fallback_providersis never read from it.For comparison:
gateway/run.pylines 1010-1028:_load_fallback_model()readscfg.get("fallback_providers") or cfg.get("fallback_model")and passes it at lines 4587, 4761, 6692.cli.pylines 1492-1497: same pattern, reads fromCLI_CONFIGand passes at lines 2462, 4837, 4972.Proposed Fix (optional)
After the
smart_routingload (~line 621), add:Then in the
AIAgentconstructor call (~line 653), add thefallback_modelkwarg:No other changes needed. The
_cfgdict is already in scope and theAIAgentclass already acceptsfallback_modelas an optional kwarg.Are you willing to submit a PR for this?