Skip to content

fix(runtime): honor NOUS_INFERENCE_BASE_URL across pool/explicit/aux paths (salvage #55198) - #56122

Merged
teknium1 merged 1 commit into
mainfrom
salvage/nous-inference-url-all-paths
Jul 1, 2026
Merged

teknium1 merged 1 commit into
mainfrom
salvage/nous-inference-url-all-paths

Conversation

@benbarclay

Copy link
Copy Markdown
Contributor

What this is

Salvage of #55198 by @counterposition (Harish Kukreja) onto an org-owned branch. His commit is cherry-picked verbatim (authorship preserved); this PR exists only so the arm64 Docker build gets a token with packages: write.

Why salvage instead of a re-run: #55198 is a fork PR (counterposition/hermes-agent). Its Build&Test Docker image / build-arm64 check fails with denied: installation not allowed to Write organization package — fork PRs get a read-only GITHUB_TOKEN for org packages by design, so re-running the fork PR fails identically every time. Every other check on #55198 is green (all 8 test slices, e2e, ruff, ty, uv.lock). Running the same commit from an org branch clears the package-write permission.

The fix (unchanged from #55198)

#52270 added _nous_inference_env_override() so NOUS_INFERENCE_BASE_URL can point a Nous OAuth session at a self-hosted / staging inference endpoint, but only wired it into resolve_nous_runtime_credentials. Three sibling resolution paths still dropped the override:

  • credential pool_resolve_runtime_from_pool_entry (hermes_cli/runtime_provider.py)
  • explicit provider_resolve_explicit_runtime (hermes_cli/runtime_provider.py)
  • auxiliary side-LLM client_pool_runtime_base_url (agent/auxiliary_client.py)

This routes all three through the same auth-layer reader, so every NOUS_INFERENCE_BASE_URL read shares one normalization + trusted-bypass path. Live-only invariant preserved: the override wins for the base URL returned this run but is never persisted to auth.json or the credential pool.

Verification

Cherry-picked cleanly onto current main (56d4bfe4b). PR's own suites re-run on the merged tree: 97 passed (tests/hermes_cli/test_runtime_provider_resolution.py, test_auth_nous_provider.py, tests/agent/test_auxiliary_client.py), including the pool/explicit/aux override tests and the live-not-persisted invariant.

Attribution

Co-authored-by preserved from the original commit. Full credit to @counterposition — closing #55198 in favour of this once merged.

Salvages #55198.

…paths

Upstream #52270 added `_nous_inference_env_override()` but wired it into
only `resolve_nous_runtime_credentials`. Three sibling resolution paths
still ignored the override, so a self-hosted Nous inference endpoint set
via `NOUS_INFERENCE_BASE_URL` was silently dropped whenever credentials
arrived through any of them:

- the credential-pool path (`_resolve_runtime_from_pool_entry`)
- the explicit-provider path (`_resolve_explicit_runtime`)
- the auxiliary side-LLM client (`_pool_runtime_base_url`)

Route all three through the same auth-layer reader so every
`NOUS_INFERENCE_BASE_URL` read shares one normalization path
(trailing-slash stripping, blank -> empty) and the documented
trusted-bypass intent stays in one place. The override is live-only: it
wins for the base URL returned this run but is never persisted to
auth.json or the credential pool, so an ephemeral dev/staging value
cannot poison durable auth state.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@alt-glitch alt-glitch added type/bug Something isn't working comp/cli CLI entry point, hermes_cli/, setup wizard comp/agent Core agent runtime: loop, agent_init, prompt builder, context-compression, responses endpoint area/auth Authentication, OAuth, credential pools provider/nous Nous Research API (OAuth) sweeper:risk-security-boundary Sweeper risk: may affect sandboxing, auth, credentials, or sensitive data P2 Medium — degraded but workaround exists labels Jul 1, 2026
@alt-glitch

Copy link
Copy Markdown
Contributor

This was generated by AI during triage.

Salvage of #55198 by @counterposition onto an org-owned branch (commit cherry-picked verbatim, authorship preserved) — exists so the arm64 Docker build gets a packages: write token that fork PRs are denied. Related, not duplicate. Completes the partial wiring merged in #52270; related to #49735 (refresh-heal).

@teknium1
teknium1 merged commit 01bf61c into main Jul 1, 2026
31 checks passed
@teknium1
teknium1 deleted the salvage/nous-inference-url-all-paths branch July 1, 2026 08:52
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 comp/agent Core agent runtime: loop, agent_init, prompt builder, context-compression, responses endpoint comp/cli CLI entry point, hermes_cli/, setup wizard P2 Medium — degraded but workaround exists provider/nous Nous Research API (OAuth) sweeper:risk-security-boundary Sweeper risk: may affect sandboxing, auth, credentials, or sensitive data type/bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants