fix: root-level provider in config.yaml no longer overrides model.provider#4329
Merged
Conversation
…vider load_cli_config() had a priority inversion: a stale root-level 'provider' key in config.yaml would OVERRIDE the canonical 'model.provider' set by 'hermes model'. The gateway reads model.provider directly from YAML and worked correctly, but 'hermes chat -q' and the interactive CLI went through the merge logic and picked up the stale root-level key. Fix: root-level provider/base_url are now only used as a fallback when model.provider/model.base_url is not set (never as an override). Also added _normalize_root_model_keys() to config.py load_config() and save_config() — migrates root-level provider/base_url into the model section and removes the root-level keys permanently. Reported by (≧▽≦) in Discord: opencode-go provider persisted as a root-level key and overrode the correct model.provider=openrouter, causing 401 errors.
teknium1
added a commit
that referenced
this pull request
Apr 4, 2026
… diagnostics Provider coverage: - Add 6 missing providers to _PROVIDER_ENV_HINTS (Nous, DeepSeek, DashScope, HF, OpenCode Zen/Go) - Add 5 missing providers to API connectivity checks (DeepSeek, Hugging Face, Alibaba/DashScope, OpenCode Zen, OpenCode Go) New diagnostics: - Config version check — detects outdated config, --fix runs non-interactive migration automatically - Stale root-level config keys — detects provider/base_url at root level (known bug source, PR #4329), --fix migrates them into the model section - WAL file size check — warns on >50MB WAL files (indicates missed checkpoints from the duplicate close() bug), --fix runs PASSIVE checkpoint - Mem0 memory plugin status — checks API key resolution including the env+json merge we just fixed
teknium1
added a commit
that referenced
this pull request
Apr 4, 2026
… diagnostics (#5077) Provider coverage: - Add 6 missing providers to _PROVIDER_ENV_HINTS (Nous, DeepSeek, DashScope, HF, OpenCode Zen/Go) - Add 5 missing providers to API connectivity checks (DeepSeek, Hugging Face, Alibaba/DashScope, OpenCode Zen, OpenCode Go) New diagnostics: - Config version check — detects outdated config, --fix runs non-interactive migration automatically - Stale root-level config keys — detects provider/base_url at root level (known bug source, PR #4329), --fix migrates them into the model section - WAL file size check — warns on >50MB WAL files (indicates missed checkpoints from the duplicate close() bug), --fix runs PASSIVE checkpoint - Mem0 memory plugin status — checks API key resolution including the env+json merge we just fixed
naoironman-hue
pushed a commit
to naoironman-hue/hermes-agent
that referenced
this pull request
Apr 5, 2026
… diagnostics (NousResearch#5077) Provider coverage: - Add 6 missing providers to _PROVIDER_ENV_HINTS (Nous, DeepSeek, DashScope, HF, OpenCode Zen/Go) - Add 5 missing providers to API connectivity checks (DeepSeek, Hugging Face, Alibaba/DashScope, OpenCode Zen, OpenCode Go) New diagnostics: - Config version check — detects outdated config, --fix runs non-interactive migration automatically - Stale root-level config keys — detects provider/base_url at root level (known bug source, PR NousResearch#4329), --fix migrates them into the model section - WAL file size check — warns on >50MB WAL files (indicates missed checkpoints from the duplicate close() bug), --fix runs PASSIVE checkpoint - Mem0 memory plugin status — checks API key resolution including the env+json merge we just fixed
Tommyeds
pushed a commit
to Tommyeds/hermes-agent
that referenced
this pull request
Apr 12, 2026
… diagnostics (NousResearch#5077) Provider coverage: - Add 6 missing providers to _PROVIDER_ENV_HINTS (Nous, DeepSeek, DashScope, HF, OpenCode Zen/Go) - Add 5 missing providers to API connectivity checks (DeepSeek, Hugging Face, Alibaba/DashScope, OpenCode Zen, OpenCode Go) New diagnostics: - Config version check — detects outdated config, --fix runs non-interactive migration automatically - Stale root-level config keys — detects provider/base_url at root level (known bug source, PR NousResearch#4329), --fix migrates them into the model section - WAL file size check — warns on >50MB WAL files (indicates missed checkpoints from the duplicate close() bug), --fix runs PASSIVE checkpoint - Mem0 memory plugin status — checks API key resolution including the env+json merge we just fixed
angelburgosrosado
pushed a commit
to angelburgosrosado/hermes-agent
that referenced
this pull request
Apr 27, 2026
… diagnostics (NousResearch#5077) Provider coverage: - Add 6 missing providers to _PROVIDER_ENV_HINTS (Nous, DeepSeek, DashScope, HF, OpenCode Zen/Go) - Add 5 missing providers to API connectivity checks (DeepSeek, Hugging Face, Alibaba/DashScope, OpenCode Zen, OpenCode Go) New diagnostics: - Config version check — detects outdated config, --fix runs non-interactive migration automatically - Stale root-level config keys — detects provider/base_url at root level (known bug source, PR NousResearch#4329), --fix migrates them into the model section - WAL file size check — warns on >50MB WAL files (indicates missed checkpoints from the duplicate close() bug), --fix runs PASSIVE checkpoint - Mem0 memory plugin status — checks API key resolution including the env+json merge we just fixed
angelburgosrosado
pushed a commit
to angelburgosrosado/hermes-agent
that referenced
this pull request
Apr 28, 2026
… diagnostics Provider coverage: - Add 6 missing providers to _PROVIDER_ENV_HINTS (Nous, DeepSeek, DashScope, HF, OpenCode Zen/Go) - Add 5 missing providers to API connectivity checks (DeepSeek, Hugging Face, Alibaba/DashScope, OpenCode Zen, OpenCode Go) New diagnostics: - Config version check — detects outdated config, --fix runs non-interactive migration automatically - Stale root-level config keys — detects provider/base_url at root level (known bug source, PR NousResearch#4329), --fix migrates them into the model section - WAL file size check — warns on >50MB WAL files (indicates missed checkpoints from the duplicate close() bug), --fix runs PASSIVE checkpoint - Mem0 memory plugin status — checks API key resolution including the env+json merge we just fixed
02356abc
pushed a commit
to 02356abc/hermes-agent
that referenced
this pull request
May 14, 2026
… diagnostics (NousResearch#5077) Provider coverage: - Add 6 missing providers to _PROVIDER_ENV_HINTS (Nous, DeepSeek, DashScope, HF, OpenCode Zen/Go) - Add 5 missing providers to API connectivity checks (DeepSeek, Hugging Face, Alibaba/DashScope, OpenCode Zen, OpenCode Go) New diagnostics: - Config version check — detects outdated config, --fix runs non-interactive migration automatically - Stale root-level config keys — detects provider/base_url at root level (known bug source, PR NousResearch#4329), --fix migrates them into the model section - WAL file size check — warns on >50MB WAL files (indicates missed checkpoints from the duplicate close() bug), --fix runs PASSIVE checkpoint - Mem0 memory plugin status — checks API key resolution including the env+json merge we just fixed
olympus-terminal
pushed a commit
to olympus-terminal/hermes-agent
that referenced
this pull request
May 16, 2026
… diagnostics (NousResearch#5077) Provider coverage: - Add 6 missing providers to _PROVIDER_ENV_HINTS (Nous, DeepSeek, DashScope, HF, OpenCode Zen/Go) - Add 5 missing providers to API connectivity checks (DeepSeek, Hugging Face, Alibaba/DashScope, OpenCode Zen, OpenCode Go) New diagnostics: - Config version check — detects outdated config, --fix runs non-interactive migration automatically - Stale root-level config keys — detects provider/base_url at root level (known bug source, PR NousResearch#4329), --fix migrates them into the model section - WAL file size check — warns on >50MB WAL files (indicates missed checkpoints from the duplicate close() bug), --fix runs PASSIVE checkpoint - Mem0 memory plugin status — checks API key resolution including the env+json merge we just fixed
gweeteve
pushed a commit
to gweeteve/hermes-agent
that referenced
this pull request
Jun 2, 2026
… diagnostics (NousResearch#5077) Provider coverage: - Add 6 missing providers to _PROVIDER_ENV_HINTS (Nous, DeepSeek, DashScope, HF, OpenCode Zen/Go) - Add 5 missing providers to API connectivity checks (DeepSeek, Hugging Face, Alibaba/DashScope, OpenCode Zen, OpenCode Go) New diagnostics: - Config version check — detects outdated config, --fix runs non-interactive migration automatically - Stale root-level config keys — detects provider/base_url at root level (known bug source, PR NousResearch#4329), --fix migrates them into the model section - WAL file size check — warns on >50MB WAL files (indicates missed checkpoints from the duplicate close() bug), --fix runs PASSIVE checkpoint - Mem0 memory plugin status — checks API key resolution including the env+json merge we just fixed
Egavasyug
pushed a commit
to Egavasyug/hermes-agent
that referenced
this pull request
Jun 10, 2026
… diagnostics (NousResearch#5077) Provider coverage: - Add 6 missing providers to _PROVIDER_ENV_HINTS (Nous, DeepSeek, DashScope, HF, OpenCode Zen/Go) - Add 5 missing providers to API connectivity checks (DeepSeek, Hugging Face, Alibaba/DashScope, OpenCode Zen, OpenCode Go) New diagnostics: - Config version check — detects outdated config, --fix runs non-interactive migration automatically - Stale root-level config keys — detects provider/base_url at root level (known bug source, PR NousResearch#4329), --fix migrates them into the model section - WAL file size check — warns on >50MB WAL files (indicates missed checkpoints from the duplicate close() bug), --fix runs PASSIVE checkpoint - Mem0 memory plugin status — checks API key resolution including the env+json merge we just fixed
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.
Summary
Root-level
providerin config.yaml was silently overridingmodel.provider, causing the CLI to use a stale provider while the gateway worked correctly.The bug:
load_cli_config()(cli.py L266-276) merged root-levelprovider/base_urlAFTERmodel.providerwas set from the config file, overwriting the canonical value:Result: Gateway used
openrouter(correct, readsmodel.providerdirectly). CLI usedopencode-go(wrong, merge logic overwrote it). User saw 401 errors from the wrong provider.Fix
cli.py— Flipped priority: root-levelprovider/base_urlare now only a fallback whenmodel.provider/model.base_urlis not already set. They never override an existing value.hermes_cli/config.py— Added_normalize_root_model_keys()that:provider/base_urlinto themodelsection (as fallback only)load_config()andsave_config()— saves permanently clean up stale keys on diskTests (4 new)
test_model_provider_wins_over_root_provider— the exact bug scenariotest_root_provider_ignored_when_default_model_provider_exists— defaultautois never overriddentest_normalize_root_model_keys_moves_to_model— migration logictest_normalize_root_model_keys_does_not_override_existing— existing values preservedFull suite: 7223/7452 pass (11 failures are pre-existing, none in config/CLI area).