fix(confidence-engine): sanitize focused reasoning outage

This commit is contained in:
2026-09-09 17:34:56 +01:00
parent 6974b710de
commit ed033e71d5
5 changed files with 56 additions and 1 deletions
@@ -144,9 +144,15 @@ async function post(request) {
});
console.info("[api/focused-investigation/deconstruct] end", {
targetNodeId,
status: 500,
status: e?.code === "PROVIDER_UNAVAILABLE" ? 503 : 500,
elapsedMs,
});
if (e?.code === "PROVIDER_UNAVAILABLE") {
return Response.json(
{ error: "Reasoning service is temporarily unavailable." },
{ status: 503 },
);
}
return Response.json(
{ error: e.message || "Unknown server error" },
{ status: 500 },