Skip to content

fix: recover saved custom provider model when provider=custom via base_url matching#12155

Open
seven-go-alt wants to merge 10 commits into
NousResearch:mainfrom
seven-go-alt:main
Open

fix: recover saved custom provider model when provider=custom via base_url matching#12155
seven-go-alt wants to merge 10 commits into
NousResearch:mainfrom
seven-go-alt:main

Conversation

@seven-go-alt

Copy link
Copy Markdown
 Summary                                                                                
 This PR fixes runtime provider resolution for bare `provider: custom` setups.          
                                                                                        
 When users save:                                                                       
 - `model.provider: custom`                                                             
 - `model.base_url: <custom-endpoint>`                                                  
                                                                                        
 runtime resolution should recover the corresponding saved custom provider entry        
 and its model.                                                                         
 Previously, matching could fail when one side used `/v1` and the other did not.        
                                                                                        
 What changed                                                                           
 - In `hermes_cli/runtime_provider.py`:                                                 
   - Added endpoint normalization for matching (`/v1`-agnostic comparison).             
   - Updated bare `custom` resolution to locate matching saved custom provider by       
 normalized `base_url`.                                                                 
   - Reused resolved custom entry fields (including model/api_mode/key_env when         
 available).                                                                            
 - In `tests/hermes_cli/test_runtime_provider_resolution.py`:                           
   - Added regression coverage for:                                                     
     - `model.provider=custom`                                                          
     - `model.base_url` without `/v1`                                                   
     - saved custom provider endpoint with `/v1`                                        
     - expected runtime model recovery from saved provider entry.                       
                                                                                        
 Why this is minimal/safe                                                               
 - No CLI UI behavior changes.                                                          
 - No provider listing/network fetch changes.                                           
 - No new config schema.                                                                
 - Strictly scoped to runtime resolution correctness for `custom`.                      
                                                                                        
 User impact                                                                            
 - Custom OpenAI-compatible endpoints become more reliable when switching/using         
 models through `provider: custom`.                                                     
 - Reduces config mismatch due to endpoint URL formatting differences. 

@alt-glitch alt-glitch added type/bug Something isn't working P2 Medium — degraded but workaround exists comp/cli CLI entry point, hermes_cli/, setup wizard area/config Config system, migrations, profiles labels Apr 23, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/config Config system, migrations, profiles comp/cli CLI entry point, hermes_cli/, setup wizard P2 Medium — degraded but workaround exists type/bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants