fix(auth): use get_env_value for base_url_env_var instead of os.getenv (#18757)#18797
Closed
shellybotmoyer wants to merge 1 commit into
Closed
fix(auth): use get_env_value for base_url_env_var instead of os.getenv (#18757)#18797shellybotmoyer wants to merge 1 commit into
shellybotmoyer wants to merge 1 commit into
Conversation
…v (issue NousResearch#18757) os.getenv() does not read ~/.hermes/.env, causing providers with custom base URLs stored only in .env to fall back to incorrect registry defaults. Now consistent with api_key resolution which already uses get_env_value(). Fixes NousResearch#18757
This was referenced May 2, 2026
Contributor
Author
|
Superseded by #23352 (rebased + expanded to also fix doctor.py). Closing to keep the PR list clean. |
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.
Fix #18757: Use
get_env_value()forbase_url_env_varinstead ofos.getenv()Problem
resolve_api_key_provider_credentials()inhermes_cli/auth.pyresolvesbase_url_env_varusingos.getenv(), which does not read from~/.hermes/.env. Providers with a custom base URL stored only in.env(not exported in the shell environment) silently fall back to the wrong endpoint — the defaultinference_base_urlfromPROVIDER_REGISTRY.Fix
os.getenv()withget_env_value()forbase_url_env_varinauth.py(4 sites) andruntime_provider.py(1 site)~/.hermes/.envare properly resolvedTesting
base_url_env_varset in~/.hermes/.envnow correctly resolve their custom endpointsget_env_value()already handles bothos.environand.envfile lookups