fix: setup wizard overwrites custom endpoint config with OpenRouter defaults#3688
fix: setup wizard overwrites custom endpoint config with OpenRouter defaults#3688patlegu wants to merge 1 commit into
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.
|
Pretty sure #4180 already addressed this — the custom flow now syncs the in-memory config dict before the wizard's final save. |
|
Likely duplicate of #4180 (merged) — same root cause: _model_flow_custom() saves config independently but caller in setup.py overwrites with stale copy. |
1 similar comment
|
Likely duplicate of #4180 (merged) — same root cause: _model_flow_custom() saves config independently but caller in setup.py overwrites with stale copy. |
|
Closed in favour of @stepanov1975's broader PR #22074, which was salvaged onto current main via #28882. Your fix correctly identified the bug but was narrower (only the custom path); #22074's |
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.