fix(confidence-engine): expose failed provider path

This commit is contained in:
2026-09-05 17:00:33 +01:00
parent 677f5e5757
commit dabd9e2245
9 changed files with 81 additions and 6 deletions
+17
View File
@@ -566,6 +566,23 @@ describe("lib/graph/orchestrator startCase", () => {
expect(result.rawResponse).toHaveLength(2501);
});
it("preserves an attempted provider API path on analysis failure", async () => {
mockAnalyseScenario.mockResolvedValue({
success: false,
error: "Provider failed",
providerApiPath: "/api/chat",
});
const { startCase } = await import("@/lib/graph/orchestrator.js");
const result = await startCase({ scenario: "Scenario text" });
expect(result).toMatchObject({
success: false,
statusCode: 502,
providerApiPath: "/api/chat",
});
});
it("returns null selectedQuestion when neither analysis nor graph path yields a question", async () => {
mockAnalyseScenario.mockResolvedValue(
makeAnalysisResult({