Skip to content
Source
Sign inSign up
pingdotgg/t3code

fix(web): show readable messages for structured thread errors #9950

Closedjuliusmarmingewants to merge 2 commits intomain fromfix/audit-thread-error-headlineopened View on GitHub

Showing 2 changed files with 103 additions and 1 deletion.

x
0 of 2 viewed, 2 left
81 additions and 0 deletionsapps/web/src/components/chat/ThreadErrorBanner.test.tsxModified
View file
@@ -4,12 +4,93 @@
import {
dismissThreadErrorBannerForSession,
getThreadErrorBannerKey,
+ getThreadErrorBannerMessage,
isThreadErrorBannerDismissedForSession,
shouldShowThreadErrorBanner,
ThreadErrorBanner,
} from "./ThreadErrorBanner";
​
+describe("getThreadErrorBannerMessage", () => {
+ it("shows the message from the reported unsupported-model error", () => {
+ const error =
+ '{"type":"error","status":400,"error":{"type":"invalid_request_error","message":"The \'gpt-5.3-codex\' model is not supported when using Codex with a ChatGPT account."}}';
+​
+ expect(getThreadErrorBannerMessage(error)).toBe(
+ "The 'gpt-5.3-codex' model is not supported when using Codex with a ChatGPT account.",
+ );
+ });
+​
+ it("shows the message from the reported multiline error", () => {
+ const error = `{
+ "error": {
+ "message": "X-OpenAI-Internal-Codex-Responses-Lite only supports function tools, custom tools, and client-executed tool search.",
+ "type": "invalid_request_error",
+ "param": "tools",
+ "code": "unsupported_value"
+ }
+}`;
+​