From 55e8a8111d08cb81522f084793dc861df9018c26 Mon Sep 17 00:00:00 2001 From: Chengjie Wang Date: Tue, 7 Jul 2026 02:33:28 +0800 Subject: [PATCH 1/9] fix(runtime): route local Ollama through proxy Signed-off-by: Chengjie Wang --- scripts/lib/runtime.sh | 48 +++++++++++++++++++++++++++++++++++--- test/runtime-shell.test.ts | 22 ++++++++++++++++- 2 files changed, 66 insertions(+), 4 deletions(-) diff --git a/scripts/lib/runtime.sh b/scripts/lib/runtime.sh index b9447044e5a..4a5e17a6518 100755 --- a/scripts/lib/runtime.sh +++ b/scripts/lib/runtime.sh @@ -112,6 +112,50 @@ infer_container_runtime_from_info() { fi } +is_wsl_runtime() { + if [ -n "${WSL_DISTRO_NAME:-}" ] || [ -n "${WSL_INTEROP:-}" ]; then + return 0 + fi + + local release="${1:-}" + if [ -z "$release" ]; then + release="$(uname -r 2>/dev/null || true)" + fi + local normalized + normalized="$(printf '%s' "$release" | tr '[:upper:]' '[:lower:]')" + [[ "$normalized" == *microsoft* ]] +} + +detect_container_runtime_from_docker() { + local info="" + if command -v docker >/dev/null 2>&1; then + info="$(docker info --format '{{.OperatingSystem}} {{range .Labels}}{{.}} {{end}}' 2>/dev/null || true)" + fi + infer_container_runtime_from_info "$info" +} + +container_can_reach_host_loopback() { + local runtime="${1:-}" + if [ -z "$runtime" ]; then + runtime="$(detect_container_runtime_from_docker)" + fi + + is_wsl_runtime && [ "$runtime" = "docker-desktop" ] +} + +get_ollama_container_port() { + local ollama_port="${NEMOCLAW_OLLAMA_PORT:-11434}" + local ollama_proxy_port="${NEMOCLAW_OLLAMA_PROXY_PORT:-11435}" + _validate_port NEMOCLAW_OLLAMA_PORT "$ollama_port" || return 1 + _validate_port NEMOCLAW_OLLAMA_PROXY_PORT "$ollama_proxy_port" || return 1 + + if container_can_reach_host_loopback; then + printf '%s\n' "$ollama_port" + else + printf '%s\n' "$ollama_proxy_port" + fi +} + find_podman_socket() { local home_dir="${1:-${HOME:-/tmp}}" local socket_path @@ -253,12 +297,10 @@ get_local_provider_base_url() { local provider="${1:-}" local vllm_port="${NEMOCLAW_VLLM_PORT:-8000}" - local ollama_port="${NEMOCLAW_OLLAMA_PORT:-11434}" _validate_port NEMOCLAW_VLLM_PORT "$vllm_port" || return 1 - _validate_port NEMOCLAW_OLLAMA_PORT "$ollama_port" || return 1 case "$provider" in vllm-local) printf 'http://host.openshell.internal:%s/v1\n' "$vllm_port" ;; - ollama-local) printf 'http://host.openshell.internal:%s/v1\n' "$ollama_port" ;; + ollama-local) printf 'http://host.openshell.internal:%s/v1\n' "$(get_ollama_container_port)" ;; *) return 1 ;; esac } diff --git a/test/runtime-shell.test.ts b/test/runtime-shell.test.ts index 86bdaa0ef3b..71f34915526 100644 --- a/test/runtime-shell.test.ts +++ b/test/runtime-shell.test.ts @@ -151,12 +151,32 @@ describe("shell runtime helpers", () => { expect(result.stdout.trim()).toBe("http://host.openshell.internal:8000/v1"); }); - it("returns the ollama-local base URL", () => { + it("returns the ollama-local proxy base URL for native Docker-style hosts", () => { const result = runShell(`source "${RUNTIME_SH}"; get_local_provider_base_url ollama-local`); expect(result.status).toBe(0); + expect(result.stdout.trim()).toBe("http://host.openshell.internal:11435/v1"); + }); + + it("returns the raw Ollama port only for WSL Docker Desktop loopback routing", () => { + const result = runShell( + `uname() { printf 'Linux\\n'; } + source "${RUNTIME_SH}" + is_wsl_runtime() { return 0; } + detect_container_runtime_from_docker() { printf 'docker-desktop\\n'; } + get_local_provider_base_url ollama-local`, + ); + expect(result.status).toBe(0); expect(result.stdout.trim()).toBe("http://host.openshell.internal:11434/v1"); }); + it("honors the configured Ollama proxy port for sandbox-facing URLs", () => { + const result = runShell(`source "${RUNTIME_SH}"; get_local_provider_base_url ollama-local`, { + NEMOCLAW_OLLAMA_PROXY_PORT: "12435", + }); + expect(result.status).toBe(0); + expect(result.stdout.trim()).toBe("http://host.openshell.internal:12435/v1"); + }); + it("rejects unknown local providers", () => { const result = runShell(`source "${RUNTIME_SH}"; get_local_provider_base_url bogus-provider`); expect(result.status).not.toBe(0); From fb245f9013b07306edfb993175a8d61d7089049d Mon Sep 17 00:00:00 2001 From: Chengjie Wang Date: Tue, 7 Jul 2026 02:53:14 +0800 Subject: [PATCH 2/9] fix(runtime): harden Ollama proxy routing Signed-off-by: Chengjie Wang --- scripts/lib/runtime.sh | 28 +++++++--- test/runtime-shell.test.ts | 102 ++++++++++++++++++++++++++++++++++--- 2 files changed, 114 insertions(+), 16 deletions(-) diff --git a/scripts/lib/runtime.sh b/scripts/lib/runtime.sh index 4a5e17a6518..e0ca1bb1e24 100755 --- a/scripts/lib/runtime.sh +++ b/scripts/lib/runtime.sh @@ -136,22 +136,30 @@ detect_container_runtime_from_docker() { container_can_reach_host_loopback() { local runtime="${1:-}" + if ! is_wsl_runtime; then + return 1 + fi + if [ -z "$runtime" ]; then runtime="$(detect_container_runtime_from_docker)" fi - is_wsl_runtime && [ "$runtime" = "docker-desktop" ] + [ "$runtime" = "docker-desktop" ] } get_ollama_container_port() { local ollama_port="${NEMOCLAW_OLLAMA_PORT:-11434}" local ollama_proxy_port="${NEMOCLAW_OLLAMA_PROXY_PORT:-11435}" - _validate_port NEMOCLAW_OLLAMA_PORT "$ollama_port" || return 1 - _validate_port NEMOCLAW_OLLAMA_PROXY_PORT "$ollama_proxy_port" || return 1 if container_can_reach_host_loopback; then + _validate_port NEMOCLAW_OLLAMA_PORT "$ollama_port" || return 1 printf '%s\n' "$ollama_port" else + _validate_port NEMOCLAW_OLLAMA_PROXY_PORT "$ollama_proxy_port" || return 1 + if [ "$ollama_port" = "$ollama_proxy_port" ]; then + printf 'Invalid NEMOCLAW_OLLAMA_PROXY_PORT=%s (must differ from NEMOCLAW_OLLAMA_PORT on non-WSL hosts)\n' "$ollama_proxy_port" >&2 + return 1 + fi printf '%s\n' "$ollama_proxy_port" fi } @@ -300,7 +308,11 @@ get_local_provider_base_url() { _validate_port NEMOCLAW_VLLM_PORT "$vllm_port" || return 1 case "$provider" in vllm-local) printf 'http://host.openshell.internal:%s/v1\n' "$vllm_port" ;; - ollama-local) printf 'http://host.openshell.internal:%s/v1\n' "$(get_ollama_container_port)" ;; + ollama-local) + local ollama_container_port + ollama_container_port="$(get_ollama_container_port)" || return 1 + printf 'http://host.openshell.internal:%s/v1\n' "$ollama_container_port" + ;; *) return 1 ;; esac } @@ -309,15 +321,15 @@ check_local_provider_health() { local provider="${1:-}" local vllm_port="${NEMOCLAW_VLLM_PORT:-8000}" - local ollama_port="${NEMOCLAW_OLLAMA_PORT:-11434}" - _validate_port NEMOCLAW_VLLM_PORT "$vllm_port" || return 1 - _validate_port NEMOCLAW_OLLAMA_PORT "$ollama_port" || return 1 case "$provider" in vllm-local) + _validate_port NEMOCLAW_VLLM_PORT "$vllm_port" || return 1 curl -sf "http://localhost:${vllm_port}/v1/models" >/dev/null 2>&1 ;; ollama-local) - curl -sf "http://localhost:${ollama_port}/api/tags" >/dev/null 2>&1 + local ollama_container_port + ollama_container_port="$(get_ollama_container_port)" || return 1 + curl -sf "http://localhost:${ollama_container_port}/api/tags" >/dev/null 2>&1 ;; *) return 1 diff --git a/test/runtime-shell.test.ts b/test/runtime-shell.test.ts index 71f34915526..938b0b84d01 100644 --- a/test/runtime-shell.test.ts +++ b/test/runtime-shell.test.ts @@ -13,10 +13,19 @@ function runShell( script: string, env: Record = {}, ): SpawnSyncReturns { + const cleanEnv: Record = { + HOME: process.env.HOME ?? os.tmpdir(), + PATH: process.env.PATH ?? "/usr/bin:/bin", + TMPDIR: os.tmpdir(), + }; + for (const [key, value] of Object.entries(env)) { + if (value !== undefined) cleanEnv[key] = value; + } + return spawnSync("bash", ["--noprofile", "--norc", "-c", script], { cwd: path.join(import.meta.dirname, ".."), encoding: "utf-8", - env: { ...process.env, ...env }, + env: cleanEnv, }); } @@ -151,25 +160,33 @@ describe("shell runtime helpers", () => { expect(result.stdout.trim()).toBe("http://host.openshell.internal:8000/v1"); }); - it("returns the ollama-local proxy base URL for native Docker-style hosts", () => { - const result = runShell(`source "${RUNTIME_SH}"; get_local_provider_base_url ollama-local`); + it("returns the ollama-local proxy base URL for native Docker-style hosts (#3136)", () => { + const result = runShell( + `uname() { printf 'Darwin\\n'; } + docker() { printf 'unexpected docker call\\n' >&2; return 1; } + source "${RUNTIME_SH}" + get_local_provider_base_url ollama-local`, + ); expect(result.status).toBe(0); expect(result.stdout.trim()).toBe("http://host.openshell.internal:11435/v1"); + expect(result.stderr).toBe(""); }); - it("returns the raw Ollama port only for WSL Docker Desktop loopback routing", () => { + it("returns the raw Ollama port only for WSL Docker Desktop loopback routing (#3136)", () => { const result = runShell( - `uname() { printf 'Linux\\n'; } + `uname() { printf '5.15.90.1-microsoft-standard-WSL2\\n'; } + docker() { + [ "$1" = "info" ] || return 1 + printf 'Docker Desktop\\n' + } source "${RUNTIME_SH}" - is_wsl_runtime() { return 0; } - detect_container_runtime_from_docker() { printf 'docker-desktop\\n'; } get_local_provider_base_url ollama-local`, ); expect(result.status).toBe(0); expect(result.stdout.trim()).toBe("http://host.openshell.internal:11434/v1"); }); - it("honors the configured Ollama proxy port for sandbox-facing URLs", () => { + it("honors the configured Ollama proxy port for sandbox-facing URLs (#3136)", () => { const result = runShell(`source "${RUNTIME_SH}"; get_local_provider_base_url ollama-local`, { NEMOCLAW_OLLAMA_PROXY_PORT: "12435", }); @@ -177,6 +194,75 @@ describe("shell runtime helpers", () => { expect(result.stdout.trim()).toBe("http://host.openshell.internal:12435/v1"); }); + it("rejects an invalid Ollama proxy port without emitting a URL (#3136)", () => { + const result = runShell(`source "${RUNTIME_SH}"; get_local_provider_base_url ollama-local`, { + NEMOCLAW_OLLAMA_PROXY_PORT: "bad", + }); + expect(result.status).not.toBe(0); + expect(result.stdout).toBe(""); + expect(result.stderr).toContain("Invalid NEMOCLAW_OLLAMA_PROXY_PORT=bad"); + }); + + it("rejects an invalid Ollama raw port on the WSL Docker Desktop path (#3136)", () => { + const result = runShell( + `uname() { printf '5.15.90.1-microsoft-standard-WSL2\\n'; } + docker() { + [ "$1" = "info" ] || return 1 + printf 'Docker Desktop\\n' + } + source "${RUNTIME_SH}" + get_local_provider_base_url ollama-local`, + { NEMOCLAW_OLLAMA_PORT: "bad" }, + ); + expect(result.status).not.toBe(0); + expect(result.stdout).toBe(""); + expect(result.stderr).toContain("Invalid NEMOCLAW_OLLAMA_PORT=bad"); + }); + + it("rejects equal Ollama raw and proxy ports on non-WSL hosts (#3136)", () => { + const result = runShell(`source "${RUNTIME_SH}"; get_local_provider_base_url ollama-local`, { + NEMOCLAW_OLLAMA_PORT: "11434", + NEMOCLAW_OLLAMA_PROXY_PORT: "11434", + }); + expect(result.status).not.toBe(0); + expect(result.stdout).toBe(""); + expect(result.stderr).toContain("must differ from NEMOCLAW_OLLAMA_PORT"); + }); + + it("checks ollama-local health on the sandbox-facing proxy port (#3136)", () => { + const result = runShell( + `curl() { [ "$1" = "-sf" ] && [ "$2" = "http://localhost:12435/api/tags" ]; } + source "${RUNTIME_SH}" + check_local_provider_health ollama-local`, + { NEMOCLAW_OLLAMA_PROXY_PORT: "12435" }, + ); + expect(result.status).toBe(0); + }); + + it("limits host loopback routing to WSL Docker Desktop (#3136)", () => { + const result = runShell( + `source "${RUNTIME_SH}" + is_wsl_runtime "5.15.90.1-microsoft-standard-WSL2" + printf 'wsl-detect=%s\\n' "$?" + uname() { printf '5.15.90.1-microsoft-standard-WSL2\\n'; } + container_can_reach_host_loopback docker-desktop + printf 'wsl-docker=%s\\n' "$?" + container_can_reach_host_loopback docker + printf 'wsl-docker-engine=%s\\n' "$?" + is_wsl_runtime "23.0.0-darwin" + printf 'darwin-wsl=%s\\n' "$?" + uname() { printf '23.0.0-darwin\\n'; } + container_can_reach_host_loopback docker-desktop + printf 'darwin-docker-desktop=%s\\n' "$?"`, + ); + expect(result.status).toBe(0); + expect(result.stdout).toContain("wsl-detect=0"); + expect(result.stdout).toContain("wsl-docker=0"); + expect(result.stdout).toContain("wsl-docker-engine=1"); + expect(result.stdout).toContain("darwin-wsl=1"); + expect(result.stdout).toContain("darwin-docker-desktop=1"); + }); + it("rejects unknown local providers", () => { const result = runShell(`source "${RUNTIME_SH}"; get_local_provider_base_url bogus-provider`); expect(result.status).not.toBe(0); From 6524e9e02b57e1dd37c98df2c8a09a00c7187579 Mon Sep 17 00:00:00 2001 From: Chengjie Wang Date: Tue, 7 Jul 2026 02:56:17 +0800 Subject: [PATCH 3/9] test(runtime): satisfy conditional guardrail Signed-off-by: Chengjie Wang --- test/runtime-shell.test.ts | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/test/runtime-shell.test.ts b/test/runtime-shell.test.ts index 938b0b84d01..9470eb89ff8 100644 --- a/test/runtime-shell.test.ts +++ b/test/runtime-shell.test.ts @@ -13,14 +13,15 @@ function runShell( script: string, env: Record = {}, ): SpawnSyncReturns { + const providedEnv = Object.fromEntries( + Object.entries(env).filter((entry): entry is [string, string] => entry[1] !== undefined), + ); const cleanEnv: Record = { HOME: process.env.HOME ?? os.tmpdir(), PATH: process.env.PATH ?? "/usr/bin:/bin", TMPDIR: os.tmpdir(), + ...providedEnv, }; - for (const [key, value] of Object.entries(env)) { - if (value !== undefined) cleanEnv[key] = value; - } return spawnSync("bash", ["--noprofile", "--norc", "-c", script], { cwd: path.join(import.meta.dirname, ".."), From 3864180bd82d48bea5240ffdab7c3903384d4a53 Mon Sep 17 00:00:00 2001 From: Chengjie Wang Date: Tue, 7 Jul 2026 03:02:00 +0800 Subject: [PATCH 4/9] fix(runtime): document WSL routing boundary Signed-off-by: Chengjie Wang --- scripts/lib/runtime.sh | 11 ++++++++++ test/runtime-shell.test.ts | 43 ++++++++++++++++++++++++++++++-------- 2 files changed, 45 insertions(+), 9 deletions(-) diff --git a/scripts/lib/runtime.sh b/scripts/lib/runtime.sh index e0ca1bb1e24..eea8610254b 100755 --- a/scripts/lib/runtime.sh +++ b/scripts/lib/runtime.sh @@ -113,6 +113,12 @@ infer_container_runtime_from_info() { } is_wsl_runtime() { + # Keep this shell-side WSL check aligned with src/lib/platform.ts:isWsl(). + # Source boundary (#3136): this script runs before OpenShell network policy is + # applied, so it must choose the provider URL that later enters the sandbox. + # Remove this local workaround after OpenShell exposes one uniform + # sandbox-to-host local-service route for WSL and non-WSL runtimes. Review by + # 2026-12-31. if [ -n "${WSL_DISTRO_NAME:-}" ] || [ -n "${WSL_INTEROP:-}" ]; then return 0 fi @@ -127,6 +133,8 @@ is_wsl_runtime() { } detect_container_runtime_from_docker() { + # Best effort only: missing/unhealthy Docker maps to unknown, and callers then + # fail safe to the token-gated Ollama auth proxy instead of raw host loopback. local info="" if command -v docker >/dev/null 2>&1; then info="$(docker info --format '{{.OperatingSystem}} {{range .Labels}}{{.}} {{end}}' 2>/dev/null || true)" @@ -135,6 +143,9 @@ detect_container_runtime_from_docker() { } container_can_reach_host_loopback() { + # Only WSL + Docker Desktop is allowed to use raw host loopback. Every other + # runtime, including macOS Docker Desktop, Colima, Podman, and native Docker, + # defaults to the auth proxy as the security fail-safe. local runtime="${1:-}" if ! is_wsl_runtime; then return 1 diff --git a/test/runtime-shell.test.ts b/test/runtime-shell.test.ts index 9470eb89ff8..7f4d1546b0a 100644 --- a/test/runtime-shell.test.ts +++ b/test/runtime-shell.test.ts @@ -30,6 +30,23 @@ function runShell( }); } +function createFakeDockerInfo(info: string): string { + const binDir = fs.mkdtempSync(path.join(os.tmpdir(), "nemoclaw-runtime-bin-")); + const escapedInfo = info.replace(/'/g, "'\\''"); + const dockerPath = path.join(binDir, "docker"); + fs.writeFileSync( + dockerPath, + `#!/usr/bin/env bash +case "$1" in + info) printf '%s\\n' '${escapedInfo}' ;; + *) exit 1 ;; +esac +`, + ); + fs.chmodSync(dockerPath, 0o755); + return binDir; +} + describe("shell runtime helpers", () => { it("respects an existing DOCKER_HOST", () => { const result = runShell(`source "${RUNTIME_SH}"; detect_docker_host`, { @@ -174,17 +191,16 @@ describe("shell runtime helpers", () => { }); it("returns the raw Ollama port only for WSL Docker Desktop loopback routing (#3136)", () => { + const binDir = createFakeDockerInfo("Docker Desktop"); const result = runShell( `uname() { printf '5.15.90.1-microsoft-standard-WSL2\\n'; } - docker() { - [ "$1" = "info" ] || return 1 - printf 'Docker Desktop\\n' - } source "${RUNTIME_SH}" get_local_provider_base_url ollama-local`, + { PATH: `${binDir}:/usr/bin:/bin` }, ); expect(result.status).toBe(0); expect(result.stdout.trim()).toBe("http://host.openshell.internal:11434/v1"); + fs.rmSync(binDir, { recursive: true, force: true }); }); it("honors the configured Ollama proxy port for sandbox-facing URLs (#3136)", () => { @@ -205,19 +221,28 @@ describe("shell runtime helpers", () => { }); it("rejects an invalid Ollama raw port on the WSL Docker Desktop path (#3136)", () => { + const binDir = createFakeDockerInfo("Docker Desktop"); const result = runShell( `uname() { printf '5.15.90.1-microsoft-standard-WSL2\\n'; } - docker() { - [ "$1" = "info" ] || return 1 - printf 'Docker Desktop\\n' - } source "${RUNTIME_SH}" get_local_provider_base_url ollama-local`, - { NEMOCLAW_OLLAMA_PORT: "bad" }, + { NEMOCLAW_OLLAMA_PORT: "bad", PATH: `${binDir}:/usr/bin:/bin` }, ); expect(result.status).not.toBe(0); expect(result.stdout).toBe(""); expect(result.stderr).toContain("Invalid NEMOCLAW_OLLAMA_PORT=bad"); + fs.rmSync(binDir, { recursive: true, force: true }); + }); + + it("falls back to the Ollama proxy when Docker runtime detection is unavailable (#3136)", () => { + const result = runShell( + `source "${RUNTIME_SH}" + detect_container_runtime_from_docker + get_local_provider_base_url ollama-local`, + { PATH: "/usr/bin:/bin" }, + ); + expect(result.status).toBe(0); + expect(result.stdout.trim()).toBe("unknown\nhttp://host.openshell.internal:11435/v1"); }); it("rejects equal Ollama raw and proxy ports on non-WSL hosts (#3136)", () => { From fbc9490255d5ec711138b7693f7c18e90c9d1fea Mon Sep 17 00:00:00 2001 From: Chengjie Wang Date: Tue, 7 Jul 2026 03:13:18 +0800 Subject: [PATCH 5/9] fix(runtime): clarify Ollama proxy health scope Signed-off-by: Chengjie Wang --- docs/reference/troubleshooting.mdx | 4 ++ scripts/lib/runtime.sh | 8 ++- test/runtime-shell.test.ts | 92 +++++++++++++++++++----------- 3 files changed, 69 insertions(+), 35 deletions(-) diff --git a/docs/reference/troubleshooting.mdx b/docs/reference/troubleshooting.mdx index 861ffc077ee..8dc0e95b2b6 100644 --- a/docs/reference/troubleshooting.mdx +++ b/docs/reference/troubleshooting.mdx @@ -1734,6 +1734,10 @@ http://host.openshell.internal:11435/v1 `host.openshell.internal` resolves to the same gateway IP, and the [token-gated Ollama auth proxy](#ollama-auth-proxy-did-not-start) binds port `11435` there and forwards requests to `127.0.0.1:11434` on the host. +This managed route is the supported NemoClaw fix for local Ollama. It does not +make manually created OpenShell providers or direct sandbox curls that use +`host.docker.internal:11434` portable; those literal routes remain outside the +managed `ollama-local` path and can still fail inside k3s. If you need a different host service exposed to the sandbox, route it through the OpenShell gateway rather than relying on `host.docker.internal`. Refer to issue [#3136](https://github.com/NVIDIA/NemoClaw/issues/3136). diff --git a/scripts/lib/runtime.sh b/scripts/lib/runtime.sh index eea8610254b..0cae9ae7304 100755 --- a/scripts/lib/runtime.sh +++ b/scripts/lib/runtime.sh @@ -338,9 +338,11 @@ check_local_provider_health() { curl -sf "http://localhost:${vllm_port}/v1/models" >/dev/null 2>&1 ;; ollama-local) - local ollama_container_port - ollama_container_port="$(get_ollama_container_port)" || return 1 - curl -sf "http://localhost:${ollama_container_port}/api/tags" >/dev/null 2>&1 + # Health checks validate the host daemon. The sandbox-facing provider URL + # can still use the auth proxy on non-WSL hosts. + local ollama_port="${NEMOCLAW_OLLAMA_PORT:-11434}" + _validate_port NEMOCLAW_OLLAMA_PORT "$ollama_port" || return 1 + curl -sf "http://127.0.0.1:${ollama_port}/api/tags" >/dev/null 2>&1 ;; *) return 1 diff --git a/test/runtime-shell.test.ts b/test/runtime-shell.test.ts index 7f4d1546b0a..386be4066b7 100644 --- a/test/runtime-shell.test.ts +++ b/test/runtime-shell.test.ts @@ -203,18 +203,48 @@ describe("shell runtime helpers", () => { fs.rmSync(binDir, { recursive: true, force: true }); }); + it("detects WSL from WSL_DISTRO_NAME (#3136)", () => { + const result = runShell( + `uname() { printf '23.0.0-darwin\\n'; } + source "${RUNTIME_SH}" + is_wsl_runtime`, + { WSL_DISTRO_NAME: "Ubuntu" }, + ); + expect(result.status).toBe(0); + }); + + it("detects WSL from WSL_INTEROP (#3136)", () => { + const result = runShell( + `uname() { printf '23.0.0-darwin\\n'; } + source "${RUNTIME_SH}" + is_wsl_runtime`, + { WSL_INTEROP: "/run/WSL/123_interop" }, + ); + expect(result.status).toBe(0); + }); + it("honors the configured Ollama proxy port for sandbox-facing URLs (#3136)", () => { - const result = runShell(`source "${RUNTIME_SH}"; get_local_provider_base_url ollama-local`, { - NEMOCLAW_OLLAMA_PROXY_PORT: "12435", - }); + const result = runShell( + `uname() { printf '23.0.0-darwin\\n'; } + source "${RUNTIME_SH}" + get_local_provider_base_url ollama-local`, + { + NEMOCLAW_OLLAMA_PROXY_PORT: "12435", + }, + ); expect(result.status).toBe(0); expect(result.stdout.trim()).toBe("http://host.openshell.internal:12435/v1"); }); it("rejects an invalid Ollama proxy port without emitting a URL (#3136)", () => { - const result = runShell(`source "${RUNTIME_SH}"; get_local_provider_base_url ollama-local`, { - NEMOCLAW_OLLAMA_PROXY_PORT: "bad", - }); + const result = runShell( + `uname() { printf '23.0.0-darwin\\n'; } + source "${RUNTIME_SH}" + get_local_provider_base_url ollama-local`, + { + NEMOCLAW_OLLAMA_PROXY_PORT: "bad", + }, + ); expect(result.status).not.toBe(0); expect(result.stdout).toBe(""); expect(result.stderr).toContain("Invalid NEMOCLAW_OLLAMA_PROXY_PORT=bad"); @@ -236,7 +266,8 @@ describe("shell runtime helpers", () => { it("falls back to the Ollama proxy when Docker runtime detection is unavailable (#3136)", () => { const result = runShell( - `source "${RUNTIME_SH}" + `uname() { printf '23.0.0-darwin\\n'; } + source "${RUNTIME_SH}" detect_container_runtime_from_docker get_local_provider_base_url ollama-local`, { PATH: "/usr/bin:/bin" }, @@ -246,47 +277,44 @@ describe("shell runtime helpers", () => { }); it("rejects equal Ollama raw and proxy ports on non-WSL hosts (#3136)", () => { - const result = runShell(`source "${RUNTIME_SH}"; get_local_provider_base_url ollama-local`, { - NEMOCLAW_OLLAMA_PORT: "11434", - NEMOCLAW_OLLAMA_PROXY_PORT: "11434", - }); + const result = runShell( + `uname() { printf '23.0.0-darwin\\n'; } + source "${RUNTIME_SH}" + get_local_provider_base_url ollama-local`, + { + NEMOCLAW_OLLAMA_PORT: "11434", + NEMOCLAW_OLLAMA_PROXY_PORT: "11434", + }, + ); expect(result.status).not.toBe(0); expect(result.stdout).toBe(""); expect(result.stderr).toContain("must differ from NEMOCLAW_OLLAMA_PORT"); }); - it("checks ollama-local health on the sandbox-facing proxy port (#3136)", () => { + it("checks ollama-local health on the raw daemon while sandbox URLs use the proxy (#3136)", () => { const result = runShell( - `curl() { [ "$1" = "-sf" ] && [ "$2" = "http://localhost:12435/api/tags" ]; } + `uname() { printf '23.0.0-darwin\\n'; } + curl() { [ "$1" = "-sf" ] && [ "$2" = "http://127.0.0.1:11434/api/tags" ]; } source "${RUNTIME_SH}" + get_local_provider_base_url ollama-local check_local_provider_health ollama-local`, { NEMOCLAW_OLLAMA_PROXY_PORT: "12435" }, ); expect(result.status).toBe(0); + expect(result.stdout.trim()).toBe("http://host.openshell.internal:12435/v1"); }); - it("limits host loopback routing to WSL Docker Desktop (#3136)", () => { + it("keeps non-WSL Docker Desktop on the managed proxy route (#3136)", () => { + const binDir = createFakeDockerInfo("Docker Desktop"); const result = runShell( - `source "${RUNTIME_SH}" - is_wsl_runtime "5.15.90.1-microsoft-standard-WSL2" - printf 'wsl-detect=%s\\n' "$?" - uname() { printf '5.15.90.1-microsoft-standard-WSL2\\n'; } - container_can_reach_host_loopback docker-desktop - printf 'wsl-docker=%s\\n' "$?" - container_can_reach_host_loopback docker - printf 'wsl-docker-engine=%s\\n' "$?" - is_wsl_runtime "23.0.0-darwin" - printf 'darwin-wsl=%s\\n' "$?" - uname() { printf '23.0.0-darwin\\n'; } - container_can_reach_host_loopback docker-desktop - printf 'darwin-docker-desktop=%s\\n' "$?"`, + `uname() { printf '23.0.0-darwin\\n'; } + source "${RUNTIME_SH}" + get_local_provider_base_url ollama-local`, + { PATH: `${binDir}:/usr/bin:/bin` }, ); expect(result.status).toBe(0); - expect(result.stdout).toContain("wsl-detect=0"); - expect(result.stdout).toContain("wsl-docker=0"); - expect(result.stdout).toContain("wsl-docker-engine=1"); - expect(result.stdout).toContain("darwin-wsl=1"); - expect(result.stdout).toContain("darwin-docker-desktop=1"); + expect(result.stdout.trim()).toBe("http://host.openshell.internal:11435/v1"); + fs.rmSync(binDir, { recursive: true, force: true }); }); it("rejects unknown local providers", () => { From b2e2e8547d7174d73a194dc3c1bb839fcd8ae2f5 Mon Sep 17 00:00:00 2001 From: Chengjie Wang Date: Tue, 7 Jul 2026 03:25:02 +0800 Subject: [PATCH 6/9] fix(runtime): align shell WSL detection Signed-off-by: Chengjie Wang --- docs/reference/troubleshooting.mdx | 4 + scripts/lib/runtime.sh | 8 ++ test/runtime-shell.test.ts | 129 ++++++++++++++++++++++------- 3 files changed, 109 insertions(+), 32 deletions(-) diff --git a/docs/reference/troubleshooting.mdx b/docs/reference/troubleshooting.mdx index 8dc0e95b2b6..7b5c1862dca 100644 --- a/docs/reference/troubleshooting.mdx +++ b/docs/reference/troubleshooting.mdx @@ -1738,6 +1738,10 @@ This managed route is the supported NemoClaw fix for local Ollama. It does not make manually created OpenShell providers or direct sandbox curls that use `host.docker.internal:11434` portable; those literal routes remain outside the managed `ollama-local` path and can still fail inside k3s. +On WSL with Docker Desktop, NemoClaw detects the loopback-capable runtime and +can use the raw `11434` route because Docker Desktop bridges the WSL host +loopback back into containers. Other runtimes keep the auth-proxy route by +default. If you need a different host service exposed to the sandbox, route it through the OpenShell gateway rather than relying on `host.docker.internal`. Refer to issue [#3136](https://github.com/NVIDIA/NemoClaw/issues/3136). diff --git a/scripts/lib/runtime.sh b/scripts/lib/runtime.sh index 0cae9ae7304..a0feb6ff850 100755 --- a/scripts/lib/runtime.sh +++ b/scripts/lib/runtime.sh @@ -119,6 +119,12 @@ is_wsl_runtime() { # Remove this local workaround after OpenShell exposes one uniform # sandbox-to-host local-service route for WSL and non-WSL runtimes. Review by # 2026-12-31. + local system_name + system_name="$(uname -s 2>/dev/null || true)" + if [ "$system_name" != "Linux" ]; then + return 1 + fi + if [ -n "${WSL_DISTRO_NAME:-}" ] || [ -n "${WSL_INTEROP:-}" ]; then return 0 fi @@ -166,6 +172,8 @@ get_ollama_container_port() { _validate_port NEMOCLAW_OLLAMA_PORT "$ollama_port" || return 1 printf '%s\n' "$ollama_port" else + # The WSL Docker Desktop loopback path does not use the proxy listener, so + # the raw/proxy equality check is only required when both listeners coexist. _validate_port NEMOCLAW_OLLAMA_PROXY_PORT "$ollama_proxy_port" || return 1 if [ "$ollama_port" = "$ollama_proxy_port" ]; then printf 'Invalid NEMOCLAW_OLLAMA_PROXY_PORT=%s (must differ from NEMOCLAW_OLLAMA_PORT on non-WSL hosts)\n' "$ollama_proxy_port" >&2 diff --git a/test/runtime-shell.test.ts b/test/runtime-shell.test.ts index 386be4066b7..3632b693e8d 100644 --- a/test/runtime-shell.test.ts +++ b/test/runtime-shell.test.ts @@ -192,20 +192,35 @@ describe("shell runtime helpers", () => { it("returns the raw Ollama port only for WSL Docker Desktop loopback routing (#3136)", () => { const binDir = createFakeDockerInfo("Docker Desktop"); - const result = runShell( - `uname() { printf '5.15.90.1-microsoft-standard-WSL2\\n'; } - source "${RUNTIME_SH}" - get_local_provider_base_url ollama-local`, - { PATH: `${binDir}:/usr/bin:/bin` }, - ); - expect(result.status).toBe(0); - expect(result.stdout.trim()).toBe("http://host.openshell.internal:11434/v1"); - fs.rmSync(binDir, { recursive: true, force: true }); + try { + const result = runShell( + `uname() { + case "$1" in + -s) printf 'Linux\\n' ;; + -r) printf '5.15.90.1-microsoft-standard-WSL2\\n' ;; + *) printf 'Linux\\n' ;; + esac + } + source "${RUNTIME_SH}" + get_local_provider_base_url ollama-local`, + { PATH: `${binDir}:/usr/bin:/bin` }, + ); + expect(result.status).toBe(0); + expect(result.stdout.trim()).toBe("http://host.openshell.internal:11434/v1"); + } finally { + fs.rmSync(binDir, { recursive: true, force: true }); + } }); - it("detects WSL from WSL_DISTRO_NAME (#3136)", () => { + it("detects WSL from WSL_DISTRO_NAME on Linux (#3136)", () => { const result = runShell( - `uname() { printf '23.0.0-darwin\\n'; } + `uname() { + case "$1" in + -s) printf 'Linux\\n' ;; + -r) printf '6.1.0\\n' ;; + *) printf 'Linux\\n' ;; + esac + } source "${RUNTIME_SH}" is_wsl_runtime`, { WSL_DISTRO_NAME: "Ubuntu" }, @@ -213,9 +228,15 @@ describe("shell runtime helpers", () => { expect(result.status).toBe(0); }); - it("detects WSL from WSL_INTEROP (#3136)", () => { + it("detects WSL from WSL_INTEROP on Linux (#3136)", () => { const result = runShell( - `uname() { printf '23.0.0-darwin\\n'; } + `uname() { + case "$1" in + -s) printf 'Linux\\n' ;; + -r) printf '6.1.0\\n' ;; + *) printf 'Linux\\n' ;; + esac + } source "${RUNTIME_SH}" is_wsl_runtime`, { WSL_INTEROP: "/run/WSL/123_interop" }, @@ -223,6 +244,32 @@ describe("shell runtime helpers", () => { expect(result.status).toBe(0); }); + it("ignores WSL env on non-Linux hosts and keeps ollama-local on the proxy route (#3136)", () => { + const binDir = createFakeDockerInfo("Docker Desktop"); + try { + const result = runShell( + `uname() { + case "$1" in + -s) printf 'Darwin\\n' ;; + -r) printf '23.0.0-darwin\\n' ;; + *) printf 'Darwin\\n' ;; + esac + } + source "${RUNTIME_SH}" + get_local_provider_base_url ollama-local`, + { + PATH: `${binDir}:/usr/bin:/bin`, + WSL_DISTRO_NAME: "Ubuntu", + WSL_INTEROP: "/run/WSL/123_interop", + }, + ); + expect(result.status).toBe(0); + expect(result.stdout.trim()).toBe("http://host.openshell.internal:11435/v1"); + } finally { + fs.rmSync(binDir, { recursive: true, force: true }); + } + }); + it("honors the configured Ollama proxy port for sandbox-facing URLs (#3136)", () => { const result = runShell( `uname() { printf '23.0.0-darwin\\n'; } @@ -252,16 +299,25 @@ describe("shell runtime helpers", () => { it("rejects an invalid Ollama raw port on the WSL Docker Desktop path (#3136)", () => { const binDir = createFakeDockerInfo("Docker Desktop"); - const result = runShell( - `uname() { printf '5.15.90.1-microsoft-standard-WSL2\\n'; } - source "${RUNTIME_SH}" - get_local_provider_base_url ollama-local`, - { NEMOCLAW_OLLAMA_PORT: "bad", PATH: `${binDir}:/usr/bin:/bin` }, - ); - expect(result.status).not.toBe(0); - expect(result.stdout).toBe(""); - expect(result.stderr).toContain("Invalid NEMOCLAW_OLLAMA_PORT=bad"); - fs.rmSync(binDir, { recursive: true, force: true }); + try { + const result = runShell( + `uname() { + case "$1" in + -s) printf 'Linux\\n' ;; + -r) printf '5.15.90.1-microsoft-standard-WSL2\\n' ;; + *) printf 'Linux\\n' ;; + esac + } + source "${RUNTIME_SH}" + get_local_provider_base_url ollama-local`, + { NEMOCLAW_OLLAMA_PORT: "bad", PATH: `${binDir}:/usr/bin:/bin` }, + ); + expect(result.status).not.toBe(0); + expect(result.stdout).toBe(""); + expect(result.stderr).toContain("Invalid NEMOCLAW_OLLAMA_PORT=bad"); + } finally { + fs.rmSync(binDir, { recursive: true, force: true }); + } }); it("falls back to the Ollama proxy when Docker runtime detection is unavailable (#3136)", () => { @@ -306,15 +362,24 @@ describe("shell runtime helpers", () => { it("keeps non-WSL Docker Desktop on the managed proxy route (#3136)", () => { const binDir = createFakeDockerInfo("Docker Desktop"); - const result = runShell( - `uname() { printf '23.0.0-darwin\\n'; } - source "${RUNTIME_SH}" - get_local_provider_base_url ollama-local`, - { PATH: `${binDir}:/usr/bin:/bin` }, - ); - expect(result.status).toBe(0); - expect(result.stdout.trim()).toBe("http://host.openshell.internal:11435/v1"); - fs.rmSync(binDir, { recursive: true, force: true }); + try { + const result = runShell( + `uname() { + case "$1" in + -s) printf 'Darwin\\n' ;; + -r) printf '23.0.0-darwin\\n' ;; + *) printf 'Darwin\\n' ;; + esac + } + source "${RUNTIME_SH}" + get_local_provider_base_url ollama-local`, + { PATH: `${binDir}:/usr/bin:/bin` }, + ); + expect(result.status).toBe(0); + expect(result.stdout.trim()).toBe("http://host.openshell.internal:11435/v1"); + } finally { + fs.rmSync(binDir, { recursive: true, force: true }); + } }); it("rejects unknown local providers", () => { From 697ff2960e125908baca6260a294d3723faae92a Mon Sep 17 00:00:00 2001 From: Apurv Kumaria Date: Wed, 8 Jul 2026 15:57:54 -0700 Subject: [PATCH 7/9] fix(runtime): remove dead routing helper parameters Co-authored-by: Chengjie Wang Signed-off-by: Apurv Kumaria --- scripts/lib/runtime.sh | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/scripts/lib/runtime.sh b/scripts/lib/runtime.sh index a0feb6ff850..22fe41acabc 100755 --- a/scripts/lib/runtime.sh +++ b/scripts/lib/runtime.sh @@ -129,10 +129,8 @@ is_wsl_runtime() { return 0 fi - local release="${1:-}" - if [ -z "$release" ]; then - release="$(uname -r 2>/dev/null || true)" - fi + local release + release="$(uname -r 2>/dev/null || true)" local normalized normalized="$(printf '%s' "$release" | tr '[:upper:]' '[:lower:]')" [[ "$normalized" == *microsoft* ]] @@ -152,14 +150,12 @@ container_can_reach_host_loopback() { # Only WSL + Docker Desktop is allowed to use raw host loopback. Every other # runtime, including macOS Docker Desktop, Colima, Podman, and native Docker, # defaults to the auth proxy as the security fail-safe. - local runtime="${1:-}" if ! is_wsl_runtime; then return 1 fi - if [ -z "$runtime" ]; then - runtime="$(detect_container_runtime_from_docker)" - fi + local runtime + runtime="$(detect_container_runtime_from_docker)" [ "$runtime" = "docker-desktop" ] } From c24941bf79c1f88e5af2575b1f086733b736ed69 Mon Sep 17 00:00:00 2001 From: Apurv Kumaria Date: Wed, 8 Jul 2026 16:07:55 -0700 Subject: [PATCH 8/9] fix(runtime): validate proxied Ollama daemon port Co-authored-by: Chengjie Wang Signed-off-by: Apurv Kumaria --- scripts/lib/runtime.sh | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/scripts/lib/runtime.sh b/scripts/lib/runtime.sh index 22fe41acabc..0613b959f09 100755 --- a/scripts/lib/runtime.sh +++ b/scripts/lib/runtime.sh @@ -164,8 +164,10 @@ get_ollama_container_port() { local ollama_port="${NEMOCLAW_OLLAMA_PORT:-11434}" local ollama_proxy_port="${NEMOCLAW_OLLAMA_PROXY_PORT:-11435}" + # Both routes ultimately depend on the host Ollama daemon: the WSL path + # reaches it directly, while the managed proxy forwards to this raw port. + _validate_port NEMOCLAW_OLLAMA_PORT "$ollama_port" || return 1 if container_can_reach_host_loopback; then - _validate_port NEMOCLAW_OLLAMA_PORT "$ollama_port" || return 1 printf '%s\n' "$ollama_port" else # The WSL Docker Desktop loopback path does not use the proxy listener, so From 0db08401f064169421443a5a5d1ab61f4353df19 Mon Sep 17 00:00:00 2001 From: Apurv Kumaria Date: Wed, 8 Jul 2026 23:38:27 -0700 Subject: [PATCH 9/9] test(runtime): pin Ollama routing parity Co-authored-by: Chengjie Wang Signed-off-by: Apurv Kumaria --- test/runtime-shell.test.ts | 143 +++++++++++++++++++++++++++++++++++++ 1 file changed, 143 insertions(+) diff --git a/test/runtime-shell.test.ts b/test/runtime-shell.test.ts index d0b38cd3257..6489ae4b461 100644 --- a/test/runtime-shell.test.ts +++ b/test/runtime-shell.test.ts @@ -7,6 +7,9 @@ import os from "node:os"; import path from "node:path"; import { describe, expect, it } from "vitest"; +import { OLLAMA_PORT, OLLAMA_PROXY_PORT } from "../src/lib/core/ports"; +import { type ContainerRuntime, containerCanReachHostLoopback, isWsl } from "../src/lib/platform"; + const RUNTIME_SH = path.join(import.meta.dirname, "..", "scripts", "lib", "runtime.sh"); function runShell( @@ -47,6 +50,20 @@ esac return binDir; } +const ROUTING_RUNTIME_FIXTURES: ReadonlyArray<{ + info: string; + runtime: ContainerRuntime; +}> = [ + { info: "Docker Desktop 4.42.1", runtime: "docker-desktop" }, + { info: "Docker Engine - Community 24.0.9", runtime: "docker" }, + { info: "Docker Engine - Community 25.0.5", runtime: "docker" }, + { info: "Docker Engine - Community 26.1.4", runtime: "docker" }, + { info: "Docker Engine - Community 27.5.1", runtime: "docker" }, + { info: "podman version 5.4.1", runtime: "podman" }, + { info: "colima 0.8.4 docker", runtime: "colima" }, + { info: "unrecognized runtime", runtime: "unknown" }, +]; + describe("shell runtime helpers", () => { it("respects an existing DOCKER_HOST", () => { const result = runShell(`source "${RUNTIME_SH}"; detect_docker_host`, { @@ -244,6 +261,103 @@ describe("shell runtime helpers", () => { expect(result.status).toBe(0); }); + it.each([ + { + env: { WSL_DISTRO_NAME: "Ubuntu", WSL_INTEROP: "" }, + platform: "linux" as const, + release: "6.1.0", + systemName: "Linux", + }, + { + env: { WSL_DISTRO_NAME: "", WSL_INTEROP: "/run/WSL/123_interop" }, + platform: "linux" as const, + release: "6.1.0", + systemName: "Linux", + }, + { + env: { WSL_DISTRO_NAME: "", WSL_INTEROP: "" }, + platform: "linux" as const, + release: "5.15.90.1-microsoft-standard-WSL2", + systemName: "Linux", + }, + { + env: { WSL_DISTRO_NAME: "", WSL_INTEROP: "" }, + platform: "linux" as const, + release: "6.1.0", + systemName: "Linux", + }, + { + env: { WSL_DISTRO_NAME: "Ubuntu", WSL_INTEROP: "/run/WSL/123_interop" }, + platform: "darwin" as const, + release: "24.6.0", + systemName: "Darwin", + }, + ])("matches TypeScript WSL classification for $systemName $release (#3136)", ({ + env, + platform, + release, + systemName, + }) => { + const result = runShell( + `uname() { + case "$1" in + -s) printf '%s\\n' '${systemName}' ;; + -r) printf '%s\\n' '${release}' ;; + *) printf '%s\\n' '${systemName}' ;; + esac + } + source "${RUNTIME_SH}" + is_wsl_runtime`, + env, + ); + + const shellDetectedWsl = result.status === 0; + const typescriptDetectedWsl = isWsl({ env, platform, procVersion: "", release }); + expect(shellDetectedWsl).toBe(typescriptDetectedWsl); + }); + + it.each( + [false, true].flatMap((isWslHost) => + ROUTING_RUNTIME_FIXTURES.map(({ info, runtime }) => ({ info, isWslHost, runtime })), + ), + )("matches TypeScript Ollama routing for $runtime with isWsl=$isWslHost (#3136)", ({ + info, + isWslHost, + runtime, + }) => { + const binDir = createFakeDockerInfo(info); + try { + const result = runShell( + `uname() { + case "$1" in + -s) printf 'Linux\\n' ;; + -r) printf '6.1.0-generic\\n' ;; + *) printf 'Linux\\n' ;; + esac + } + source "${RUNTIME_SH}" + get_local_provider_base_url ollama-local`, + { + NEMOCLAW_OLLAMA_PORT: "", + NEMOCLAW_OLLAMA_PROXY_PORT: "", + PATH: `${binDir}:/usr/bin:/bin`, + WSL_DISTRO_NAME: isWslHost ? "Ubuntu" : "", + WSL_INTEROP: "", + }, + ); + const expectedPort = containerCanReachHostLoopback(runtime, { isWsl: isWslHost }) + ? OLLAMA_PORT + : OLLAMA_PROXY_PORT; + + expect(result.status, result.stderr).toBe(0); + expect(result.stdout.trim()).toBe( + `http://host.openshell.internal:${String(expectedPort)}/v1`, + ); + } finally { + fs.rmSync(binDir, { recursive: true, force: true }); + } + }); + it("ignores WSL env on non-Linux hosts and keeps ollama-local on the proxy route (#3136)", () => { const binDir = createFakeDockerInfo("Docker Desktop"); try { @@ -347,6 +461,35 @@ describe("shell runtime helpers", () => { expect(result.stderr).toContain("must differ from NEMOCLAW_OLLAMA_PORT"); }); + it("allows equal ports when WSL Docker Desktop bypasses the proxy listener (#3136)", () => { + const binDir = createFakeDockerInfo("Docker Desktop 4.42.1"); + try { + const result = runShell( + `uname() { + case "$1" in + -s) printf 'Linux\\n' ;; + -r) printf '6.1.0-generic\\n' ;; + *) printf 'Linux\\n' ;; + esac + } + source "${RUNTIME_SH}" + get_local_provider_base_url ollama-local`, + { + NEMOCLAW_OLLAMA_PORT: "11434", + NEMOCLAW_OLLAMA_PROXY_PORT: "11434", + PATH: `${binDir}:/usr/bin:/bin`, + WSL_DISTRO_NAME: "Ubuntu", + WSL_INTEROP: "", + }, + ); + + expect(result.status, result.stderr).toBe(0); + expect(result.stdout.trim()).toBe("http://host.openshell.internal:11434/v1"); + } finally { + fs.rmSync(binDir, { recursive: true, force: true }); + } + }); + it("checks ollama-local health on the raw daemon while sandbox URLs use the proxy (#3136)", () => { const result = runShell( `uname() { printf '23.0.0-darwin\\n'; }