Skip to content

armgit / codex

Public Imported from GitHub
0

Lightweight coding agent that runs in your terminal

Rust

(feat) add request error details (#31)

Adam Montgomery94889dd76edf
diff --git a/codex-cli/src/utils/agent/agent-loop.ts b/codex-cli/src/utils/agent/agent-loop.ts
index 9882a49eb7..c7d5655676 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.`;
})(),
},
],