Skip to content

Commit cb82dcf

Browse files
fix(ollama): allow Orb host local auth
1 parent a208079 commit cb82dcf

6 files changed

Lines changed: 8 additions & 5 deletions

File tree

CHANGELOG.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ Docs: https://docs.openclaw.ai
1515

1616
### Fixes
1717

18-
- Providers/Ollama: treat OrbStack host aliases as local Ollama endpoints so `ollama-local` marker auth works when OpenClaw runs inside Orb and Ollama runs on the host. Fixes #84875.
18+
- Providers/Ollama: treat Docker/OrbStack host aliases as local Ollama endpoints so `ollama-local` marker auth works when OpenClaw runs inside a VM/container and Ollama runs on the host. Fixes #84875.
1919
- Agents: cap heartbeat model bleed context hints by the stored session window when runtime model metadata is unavailable, so overflow recovery advice does not suggest a larger window than the active session actually has.
2020
- Control UI/Web Push: use `https://openclaw.ai` as the generated default VAPID subject instead of the old localhost mailbox so iOS PWA push setup uses an Apple-acceptable subject when `OPENCLAW_VAPID_SUBJECT` is unset. Fixes #83134. (#83317) Thanks @IWhatsskill.
2121
- Agents/Pi: keep embedded session transcript writes from tripping false takeover detection after packaged npm onboarding agent turns.

extensions/ollama/index.test.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -572,8 +572,8 @@ describe("ollama plugin", () => {
572572
expect(buildOllamaProviderMock).not.toHaveBeenCalled();
573573
});
574574

575-
it.each(["docker.orb.internal", "host.orb.internal"])(
576-
"skips implicit localhost discovery when a custom Orb host Ollama provider is configured for %s",
575+
it.each(["docker.orb.internal", "host.docker.internal", "host.orb.internal"])(
576+
"skips implicit localhost discovery when a custom host-backed Ollama provider is configured for %s",
577577
async (hostname) => {
578578
const provider = registerProvider();
579579

extensions/ollama/src/discovery-shared.test.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ describe("isLocalOllamaBaseUrl", () => {
1616
"http://gpu-node-1:11434",
1717
"http://mac-studio.local:11434",
1818
"http://docker.orb.internal:11434",
19+
"http://host.docker.internal:11434",
1920
"http://host.orb.internal:11434",
2021
"http://[fd00::1]:11434",
2122
"http://[fe90::1]:11434",

extensions/ollama/src/discovery-shared.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,7 @@ const LOCAL_OLLAMA_HOSTNAMES = new Set([
7777
"::1",
7878
"::",
7979
"docker.orb.internal",
80+
"host.docker.internal",
8081
"host.orb.internal",
8182
]);
8283
const LOOPBACK_OLLAMA_HOSTNAMES = new Set(["localhost", "127.0.0.1", "0.0.0.0", "::1", "::"]);

src/agents/model-auth.test.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1111,8 +1111,8 @@ describe("resolveApiKeyForProvider – synthetic local auth for custom providers
11111111
});
11121112
});
11131113

1114-
it.each(["docker.orb.internal", "host.orb.internal"])(
1115-
"accepts ollama-local marker auth for Orb host alias %s",
1114+
it.each(["docker.orb.internal", "host.docker.internal", "host.orb.internal"])(
1115+
"accepts ollama-local marker auth for host-backed alias %s",
11161116
async (hostname) => {
11171117
const auth = await resolveApiKeyForProvider({
11181118
provider: "ollama",

src/agents/model-auth.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -268,6 +268,7 @@ function isLocalBaseUrl(baseUrl: string): boolean {
268268
host === "::ffff:7f00:1" ||
269269
host === "::ffff:127.0.0.1" ||
270270
host === "docker.orb.internal" ||
271+
host === "host.docker.internal" ||
271272
host === "host.orb.internal" ||
272273
host.endsWith(".local") ||
273274
isPrivateIpv4Host(host)

0 commit comments

Comments
 (0)