fix(confidence-engine): extend reconstruction chat timeout
This commit is contained in:
@@ -10,6 +10,7 @@ describe("OllamaLlmProvider chat capability detection", () => {
|
||||
ok: true,
|
||||
json: async () => ({ message: { content: "{}" } }),
|
||||
});
|
||||
const setTimeoutSpy = vi.spyOn(globalThis, "setTimeout");
|
||||
vi.stubGlobal("fetch", fetchSpy);
|
||||
process.env.OLLAMA_BASE_URL = "http://ollama.test";
|
||||
|
||||
@@ -24,6 +25,7 @@ describe("OllamaLlmProvider chat capability detection", () => {
|
||||
expect(fetchSpy.mock.calls[0][0]).toBe("http://ollama.test/api/chat");
|
||||
expect(fetchSpy.mock.calls[1][0]).toBe("http://ollama.test/api/chat");
|
||||
expect(fetchSpy.mock.calls[1][0]).not.toContain("/api/generate");
|
||||
expect(setTimeoutSpy).toHaveBeenCalledWith(expect.any(Function), 300000);
|
||||
const chatRequest = JSON.parse(fetchSpy.mock.calls[1][1].body);
|
||||
expect(chatRequest).toMatchObject({
|
||||
model: "configured-model",
|
||||
@@ -46,6 +48,7 @@ describe("OllamaLlmProvider chat capability detection", () => {
|
||||
},
|
||||
});
|
||||
} finally {
|
||||
setTimeoutSpy.mockRestore();
|
||||
vi.unstubAllGlobals();
|
||||
if (originalBaseUrl === undefined) delete process.env.OLLAMA_BASE_URL;
|
||||
else process.env.OLLAMA_BASE_URL = originalBaseUrl;
|
||||
|
||||
Reference in New Issue
Block a user