fix: suppress raw API error payloads (#924) (thanks @grp06)

Co-authored-by: George Pickett <gpickett00@gmail.com>
This commit is contained in:
Peter Steinberger
2026-01-15 01:34:19 +00:00
parent 393d21d86c
commit f65668cb5f
6 changed files with 199 additions and 10 deletions

View File

@@ -33,4 +33,10 @@ describe("formatAssistantErrorText", () => {
"The AI service is temporarily overloaded. Please try again in a moment.",
);
});
it("suppresses raw error JSON payloads that are not otherwise classified", () => {
const msg = makeAssistantError(
'{"type":"error","error":{"message":"Something exploded","type":"server_error"}}',
);
expect(formatAssistantErrorText(msg)).toBe("The AI service returned an error. Please try again.");
});
});