Skip to content

fix: honour HERMES_LLM_BASE_URL env var when provider-specific base_url_env_var is absent - #34002

Closed
OmarB97 wants to merge 0 commit into
NousResearch:mainfrom
OmarB97:main
Closed

fix: honour HERMES_LLM_BASE_URL env var when provider-specific base_url_env_var is absent#34002
OmarB97 wants to merge 0 commit into
NousResearch:mainfrom
OmarB97:main

Conversation

@OmarB97

@OmarB97 OmarB97 commented May 28, 2026

Copy link
Copy Markdown
Contributor

Why

MeshBoard's stream-tap launcher creates a per-dispatch HERMES_HOME sandbox whose .env sets HERMES_LLM_BASE_URL to a local proxy URL. Hermes was ignoring this because resolve_api_key_provider_credentials() only checked the provider's own base_url_env_var (e.g. OPENCODE_ZEN_BASE_URL), not the generic HERMES_LLM_BASE_URL fallback.

When the provider-specific env var is unset, fall back to HERMES_LLM_BASE_URL so the stream-tap proxy is actually used.

What changed

  • hermes_cli/auth.py: In both resolve_api_key_provider_credentials() and get_api_key_provider_status(), after checking pconfig.base_url_env_var, also check HERMES_LLM_BASE_URL as a fallback.

How to review

  1. Verify the two functions now check HERMES_LLM_BASE_URL when env_url is empty.
  2. Confirm this is a safe additive change — it only activates when the provider-specific env var is absent.

Evidence

Manual test with a sandbox .env containing HERMES_LLM_BASE_URL=http://127.0.0.1:58017/v1:

  • Before: resolve_api_key_provider_credentials("opencode-zen") returned base_url="https://opencode.ai/zen/v1"
  • After: returns base_url="http://127.0.0.1:58017/v1"

Verification

  • Syntax check passes (python -m py_compile hermes_cli/auth.py)
  • No behavioural change when HERMES_LLM_BASE_URL is unset
  • MeshBoard stream-tap diagnostic task tracks full fix chain

Risks / gaps

  • None — this is a pure fallback that only activates when the provider-specific base URL env var is absent.

Collaborators

  • Participants:
    • Omar (OmarB97) — author, fix
  • Reviewers: meshboard-autopilot

@alt-glitch alt-glitch added type/bug Something isn't working P3 Low — cosmetic, nice to have comp/cli CLI entry point, hermes_cli/, setup wizard area/auth Authentication, OAuth, credential pools area/config Config system, migrations, profiles labels May 28, 2026
@alt-glitch

Copy link
Copy Markdown
Collaborator

Related to #18757 (resolve_api_key_provider_credentials uses os.getenv for base_url_env_var) and #18948 (fix via get_env_value). Note: this PR shares a fork branch with closed PR #33996 — most files_changed are unrelated to the actual fix (only hermes_cli/auth.py changes are relevant).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/auth Authentication, OAuth, credential pools area/config Config system, migrations, profiles comp/cli CLI entry point, hermes_cli/, setup wizard P3 Low — cosmetic, nice to have type/bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants