Skip to content

fix(inference): share the Ollama auth-proxy token across gateway ports - #8736

Open
laitingsheng wants to merge 1 commit into
mainfrom
fix/ollama-proxy-token-gateway-scope
Open

fix(inference): share the Ollama auth-proxy token across gateway ports#8736
laitingsheng wants to merge 1 commit into
mainfrom
fix/ollama-proxy-token-gateway-scope

Conversation

@laitingsheng

@laitingsheng laitingsheng commented Aug 10, 2026

Copy link
Copy Markdown
Contributor

Summary

The Ollama auth proxy binds one host port for every gateway, but its token lived under the gateway-scoped state root. Onboarding a second gateway port found no token in its own root, minted a replacement, killed the running proxy, and rebound the shared port with the new token, so sandboxes on the first gateway got HTTP 401 on every inference request while still reporting phase: Ready. The proxy's token, backend URL, PID, and status files now live in a root shared by every gateway on the host, so a second gateway reuses the token the running proxy already holds.

Related Issue

Fixes #8704

Changes

  • Add resolveSharedLocalAdapterStateRoot() and SHARED_LOCAL_ADAPTER_STATE_DIR in src/lib/inference/local-adapter-lifecycle.ts, and read the Ollama proxy token, backend URL, PID, and status files from it in src/lib/inference/ollama/proxy.ts. The helper pins DEFAULT_GATEWAY_PORT rather than taking the selected port, because nemoclawStateRoot maps that port to the top-level ~/.nemoclaw location; keying on the running listener instead of the calling gateway is the whole point of the fix. NEMOCLAW_OLLAMA_PROXY_PORT is host-wide by design, so one host has one proxy and must have one token.
  • Adopt a token an earlier gateway-scoped run left behind (adoptGatewayScopedProxyToken). Current consumer: a host that already onboarded a non-default gateway port with Local Ollama. Without it, the first run after this change would find an empty shared root, mint a token, and break the sandbox that works today — reintroducing this same defect during the upgrade. It copies the token to the shared root on first read so repeated runs converge instead of re-reading the old path. Protected by adopts a token an earlier gateway-scoped run left behind (#8704).
  • Stop relocating ollama-proxy-token and ollama-auth-proxy.pid during a legacy port migration in src/lib/state/legacy-port-migration.ts. Those names stay in LEGACY_BUNDLE_ENTRIES so a migration intent recorded by an earlier release still validates and resumes; a new MIGRATABLE_BUNDLE_ENTRIES excludes them from the entries a new migration moves and from the ambiguous-state warning.
  • Read the shared root in defaultLoadOllamaProxyToken in src/lib/inference/local.ts. This reader was missed in the first pass: on a host onboarded fresh under a non-default gateway port, no gateway-scoped token is written any more, so probeOllamaAuthProxyHealth returned null and the Inference (auth proxy) line silently disappeared from status and doctor. This inverts the existing local.test.ts expectation, which pinned the gateway-scoped read; that test now asserts the shared read.
  • Treat the four proxy files as shared host state during uninstall in src/lib/actions/uninstall/run-plan.ts, alongside the existing HTTPS_PIN_RUNTIME_ADAPTER_STATE_ENTRIES precedent. Two consequences of the state move needed this: a host that only ever onboarded a non-default gateway would otherwise have shared-root entries that inspectOtherGatewayEnvironments reads as proof of a default-port environment, making NEMOCLAW_GATEWAY_PORT=<port> nemoclaw uninstall report a gateway 8080 that was never created; and a gateway-scoped uninstall would stop the proxy its sibling gateways still use, because the shared PID file is now always current. A scoped run now preserves the proxy and says so.
  • Lower the src/lib/state/state-root.ts fan-in budget in ci/source-architecture-budget.json from 21 to 20. local.ts no longer imports nemoclawStateRoot directly, so npm run checks:repository required the stale limit be lowered to the measured value.
  • Update docs/inference/set-up-ollama.mdx, docs/reference/architecture.mdx, docs/reference/host-files-and-state.mdx, and docs/reference/commands.mdx for the shared-proxy model, including the restart and failure behaviour of onboarding a second gateway port and the wider blast radius of deleting the token file.

Type of Change

  • Code change (feature, bug fix, or refactor)
  • Code change with doc updates
  • Doc only (prose changes, no code sample modifications)
  • Doc only (includes code sample changes)

Quality Gates

  • Tests added or updated for changed behavior
  • Existing tests cover changed behavior — justification:
  • Tests not applicable — justification:
  • Docs updated for user-facing behavior changes
  • Docs not applicable — justification:
  • Sensitive paths changed (security, policy, credentials, preflight, onboarding, inference, runner, sandbox, or messaging)
  • Sensitive-path review completed or maintainer-approved waiver recorded — reviewer/approval link/justification: no maintainer security review yet. This change widens the read and write scope of a 0600 auth token from one gateway's state root to a root shared by every gateway on the host. That is the correct scope for a listener every gateway already reaches on one port, but it is a deliberate widening and a maintainer should confirm it. Uninstall behaviour for the same files also changed, and the proxy token file is now longer-lived across gateway lifecycles.
  • Non-success, skipped, or missing CI check accepted by maintainer — check name, approval link, and follow-up issue:

Documentation Writer Review

  • Documentation writer subagent reviewed the completed changes
  • Result: docs-updated
  • Evidence: docs/inference/set-up-ollama.mdx; docs/reference/architecture.mdx; docs/reference/host-files-and-state.mdx; docs/reference/commands.mdx
  • Agent: Claude Code

Verification

  • PR description includes a Signed-off-by: line and every commit appears as Verified in GitHub
  • Normal pre-commit, commit-msg, and pre-push hooks passed, or npm run validate:pr passed after refreshing origin/main when hooks were skipped or unavailable
  • Targeted behavior tests pass for the current change set, or tests are marked not applicable above — command/result or justification: npx vitest run src/lib/actions/uninstall/ test/ollama-proxy-recovery.test.ts src/lib/inference/local.test.ts — 17 files, 270 tests passed; npx vitest run src/lib/inference src/lib/onboard/inference-providers src/lib/state — 141 files, 2387 tests passed
  • Applicable broad gate passed — npm test for broad runtime/test-harness changes; npm run check for repo-wide validation/coverage changes — command/result:
  • Quality Gates section completed with required justifications or waivers
  • No secrets, API keys, or credentials committed
  • npm run docs builds without warnings (doc changes only)
  • Doc pages follow the style guide (doc changes only)
  • New doc pages include SPDX header and frontmatter (new pages only)

Signed-off-by: Tinson Lai tinsonl@nvidia.com

Summary by CodeRabbit

  • New Features
    • Ollama authentication now uses one shared proxy and token across gateway ports on the same host.
    • Additional gateways can reuse existing proxy credentials during setup.
  • Bug Fixes
    • Uninstalling one gateway preserves the shared Ollama proxy when other gateways remain.
    • Existing gateway-specific credentials are migrated safely to shared storage.
  • Documentation
    • Clarified shared proxy configuration, credential storage, onboarding, recovery, and uninstall behavior.
  • Tests
    • Added coverage for shared token reuse, credential migration, and new token generation.

The auth proxy binds one host port for every gateway, but its token, PID,
backend URL, and status files lived under the gateway-scoped state root.
Onboarding a second gateway port found no token there, minted one, and
rebound the shared port, so the first gateway's sandboxes got HTTP 401.

Read and write that state from a shared host root, adopt a token an
earlier gateway-scoped run left behind, stop relocating the token and PID
during a legacy port migration, and read the same root for the status
auth-proxy probe. Treat the proxy files as shared host state during
uninstall so a scoped run neither reports a phantom default gateway nor
stops a proxy a sibling gateway still uses.

Fixes #8704

Signed-off-by: Tinson Lai <tinsonl@nvidia.com>
@coderabbitai

coderabbitai Bot commented Aug 10, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

📝 Walkthrough

Walkthrough

The Ollama auth proxy now stores its token and backend state in a host-shared location across gateway ports. Legacy credentials migrate into shared state. Migration, uninstall behavior, tests, and documentation reflect the shared proxy model.

Changes

Shared Ollama proxy state

Layer / File(s) Summary
Shared proxy state and token recovery
src/lib/inference/local-adapter-lifecycle.ts, src/lib/inference/ollama/proxy.ts, src/lib/inference/local.ts, test/ollama-proxy-recovery.test.ts, src/lib/inference/local.test.ts, ci/source-architecture-budget.json, docs/inference/set-up-ollama.mdx, docs/reference/architecture.mdx, docs/reference/host-files-and-state.mdx
The proxy uses host-shared state rooted at the default gateway directory. It adopts legacy gateway-scoped credentials when required. Tests cover token reuse, legacy adoption, and first-run generation. Documentation describes shared tokens, ports, and state files.
Legacy state migration
src/lib/state/legacy-port-migration.ts
Host-shared PID and token entries remain outside port-specific migration, ambiguity detection, and whole-bundle moves.
Shared proxy uninstall handling
src/lib/actions/uninstall/run-plan.ts, docs/reference/commands.mdx
Scoped uninstall preserves shared Ollama proxy state when sibling gateways remain. The uninstall documentation describes this behavior.

Estimated code review effort: 3 (Moderate) | ~20 minutes

Sequence Diagram(s)

sequenceDiagram
  participant GatewayOnboarding
  participant OllamaAuthProxy
  participant SharedLocalAdapterState
  GatewayOnboarding->>OllamaAuthProxy: start proxy for gateway port
  OllamaAuthProxy->>SharedLocalAdapterState: load shared token and backend URL
  OllamaAuthProxy->>SharedLocalAdapterState: adopt legacy gateway token when needed
  OllamaAuthProxy-->>GatewayOnboarding: persist and use shared token
Loading

Possibly related PRs

Suggested reviewers: cv, apurvvkumaria

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 33.33% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and concisely describes the primary change: sharing the Ollama auth-proxy token across gateway ports.
Linked Issues check ✅ Passed The changes address issue #8704 by sharing proxy credentials across gateways, adopting legacy tokens, and adding regression coverage for token reuse.
Out of Scope Changes check ✅ Passed The code, tests, migration updates, uninstall behavior, documentation, and budget adjustment all support the linked issue and PR objectives.
✨ Finishing Touches 💡 2
📝 Generate docstrings 💡
  • Create stacked PR
  • Commit on current branch
🛠️ Fix failing CI checks 💡
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/ollama-proxy-token-gateway-scope

Comment @coderabbitai help to get the list of available commands.

@laitingsheng laitingsheng added provider: ollama Ollama local model provider behavior area: inference Inference routing, serving, model selection, or outputs area: sandbox OpenShell sandbox lifecycle, runtime, config, or recovery bug-fix PR fixes a bug or regression labels Aug 10, 2026
@github-code-quality

Copy link
Copy Markdown
Contributor

Code Coverage Overview

Languages: TypeScript

TypeScript / code-coverage/plugin

The overall coverage in commit 8effeb7 in the fix/ollama-proxy-tok... branch remains at 96%, unchanged from commit acf810d in the main branch.

@github-actions

Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🧹 Nitpick comments (1)
test/ollama-proxy-recovery.test.ts (1)

843-851: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Cover gateway-scoped backend URL adoption.

Lines 126-129 in src/lib/inference/ollama/proxy.ts also migrate ollama-backend. This helper cannot seed or assert that value. A regression that resets the backend URL to the default would keep this token-only test passing.

Seed a custom gateway-scoped backend URL. Capture OLLAMA_BACKEND_URL from the spawned proxy. Assert that shared state stores and reuses that URL.

As per path instructions, review tests for behavioral confidence rather than implementation lock-in.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@test/ollama-proxy-recovery.test.ts` around lines 843 - 851, Extend the test
around runSecondGatewayProxyStart to seed a custom gateway-scoped backend URL,
capture OLLAMA_BACKEND_URL from the spawned proxy, and assert that shared state
stores and reuses that custom URL alongside the scoped token. Keep the
assertions focused on adoption behavior rather than implementation details.

Source: Path instructions

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@src/lib/inference/ollama/proxy.ts`:
- Around line 119-130: Add host-wide cross-process locking around the shared
Ollama proxy startup and recovery flows, covering token selection, token
persistence, and proxy restart in startOllamaAuthProxy and
ensureOllamaAuthProxy. Ensure concurrent gateway onboarding and recovery cannot
leave the shared token, PID, and running proxy inconsistent, and add a test that
exercises concurrent processes.

---

Nitpick comments:
In `@test/ollama-proxy-recovery.test.ts`:
- Around line 843-851: Extend the test around runSecondGatewayProxyStart to seed
a custom gateway-scoped backend URL, capture OLLAMA_BACKEND_URL from the spawned
proxy, and assert that shared state stores and reuses that custom URL alongside
the scoped token. Keep the assertions focused on adoption behavior rather than
implementation details.
🪄 Autofix

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Enterprise

Run ID: 3cda04d5-5910-4114-a1e0-8c4701f18c01

📥 Commits

Reviewing files that changed from the base of the PR and between acf810d and 8effeb7.

📒 Files selected for processing (12)
  • ci/source-architecture-budget.json
  • docs/inference/set-up-ollama.mdx
  • docs/reference/architecture.mdx
  • docs/reference/commands.mdx
  • docs/reference/host-files-and-state.mdx
  • src/lib/actions/uninstall/run-plan.ts
  • src/lib/inference/local-adapter-lifecycle.ts
  • src/lib/inference/local.test.ts
  • src/lib/inference/local.ts
  • src/lib/inference/ollama/proxy.ts
  • src/lib/state/legacy-port-migration.ts
  • test/ollama-proxy-recovery.test.ts

Comment on lines +119 to +130
return readLocalAdapterTextFile(PROXY_TOKEN_PATH) ?? adoptGatewayScopedProxyToken();
}

function adoptGatewayScopedProxyToken(): string | null {
if (GATEWAY_SCOPED_PROXY_TOKEN_PATH === PROXY_TOKEN_PATH) return null;
const token = readLocalAdapterTextFile(GATEWAY_SCOPED_PROXY_TOKEN_PATH);
if (!token) return null;
const backendUrl =
readLocalAdapterTextFile(GATEWAY_SCOPED_PROXY_BACKEND_PATH) ??
readLocalAdapterTextFile(PROXY_BACKEND_PATH);
persistProxyToken(token, backendUrl || undefined);
return token;

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🩺 Stability & Availability | 🟠 Major | 🏗️ Heavy lift

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
set -euo pipefail

ast-grep outline src/lib/inference/ollama/proxy.ts --items all
rg -n -C 8 'ensureOllamaAuthProxy|startOllamaAuthProxy|loadPersistedProxyToken|persistProxyToken|randomBytes|lock|flock|acquire' \
  src/lib/inference/ollama/proxy.ts
rg -n -C 6 'concurrent|second gateway|gateway port|ollama auth proxy' \
  test src/lib/inference --glob '*test.ts'

Repository: NVIDIA/NemoClaw

Length of output: 50372


🏁 Script executed:

#!/bin/bash
set -euo pipefail

printf '%s\n' '--- proxy imports and lifecycle ---'
sed -n '1,55p;370,505p' src/lib/inference/ollama/proxy.ts

printf '%s\n' '--- lock implementations and proxy callers ---'
rg -n -C 5 'withAdapterLock|tryAcquireAdapterLock|LOCK_PATH|adapter lock|acquire.*lock|lock.*acquire' src test \
  -g '*.ts' -g '*.tsx' -g '*.js' | head -n 240

printf '%s\n' '--- proxy test concurrency coverage ---'
sed -n '738,890p' test/ollama-proxy-recovery.test.ts
rg -n -C 8 'ensureOllamaAuthProxy\(|startOllamaAuthProxy\(' src test -g '*.ts' | head -n 240

Repository: NVIDIA/NemoClaw

Length of output: 50371


🏁 Script executed:

#!/bin/bash
set -euo pipefail

printf '%s\n' '--- lock-related source files ---'
rg -l 'withAdapterLock|tryAcquireAdapterLock|LOCK_PATH|flock|mutation lock|lifecycle lock' src/lib \
  -g '*.ts' | sort

printf '%s\n' '--- lock imports and definitions ---'
rg -n -C 8 'withAdapterLock|tryAcquireAdapterLock|LOCK_PATH|flock|mutation lock|lifecycle lock' \
  src/lib/inference/https-pin-runtime-adapter.ts \
  src/lib/inference/ollama \
  src/lib/actions/sandbox/connect.ts \
  src/lib/onboard/setup-nim-ollama.ts \
  src/lib -g '*.ts' | head -n 320

printf '%s\n' '--- onboarding call path around proxy start ---'
sed -n '100,180p' src/lib/onboard/setup-nim-ollama.ts
rg -n -C 8 'setupNimOllama|startProxyOrAnnounceDirect|startOllamaAuthProxy|with.*Lock|acquire.*Lock' \
  src/lib/onboard src/lib/actions src/lib/inference -g '*.ts' | head -n 320

Repository: NVIDIA/NemoClaw

Length of output: 50371


Serialize shared Ollama proxy startup and recovery.

startOllamaAuthProxy reads the shared token and can generate one without cross-process synchronization. ensureOllamaAuthProxy can also restart the shared proxy without synchronization. Concurrent gateway onboarding or recovery can leave the token, PID, and running proxy out of sync. Add a host-wide lock around token selection, persistence, and proxy restart, with a concurrent-process test.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@src/lib/inference/ollama/proxy.ts` around lines 119 - 130, Add host-wide
cross-process locking around the shared Ollama proxy startup and recovery flows,
covering token selection, token persistence, and proxy restart in
startOllamaAuthProxy and ensureOllamaAuthProxy. Ensure concurrent gateway
onboarding and recovery cannot leave the shared token, PID, and running proxy
inconsistent, and add a test that exercises concurrent processes.

@github-actions

github-actions Bot commented Aug 10, 2026

Copy link
Copy Markdown
Contributor

PR Review Advisor — Blocking findings reported

Advisor assessment: Blockers require maintainer review
Next action: Review the blockers below.
Findings: 1 blocker · 2 warnings · 0 suggestions

Model lanes

  • GPT-5.6 Terra (primary): Completed · high confidence · 1 blocker · 2 warnings · 0 suggestions
  • Nemotron 3 Ultra (second opinion): Completed · high confidence · 1 blocker · 5 warnings · 1 suggestion
  • Model comparison: normalized findings differ; normalized terminology decisions differ; normalized E2E selections differ; Nemotron reported the same number of blockers, 3 more warnings, 1 more suggestion.
3 terminology differences from the second opinion

Advisory only. These are normalized differences from the primary terminology receipt.

  • shared root at docs/reference/architecture.mdx:371: selected only by the second-opinion lane as established.
  • adopt at src/lib/inference/ollama/proxy.ts:122: selected only by the second-opinion lane as define.
  • shared proxy at docs/inference/set-up-ollama.mdx:253: selected only by the second-opinion lane as justified.
1 additional E2E selection from the second opinion

Advisory only. The primary lane did not select these E2E jobs or targets.

  • gpu-double-onboard: The completed second-opinion lane identified E2E coverage that the primary lane omitted.

Second-opinion terminology and E2E selections are advisory. Live E2E does not run automatically for pull requests.

2 semantic terminology decisions

Terminology decisions are advisory. They affect the assessment only when a separate finding identifies concrete semantic impact.

  • established — host-global at docs/reference/host-files-and-state.mdx:38: Use host-global for the shared Ollama proxy token because every gateway port reads the same file.
  • established — gateway-scoped at test/ollama-proxy-recovery.test.ts:843: Use gateway-scoped for the legacy per-port token location in the regression-test title.

E2E guidance

Advisory only. A maintainer can dispatch the default E2E suite against this exact revision.

Recommended E2E: inference-routing, network-policy, onboard-repair, onboard-resume

3 optional E2E recommendations
  • ollama-auth-proxy
  • concurrent-gateway-ports
  • double-onboard

Blockers

PRA-1 Blocker — Adopt the legacy token from every gateway root before starting the shared proxy

  • Location: src/lib/inference/ollama/proxy.ts:119
  • Category: correctness
  • Problem: A non-default gateway only reads its own legacy token path. When an existing Local Ollama gateway uses port 8990 and onboarding starts another gateway on port 9000, the 9000 process finds no shared token or 9000 token, mints a new token, and replaces the host-wide proxy. The sandbox on port 8990 retains its old token and receives HTTP 401.
  • Impact: Onboarding a second non-default gateway can invalidate inference for an existing sandbox.
  • Fix: Search valid legacy gateway state roots for an existing Ollama proxy token, or derive the token from the verified running proxy state, before minting or replacing the shared proxy token.
  • Verification: Create legacy token state only under ~/.nemoclaw/gateways/8990, then start Local Ollama onboarding with NEMOCLAW_GATEWAY_PORT=9000 and confirm the proxy starts with the 8990 token.
  • Test coverage: Add a recovery test that seeds a token under one non-default gateway root, starts the proxy from a different non-default gateway root, and asserts that the shared proxy and shared token use the seeded token.
  • Evidence: src/lib/inference/ollama/proxy.ts:119-129 reads only the selected gateway-scoped token after the shared token is absent. src/lib/inference/ollama/proxy.ts:380-385 mints a token when that selected-path lookup returns null. test/ollama-proxy-recovery.test.ts:843-852 covers only a token in the calling gateway root. The current route contract requires existing sandbox inference to remain usable after another gateway onboarding.
2 warnings · 0 suggestions

Warnings

Warnings do not block.

PRA-2 Warning — Cover scoped uninstall that preserves the shared Ollama proxy

  • Location: src/lib/actions/uninstall/run-plan.ts:806
  • Category: tests
  • Problem: The changed scoped-uninstall path returns before reading or stopping the shared proxy PID, but the changed test set has no sibling-gateway assertion for this behavior.
  • Impact: A future change can stop the shared proxy during scoped uninstall and break inference for sibling gateways without a regression test detecting it.
  • Recommendation: Add a focused run-plan test for a selected-gateway uninstall with a live sibling and a verified shared proxy PID.
  • Verification: Inspect the test spy for runtime.kill after a scoped uninstall fixture with sibling gateway state; it must contain no proxy PID and logs must name proxy preservation.
  • Test coverage: Simulate scoped uninstall with a live sibling gateway and a verified shared proxy PID. Assert that uninstall sends no signal to that PID and logs that it preserves the shared Ollama proxy.
  • Evidence: src/lib/actions/uninstall/run-plan.ts:806-816 returns before PID-file and port scanning when scanOrphans is false. src/lib/actions/uninstall/run-plan.ts:2122 calls stopOllamaAuthProxy(paths, runtime, !scopedToSelectedGateway). src/lib/actions/uninstall/run-plan.test.ts contains proxy-stop coverage but no selected-gateway sibling preservation case.

PRA-3 Warning — Cover migration that leaves shared Ollama proxy state in the host root

  • Location: src/lib/state/legacy-port-migration.ts:44
  • Category: tests
  • Problem: The migration excludes the proxy PID and token from movable legacy entries and from ambiguous-state warnings, but no changed test proves that behavior.
  • Impact: A future migration change can relocate or falsely report shared proxy credentials and process state, disrupting the shared proxy lifecycle.
  • Recommendation: Add a migration fixture that contains the shared proxy token and PID alongside migratable state.
  • Verification: Run the migration test with token and PID in the shared root, then inspect both roots and migration warnings.
  • Test coverage: Seed the legacy shared root with ollama-proxy-token and ollama-auth-proxy.pid, migrate a non-default gateway, and assert that both files remain in the shared root, do not appear in the selected root, and do not occur in the ambiguous-state warning.
  • Evidence: src/lib/state/legacy-port-migration.ts:44-49 excludes ollama-auth-proxy.pid and ollama-proxy-token from MIGRATABLE_BUNDLE_ENTRIES. src/lib/state/legacy-port-migration.ts:555 excludes those entries from ambiguous-state warnings. src/lib/state/legacy-port-migration.test.ts has no ollama-proxy-token or ollama-auth-proxy coverage.

Workflow run details

This automated review informs maintainers. Warnings and suggestions do not require a response. A maintainer decides whether to merge.

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

Labels

area: inference Inference routing, serving, model selection, or outputs area: sandbox OpenShell sandbox lifecycle, runtime, config, or recovery bug-fix PR fixes a bug or regression provider: ollama Ollama local model provider behavior

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[DGX Spark][Inference] Second onboard rotates shared Ollama proxy token, breaking existing sandbox inference (HTTP 401)

1 participant