fix(confidence-engine): decouple app health from provider

This commit is contained in:
2026-09-09 20:00:52 +01:00
parent 00d7593ffd
commit 96b47d16a3
2 changed files with 6 additions and 41 deletions
+5 -10
View File
@@ -103,23 +103,18 @@ describe("authenticated product boundary", () => {
const response = await GET();
expect(mockGetAuthenticatedUser).not.toHaveBeenCalled();
const body = await response.json();
expect(body).toHaveProperty("healthy");
// Must not expose private config details in the public response
expect(JSON.stringify(body)).not.toContain("baseUrl");
expect(JSON.stringify(body)).not.toContain("model");
expect(JSON.stringify(body)).not.toContain("ollama");
expect(response.status).toBe(200);
await expect(response.json()).resolves.toEqual({ healthy: true });
});
it("reports unhealthy generic state when config is missing", async () => {
it("remains healthy when reasoning configuration is missing", async () => {
mockGetConfig.mockReturnValue({ ok: false });
const { GET } = await import("@/app/api/health/route.js");
const response = await GET();
expect(response.status).toBe(500);
const body = await response.json();
expect(body).toEqual({ healthy: false });
expect(response.status).toBe(200);
await expect(response.json()).resolves.toEqual({ healthy: true });
});
it("does not convert /api/health to 401 via middleware when unauthenticated", async () => {