Skip to content

fix(cron): expand refs in config.yaml during job execution#19872

Merged
teknium1 merged 1 commit into
mainfrom
hermes/hermes-8c54fd4a
May 4, 2026
Merged

fix(cron): expand refs in config.yaml during job execution#19872
teknium1 merged 1 commit into
mainfrom
hermes/hermes-8c54fd4a

Conversation

@teknium1
Copy link
Copy Markdown
Contributor

@teknium1 teknium1 commented May 4, 2026

Salvage of #15897 onto current main.

Summary

run_job() loads config.yaml directly via yaml.safe_load but skips the _expand_env_vars() step that load_config() does on the CLI path. ${HERMES_MODEL}, ${OPENROUTER_FALLBACK_MODEL}, and similar env refs in config.yaml stayed unresolved in cron runs — jobs picked up literal ${VAR} strings as model names and 404'd. Call _expand_env_vars() after loading so cron sees the same expanded config the CLI does.

Validation

scripts/run_tests.sh tests/cron/test_scheduler.py -k expand_env -> passed

Original PR: #15897

…15890)

The cron scheduler's run_job() loaded config.yaml with yaml.safe_load()
but never called _expand_env_vars(), so ${HERMES_MODEL} and similar
references in model:, fallback_providers:, and other config.yaml fields
were forwarded to the LLM API as literal strings, causing HTTP 400 errors.

The normal CLI path has always called _expand_env_vars() via load_config(),
so this was a cron-only gap. The .env load at the top of run_job() already
populates os.environ before config.yaml is read, so the expansion sees the
correct values.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@teknium1 teknium1 merged commit 75bce31 into main May 4, 2026
7 of 10 checks passed
@teknium1 teknium1 deleted the hermes/hermes-8c54fd4a branch May 4, 2026 19:35
@alt-glitch alt-glitch added type/bug Something isn't working P2 Medium — degraded but workaround exists comp/cron Cron scheduler and job management area/config Config system, migrations, profiles labels May 4, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/config Config system, migrations, profiles comp/cron Cron scheduler and job management P2 Medium — degraded but workaround exists type/bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants