fix: setup wizard overwrites custom endpoint config with OpenRouter defaults#3688
Open
patlegu wants to merge 1 commit intoNousResearch:mainfrom
Open
fix: setup wizard overwrites custom endpoint config with OpenRouter defaults#3688patlegu wants to merge 1 commit intoNousResearch:mainfrom
patlegu wants to merge 1 commit intoNousResearch:mainfrom
Conversation
_model_flow_custom() loads and saves its own config copy independently. When called from setup_model_provider(), the final save_config(config) was overwriting the custom endpoint settings with stale OpenRouter defaults. Reload config after _model_flow_custom returns so the caller's copy reflects the saved changes before the final write.
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.
Problem
When selecting Custom OpenAI-compatible endpoint in the setup wizard, the settings entered by the user (base URL, model name) are silently overwritten by the OpenRouter defaults after the wizard completes.
Symptoms:
~/.hermes/config.yamlends up with:instead of the user-provided values (e.g.
http://localhost:11434/v1+ local model).Root Cause
_model_flow_custom()(main.py) loads its own independent copy of config viaload_config(), applies the custom endpoint settings, and saves it. However, the callersetup_model_provider()(setup.py) holds a separateconfigdict loaded at wizard startup. The finalsave_config(config)call at line 1802 ofsetup.pyoverwrites everything_model_flow_custom()just saved.Fix
Reload config in
setup.pyimmediately after_model_flow_custom()returns, so the caller's copy reflects the saved changes before the final write.One line added, no refactoring.
_model_flow_custom()logic is untouched.Reproduction
hermes setuphttp://localhost:11434/v1as base URL,ollamaas API key,qwen2.5-coder:14bas modelcat ~/.hermes/config.yaml→model.base_urlis stillhttps://openrouter.ai/api/v1Tested with Ollama on WSL2.