Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions src/lib/onboard/provider-menu.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -135,4 +135,18 @@ describe("buildInferenceProviderMenu", () => {
expect(result.options.map((option) => option.key)).toContain("ollama");
expect(result.options.map((option) => option.key)).not.toContain("start-windows-ollama");
});

it("omits Windows-host install when Ollama is reachable but its executable is not detected (#7472)", () => {
const result = buildMenu({
isWsl: true,
hasOllama: false,
ollamaRunning: true,
ollamaHost: "host.docker.internal",
hasWindowsOllama: false,
isWindowsHostOllama: true,
});

expect(result.options.map((option) => option.key)).toContain("ollama");
expect(result.options.map((option) => option.key)).not.toContain("install-windows-ollama");
});
});
2 changes: 1 addition & 1 deletion src/lib/onboard/provider-menu.ts
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ export function buildInferenceProviderMenu(
});
}

if (input.isWsl && !input.hasWindowsOllama) {
if (input.isWsl && !input.hasWindowsOllama && !input.isWindowsHostOllama) {
options.push({
key: "install-windows-ollama",
label: input.windowsHostInstallLabel,
Expand Down
38 changes: 38 additions & 0 deletions src/lib/onboard/setup-nim-flow.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -443,6 +443,44 @@ describe("createSetupNim", () => {
expect(handleRunningOllamaSelection).toHaveBeenCalledTimes(1);
});

it("reuses reachable Windows-host Ollama when PowerShell cannot find its executable (#7472)", async () => {
const model = "qwen3.6:35b";
const handleRunningOllamaSelection = vi.fn<SetupNimFlowDeps["handleRunningOllamaSelection"]>(
async (_gpu, requestedModel, _recoveredModel, ollamaRunning, state) => {
expect(requestedModel).toBe(model);
expect(ollamaRunning).toBe(true);
state.model = model;
state.provider = "ollama-local";
state.endpointUrl = "http://host.docker.internal:11434/v1";
state.credentialEnv = null;
state.preferredInferenceApi = "openai-completions";
return "selected";
},
Comment thread
coderabbitai[bot] marked this conversation as resolved.
);
const setupNim = createSetupNim(
makeDeps({
isNonInteractive: () => true,
getNonInteractiveProvider: () => "install-windows-ollama",
getNonInteractiveModel: () => model,
detectInferenceProviderHostState: () =>
makeHostState({
ollamaHost: "host.docker.internal",
ollamaRunning: true,
isWindowsHostOllama: true,
isWsl: true,
hasWindowsOllama: false,
windowsHostOllamaDockerRequirement:
getWindowsHostOllamaDockerRequirement("docker-desktop"),
}),
handleRunningOllamaSelection,
}),
);

await setupNim(null, null);

expect(handleRunningOllamaSelection).toHaveBeenCalledTimes(1);
});

it("applies same-gateway discovery constraints before a provider probe (#6315)", async () => {
const providerProbe = vi.fn();
const routeGuard = vi.fn(
Expand Down
18 changes: 18 additions & 0 deletions src/lib/onboard/setup-nim-ollama.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -257,6 +257,24 @@ describe("createSetupNimOllamaHandlers", () => {
assert.equal(state.allowToolsIncompatible, true);
});

it("uses the reachable Windows-host endpoint for running Ollama (#7472)", async () => {
const state = makeState();
const { handleRunningOllamaSelection } = createSetupNimOllamaHandlers(
makeDeps({
getLocalProviderBaseUrl: () => "http://host.docker.internal:11434/v1",
}),
);

const result = await handleRunningOllamaSelection(null, "qwen3.6:35b", null, true, state);

expect(result).toBe("selected");
expect(state).toMatchObject({
model: "llama3.1:8b",
provider: "ollama-local",
endpointUrl: "http://host.docker.internal:11434/v1",
});
});

it("passes the Hermes Ollama context floor to systemd repair and model validation", async () => {
const state = makeState();
state.ollamaContextWindowFloor = MIN_HERMES_OLLAMA_CONTEXT_WINDOW;
Expand Down
Loading