fix(confidence-engine): sanitize reasoning error responses
This commit is contained in:
@@ -360,7 +360,7 @@ describe("focused-deconstruct targetNodeId identity boundary", () => {
|
||||
expect(json.providerExecution).toBeUndefined();
|
||||
});
|
||||
|
||||
it("preserves the 500 provider-failure contract while logging structural diagnostics", async () => {
|
||||
it("sanitizes generic provider failures while logging structural diagnostics", async () => {
|
||||
const errorSpy = vi.spyOn(console, "error").mockImplementation(() => {});
|
||||
vi.doMock("@/lib/llm/provider", () => ({
|
||||
getProvider: () => ({
|
||||
@@ -383,7 +383,7 @@ describe("focused-deconstruct targetNodeId identity boundary", () => {
|
||||
}),
|
||||
}));
|
||||
expect(response.status).toBe(500);
|
||||
await expect(response.json()).resolves.toEqual({ error: "provider failed" });
|
||||
await expect(response.json()).resolves.toEqual({ error: "Reasoning request could not be completed." });
|
||||
expect(errorSpy).toHaveBeenCalledWith(
|
||||
"[api/focused-investigation/deconstruct] provider failure",
|
||||
expect.objectContaining({ targetNodeId: "node-id", providerApiPath: "/v1/responses" }),
|
||||
|
||||
Reference in New Issue
Block a user