Skip to content

[Ollama-local] Gateway routing proxy does not inject NEMOCLAW_OLLAMA_PROXY_TOKEN as Bearer on :11435 — silent hang on clean machine (continuation of #2519) #3198

Closed as not planned

Description

@jyaunches

Description

Continuation of #2519. PR #2580 landed the wizard-side fix (stopped capturing host OPENAI_API_KEY for ollama-local, switched gateway config to NEMOCLAW_OLLAMA_PROXY_TOKEN), which resolved the original HTTP 401 symptom. However, the runtime credential-injection path in the routing proxy is still broken: the gateway routes ollama-local requests to :11435 but never injects NEMOCLAW_OLLAMA_PROXY_TOKEN as a Bearer header. On a clean machine with no OPENAI_API_KEY at all, the failure mode shifts from an explicit 401 to a silent hang — nemoclaw status reports healthy, the TUI spins indefinitely, and the sandbox logs show NET:FAIL [LOW] inference.local:443 every ~15s.

Reproduced by @hulynn on nemoclaw v0.0.31 (see verbatim repro below).

Scope vs. #2519

Scope Status
Wizard captures host OPENAI_API_KEY and bleeds it into ollama-local bearer → HTTP 401 ✅ Fixed by PR #2580 (closed as #2519)
Gateway registers NEMOCLAW_OLLAMA_PROXY_TOKEN but does not inject it as Bearer when routing to :11435 → silent hang 🔴 This issue

Repro (from @hulynn, v0.0.31, verbatim)

[Repro] v0.0.31, no OPENAI_API_KEY, clean machine

Reproduced on nemoclaw v0.0.31 (Brev cloud, Ubuntu 22.04, A100-SXM4-80GB, Ollama v0.22.0, model qwen2.5:0.5b).

Trigger: No OPENAI_API_KEY set. Wizard shows API key: (not required for ollama-local) — nothing stored in credentials.json. Onboard completes, nemoclaw status reports Inference: healthy. TUI spins indefinitely, no response.

Sandbox logs:

[openshell_router] routing proxy inference request
  endpoint=http://host.openshell.internal:11435/v1 path=/v1/chat/completions
[sandbox] NET:FAIL [LOW] inference.local:443   ← repeats every ~15s

Host:

$ curl http://localhost:11435/
HTTP 401 Unauthorized

The gateway routes to :11435 but injects no Authorization header. openshell provider get ollama-local shows NEMOCLAW_OLLAMA_PROXY_TOKEN as the credential key, but it is never injected as Bearer when routing.

Environment

  • NemoClaw: v0.0.31
  • Platform: Brev cloud, Ubuntu 22.04, A100-SXM4-80GB
  • Ollama: v0.22.0, model qwen2.5:0.5b
  • No OPENAI_API_KEY set in host env
  • Clean machine — no pre-existing credentials.json entry for OPENAI_API_KEY

Expected Result

Routing proxy injects NEMOCLAW_OLLAMA_PROXY_TOKEN as Authorization: Bearer <token> on every ollama-local forward to :11435. Gateway-side Ollama proxy accepts the token. Agent calls succeed end-to-end.

Actual Result

  • nemoclaw status: Inference: healthy (the liveness probe at http://127.0.0.1:11434/api/tags passes because it hits Ollama directly, bypassing the gateway route).
  • TUI shows "kerfuffling" / "conjuring" indefinitely on any prompt.
  • Sandbox logs show repeated NET:FAIL [LOW] inference.local:443 events.
  • Direct curl http://localhost:11435/ → HTTP 401 Unauthorized, confirming the :11435 proxy validates a Bearer the routing proxy never sends.

Suspected Root Cause

The runtime routing proxy (openshell_router) does not read the provider's registered credentialEnv (now NEMOCLAW_OLLAMA_PROXY_TOKEN after PR #2580) and inject it as an Authorization: Bearer header when forwarding to :11435. Config says the right thing; the HTTP layer doesn't act on it.

Likely candidate paths to audit:

  • openshell_router credential-injection middleware — confirm it resolves credentialEnv → env var → Bearer for all registered providers, not just ones with a non-null credentialEnv and a legacy OPENAI_API_KEY-style name.
  • Whether the :11435 proxy's expected token name matches what the gateway reads from NEMOCLAW_OLLAMA_PROXY_TOKEN.

References

Activity

  1. self-assigned this
    on May 7, 2026
  2. jyaunches commented on May 8, 2026

    @jyaunches
    ContributorAuthor

    Closing this out — summary and follow-ups below. @hulynn — please drop a comment confirming you agree with this disposition, or reopen if your environment still reproduces after upgrading past v0.0.31.

    What we confirmed

    Executed the full sandbox → openshell gateway → auth proxy (:11435) → Ollama path via https://inference.local/v1/chat/completions against main HEAD (a4a9eb0cd) on an NVIDIA NVKS GPU runner on 2026-05-08: the assertion returned PONG in 0.4 seconds. See run 25531094105, Phase 5b:

    01:31:08Z   PASS: [LOCAL] Sandbox inference: Ollama responded through sandbox
                → Full path proven: sandbox → openshell gateway → auth proxy (:11435) → Ollama GPU
    

    So the exact failure mode this issue describes (silent hang + no Authorization: Bearer on the outbound :11435 request) is not reproducible on current main in that environment.

    Why we're not bisecting v0.0.31

    57 commits landed between v0.0.31 (2026-04-29) and current main that touch the ollama / inference / onboard paths. Without a live repro environment and with the fix direction already captured as detection work, investing in a bisect for a bug that no longer reproduces is a poor trade. If @hulynn or anyone else still reproduces this on v0.0.36+ / latest, that's the signal to dig in — please reopen with a fresh repro in that case.

    What surfaced during investigation, tracked separately

    Two sibling bugs identified during the #3198 deep-dive, both added to Sprint 4 - Spark Joy:

    • re-enable e2e-gpu nightly test #3263 — re-enable e2e-gpu nightly test. The gpu-e2e job has never run on a scheduled nightly — it was gated on vars.GPU_E2E_ENABLED which was never set to true. First run against main today (25531094105) passed the critical inference assertion but hung 17+ minutes in the destroy phase, which blocks enabling on schedule. re-enable e2e-gpu nightly test #3263 tracks fixing the destroy hang, re-enabling the gate, and adding guardrails so it can't silently go dark again.
    • nemoclaw status reports 'Inference: healthy' by probing Ollama directly on :11434 — bypasses auth proxy (:11435) and gateway #3265 — nemoclaw status reports Inference: healthy by probing Ollama directly on :11434. The status probe bypasses both the auth proxy (:11435) and the gateway, so any break in those hops (including this exact issue's failure mode) still reports green. Independent of whether this issue's root cause is ever found, the false-positive probe is itself a bug. Change to a two-line probe (backend + auth proxy with Bearer) so future regressions in this path are visible at nemoclaw status / doctor time.

    Additionally, #3253 (filed independently by @hulynn today) tracks the onboard-time inference probe — an end-of-onboard chat.completions.create round-trip that would catch this entire class of silent-config-bug failures before the user ever hits the TUI. That issue's scope is broader than just ollama-local (it covers Model Router, NIM, etc.) so item B from our original #3198 plan is folded into that issue rather than tracked here.

    Also closed stale community PR #1759 ("fix: verify local inference route during onboarding") — its underlying issue #1750 was closed as completed on 2026-04-16 without the PR merging, and #3253 supersedes it with broader scope.

    Net: disposition on this issue

    Closing. @hulynn please confirm you agree, or flag if you want the issue kept open until you've re-tested on a version past v0.0.31.

  3. added
    area: cliCommand line interface, flags, terminal UX, or output
    area: local-modelsLocal model providers, downloads, launch, or connectivity
    area: providersInference provider integrations and provider behavior
    and removed on Jun 3, 2026
  4. added theissue type on Jun 8, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

NV QABugs found by the NVIDIA QA Teamarea: cliCommand line interface, flags, terminal UX, or outputarea: local-modelsLocal model providers, downloads, launch, or connectivityarea: providersInference provider integrations and provider behaviorprovider: ollamaOllama local model provider behavior

Type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions