fix(cron): drop stale env-var override of persisted provider - #15769
Closed
dpaluy wants to merge 1 commit into
Closed
fix(cron): drop stale env-var override of persisted provider#15769dpaluy wants to merge 1 commit into
dpaluy wants to merge 1 commit into
Conversation
Cron jobs were passing os.getenv("HERMES_INFERENCE_PROVIDER") as the
"requested" arg to resolve_runtime_provider(), which short-circuited
the resolver's own precedence (explicit arg → persisted config → env)
and let stale shell/.env values outrank the user's saved provider.
Long-lived cron daemons inherit env from the shell that launched them,
so a since-changed provider (e.g. DeepSeek) could keep firing for jobs
that don't pin provider/model. Same bug class as f0b763c fixed for
the TUI /model switch.
Pass only job.get("provider") and let resolve_requested_provider fall
through to persisted config and env in the documented order.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Contributor
|
Salvaged via #19627 onto current main - your commit authorship was preserved. Thanks! |
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?
Cron jobs were passing
os.getenv("HERMES_INFERENCE_PROVIDER")as therequestedarg toresolve_runtime_provider(), which short-circuited the resolver's own precedence (explicit arg → persisted config → env) and let stale shell/.envvalues outrank the user's saved provider.Long-lived cron daemons inherit env from the shell that launched them, so a since-changed provider (e.g. DeepSeek) could keep firing for jobs that don't pin
provider/model. Same bug class as commitf0b763c74fixed for the TUI/modelswitch.The fix passes only
job.get("provider")and letsresolve_requested_providerfall through to persisted config and env in the documented order — restoring the precedence the resolver was designed around.Related Issue
N/A — surfaced while debugging cron jobs running on a stale provider after a
/modelswitch.Type of Change
Changes Made
cron/scheduler.py(run_job): dropor os.getenv("HERMES_INFERENCE_PROVIDER")from therequestedarg passed toresolve_runtime_provider(). Add a comment explaining the precedence inversion to prevent the line from being re-added.How to Test
export HERMES_INFERENCE_PROVIDER=deepseek./model(or by editingcli-config.yaml) to a different one, e.g.anthropic.provider:ormodel:on the job.deepseek(stale env wins).After this fix: the job runs against
anthropic(persisted config wins, env is consulted only as a final fallback).Checklist
Code
pytest tests/ -qand all tests pass — not run; change is a one-line precedence fix without existing coverage to breakresolve_runtime_providerprecedenceDocumentation & Housekeeping
cli-config.yaml.exampleunchanged