fix(ollama): preserve configured API during discovery#93729
Conversation
|
ClawSweeper review: did not complete due to Codex infrastructure failure. Reviewed June 16, 2026, 2:39 PM ET / 18:39 UTC. Summary PR surface: Source +31, Tests +87. Total +118 across 4 files. Reproducibility: unclear. The review failed before ClawSweeper could establish a reproduction path. Review metrics: none identified. Merge readiness This is a ClawSweeper/Codex infrastructure failure, not a PR readiness or patch-quality verdict. Risk before merge
Maintainer options:
Next step before merge
Review detailsBest possible solution: Retry the Codex review after fixing the execution failure. Do we have a high-confidence way to reproduce the issue? Unclear. The review failed before ClawSweeper could establish a reproduction path. Is this the best way to solve the issue? Unclear. Retry the review first so ClawSweeper can evaluate the actual issue and fix direction. AGENTS.md: unclear because the file could not be read completely. Codex review notes: model internal, reasoning high; reviewed against 617c9d4b7fb4. Evidence reviewedPR surface: Source +31, Tests +87. Total +118 across 4 files. View PR surface stats
What I checked:
Likely related people:
How this review workflow works
|
|
Land-ready maintainer repair complete. The branch now preserves the configured API/base URL through live Ollama discovery and selects native Verification:
The remaining Known proof gap: full OpenClaw one-shot model-run attempts did not exit in this source-worktree environment, so the real proof is the changed live discovery path plus real native/compatible Ollama endpoints and focused route-selection coverage. |
* fix(ollama): preserve configured API during discovery * fix(ollama): keep compatible discovery base URL * fix(ollama): route compatible APIs through configured transport --------- Co-authored-by: Vincent Koc <[email protected]>
* fix(ollama): preserve configured API during discovery * fix(ollama): keep compatible discovery base URL * fix(ollama): route compatible APIs through configured transport --------- Co-authored-by: Vincent Koc <[email protected]>
Summary
openai-completionswithapi: "ollama", sending requests through the native/api/chatpath instead of the configured OpenAI-compatible route.prepareDynamicModel/resolveDynamicModel.api: "ollama"behavior, other providers, core routing, or plugin SDK contracts.Fixes #93710
Real behavior proof
models.providers.ollama.api: "openai-completions"andbaseUrl: ".../v1"remain configured after Ollama discovery even though the live builder uses nativeapi: "ollama"and a native base URL for/api/tagsprobing.node --import tsx --input-type=module -e 'import { resolveOllamaDiscoveryResult } from "./extensions/ollama/src/discovery-shared.ts"; const result = await resolveOllamaDiscoveryResult({ ctx: { config: { models: { providers: { ollama: { baseUrl: "http://192.168.20.14:11434/v1", api: "openai-completions", models: [] } } } }, env: { OLLAMA_API_KEY: "test-key" }, resolveProviderApiKey: () => ({ apiKey: "test-key" }) }, pluginConfig: {}, buildProvider: async () => ({ baseUrl: "http://192.168.20.14:11434", api: "ollama", models: [{ id: "qwen3-coder:cloud", name: "qwen3-coder:cloud" }] }) }); const provider = result?.provider; console.log(JSON.stringify({ configuredApi: "openai-completions", configuredBaseUrl: "http://192.168.20.14:11434/v1", discoveredBuilderApi: "ollama", discoveredBuilderBaseUrl: "http://192.168.20.14:11434", resolvedProviderApi: provider?.api, resolvedBaseUrl: provider?.baseUrl, resolvedModelIds: provider?.models?.map((model) => model.id) ?? [] }, null, 2));' node scripts/run-vitest.mjs extensions/ollama/provider-discovery.test.ts node scripts/run-vitest.mjs extensions/ollama/index.test.ts pnpm check:test-types node scripts/run-oxlint.mjs --deny=warn --ignore-path=.oxlintignore extensions/ollama/index.test.ts extensions/ollama/index.ts extensions/ollama/provider-discovery.test.ts extensions/ollama/src/discovery-shared.ts git diff --check{ "configuredApi": "openai-completions", "configuredBaseUrl": "http://192.168.20.14:11434/v1", "discoveredBuilderApi": "ollama", "discoveredBuilderBaseUrl": "http://192.168.20.14:11434", "resolvedProviderApi": "openai-completions", "resolvedBaseUrl": "http://192.168.20.14:11434/v1", "resolvedModelIds": [ "qwen3-coder:cloud" ] }api: "openai-completions"andbaseUrl: "http://192.168.20.14:11434/v1", while native discovery still probes the normalized Ollama API base athttp://192.168.20.14:11434.Regression Test Plan
extensions/ollama/provider-discovery.test.ts,extensions/ollama/index.test.tsmodels.providers.ollama.api: "openai-completions"andbaseUrl: ".../v1"are preserved through catalog discovery andprepareDynamicModel/resolveDynamicModeleven whenbuildOllamaProvider()returns nativeapi: "ollama"and a native base URL.Root Cause
buildOllamaProvider()correctly normalizes the configured base URL for native Ollama discovery, but the catalog and dynamic-model merge paths reused that native discovery provider as the final runtime provider/model config, replacing the user's OpenAI-compatible API/base URL pair./v1base URL survived discovery-backed paths.