From 94889dd76edff3c184fe1e05c22050f1d9b90570 Mon Sep 17 00:00:00 2001 From: Adam Montgomery <1934358+montasaurus@users.noreply.github.com> Date: Wed, 16 Apr 2025 14:23:42 -0400 Subject: [PATCH] (feat) add request error details (#31) Signed-off-by: Adam Montgomery --- codex-cli/src/utils/agent/agent-loop.ts | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/codex-cli/src/utils/agent/agent-loop.ts b/codex-cli/src/utils/agent/agent-loop.ts index 9882a49e..c7d56556 100644 --- a/codex-cli/src/utils/agent/agent-loop.ts +++ b/codex-cli/src/utils/agent/agent-loop.ts @@ -636,9 +636,16 @@ export class AgentLoop { }> )?.requestId; + const errorDetails = [ + `Status: ${status || "unknown"}`, + `Code: ${errCtx.code || "unknown"}`, + `Type: ${errCtx.type || "unknown"}`, + `Message: ${errCtx.message || "unknown"}`, + ].join(", "); + return `⚠️ OpenAI rejected the request${ reqId ? ` (request ID: ${reqId})` : "" - }. Please verify your settings and try again.`; + }. Error details: ${errorDetails}. Please verify your settings and try again.`; })(), }, ],