Skip to content

fix(setup): preserve provider metadata during model selection#856

Closed
kshitijk4poor wants to merge 1 commit intoNousResearch:mainfrom
kshitijk4poor:fix/issue-853-provider-config
Closed

fix(setup): preserve provider metadata during model selection#856
kshitijk4poor wants to merge 1 commit intoNousResearch:mainfrom
kshitijk4poor:fix/issue-853-provider-config

Conversation

@kshitijk4poor
Copy link
Contributor

Summary

  • fix the setup wizard so provider metadata written during provider selection is preserved in the in-memory model config instead of being clobbered by the final save_config(config)
  • cover the regression with hermetic setup tests for the Nous API flow, the Nous OAuth keep-current-model flow, and custom endpoint switching away from an active OAuth provider
  • address the fresh-install misconfiguration behind issue [Bug]: Telegram Bot not responding at all #853, where Telegram/CLI runs could end up with broken Nous routing after setup and then fail to respond correctly

Root cause

During hermes setup, provider selection updated config.yaml directly via _update_config_for_provider(...), but later the wizard saved a stale in-memory config object back to disk. That final save could drop model.provider / model.base_url (and in the OAuth keep-current path, model.default), leaving fresh installs misconfigured.

Test plan

  • python -m pytest tests/hermes_cli/test_setup.py tests/test_auth_nous_provider.py tests/test_cli_provider_resolution.py tests/hermes_cli/test_config.py -q
  • python -m pytest tests/ -q -k \"not vision_tools\"

Issue

Closes #853

@teknium1
Copy link
Contributor

Merged via 4525933. Thanks @kshitijk4poor — thorough fix with good test coverage.

Audited the rest of the codebase for the same stale-config-overwrite pattern:

  • hermes_cli/main.py: Safe — all model flow functions do fresh load_config() before save_config()
  • gateway/run.py: Safe — doesn't use _update_config_for_provider or save_config for model changes
  • hermes_cli/tools_config.py: Safe — never touches model config
  • hermes_cli/auth.py: Safe — doesn't hold a stale config dict

The bug was fully isolated to setup.py. Your fix covers all 9 provider paths.

@teknium1 teknium1 closed this Mar 11, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: Telegram Bot not responding at all

3 participants