fix(confidence-engine): preserve successful chat detection
This commit is contained in:
@@ -5,7 +5,7 @@ describe("OllamaLlmProvider chat capability detection", () => {
|
||||
it("uses the configured model for the chat probe and keeps the chat path", async () => {
|
||||
const originalBaseUrl = process.env.OLLAMA_BASE_URL;
|
||||
const fetchSpy = vi.fn()
|
||||
.mockResolvedValueOnce({ ok: true, body: { consume: vi.fn() } })
|
||||
.mockResolvedValueOnce({ ok: true, text: async () => "" })
|
||||
.mockResolvedValueOnce({
|
||||
ok: true,
|
||||
json: async () => ({ message: { content: "{}" } }),
|
||||
@@ -55,7 +55,7 @@ describe("OllamaLlmProvider chat capability detection", () => {
|
||||
it("reports chat-skipped generate fallback execution", async () => {
|
||||
const originalBaseUrl = process.env.OLLAMA_BASE_URL;
|
||||
const fetchSpy = vi.fn()
|
||||
.mockResolvedValueOnce({ ok: false, status: 501, body: { consume: vi.fn() } })
|
||||
.mockResolvedValueOnce({ ok: false, status: 501, text: async () => "" })
|
||||
.mockResolvedValueOnce({ ok: false, status: 500, text: async () => "failure" });
|
||||
vi.stubGlobal("fetch", fetchSpy);
|
||||
process.env.OLLAMA_BASE_URL = "http://ollama.test";
|
||||
@@ -84,8 +84,8 @@ describe("OllamaLlmProvider chat capability detection", () => {
|
||||
it("reports chat-attempt-failed generate fallback execution", async () => {
|
||||
const originalBaseUrl = process.env.OLLAMA_BASE_URL;
|
||||
const fetchSpy = vi.fn()
|
||||
.mockResolvedValueOnce({ ok: true, body: { consume: vi.fn() } })
|
||||
.mockResolvedValueOnce({ ok: false, body: { consume: vi.fn() } })
|
||||
.mockResolvedValueOnce({ ok: true, text: async () => "" })
|
||||
.mockResolvedValueOnce({ ok: false, text: async () => "" })
|
||||
.mockResolvedValueOnce({ ok: false, status: 500, text: async () => "failure" });
|
||||
vi.stubGlobal("fetch", fetchSpy);
|
||||
process.env.OLLAMA_BASE_URL = "http://ollama.test";
|
||||
|
||||
Reference in New Issue
Block a user