fix: LLM config manager falls back to userConf.url for baseURL (#4715) (#4761)

This commit is contained in:
Joe Wu
2026-04-13 23:16:18 +08:00
committed by GitHub
parent 1a53852d93
commit 649e719ce6
2 changed files with 15 additions and 0 deletions
+1
View File
@@ -110,6 +110,7 @@ export class ConfigManager {
((userConf as Record<string, unknown>)?.lmstudio_base_url as
| string
| undefined) ??
userConf?.url ??
defaultConf.baseURL;
return {
@@ -127,6 +127,20 @@ describe("ConfigManager", () => {
expect(config.llm.config.url).toBe("http://fallback:11434");
});
it("should use url as baseURL fallback when no baseURL provided (issue #4715)", () => {
const config = ConfigManager.mergeConfig({
embedder: baseEmbedder,
vectorStore: baseVectorStore,
llm: {
provider: "ollama",
config: { model: "llama3.1:8b", url: "http://my-ollama-host:11434" },
},
});
expect(config.llm.config.baseURL).toBe("http://my-ollama-host:11434");
expect(config.llm.config.url).toBe("http://my-ollama-host:11434");
});
it("should use default baseURL when no url or baseURL provided", () => {
const config = ConfigManager.mergeConfig({
embedder: baseEmbedder,