Skip to content

Conversation

@celia-oai
Copy link
Contributor

@celia-oai celia-oai commented Nov 19, 2025

We want to better uncover error status code for clients. Add an optional status_code to error events (for core error, stream error events) so app server could uncover the status code from the client side later.

in event log:

< {
<   "method": "codex/event/stream_error",
<   "params": {
<     "conversationId": "019a9a32-f576-7292-9711-8e57e8063536",
<     "id": "0",
<     "msg": {
<       "message": "Reconnecting... 5/5",
<       "status_code": 401,
<       "type": "stream_error"
<     }
<   }
< }
< {
<   "method": "codex/event/error",
<   "params": {
<     "conversationId": "019a9a32-f576-7292-9711-8e57e8063536",
<     "id": "0",
<     "msg": {
<       "message": "exceeded retry limit, last status: 401 Unauthorized, request id: 9a0cb03a485067f7-SJC",
<       "status_code": 401,
<       "type": "error"
<     }
<   }
< }

@celia-oai celia-oai force-pushed the dev/cc/error-message-change branch 6 times, most recently from fb4fe6a to 482a1fb Compare November 19, 2025 03:08
@celia-oai celia-oai changed the title [draft] [core] add optional status_code to error events Nov 19, 2025
@celia-oai celia-oai force-pushed the dev/cc/error-message-change branch 4 times, most recently from 09d0b8b to 6ad8a5d Compare November 19, 2025 03:29
@celia-oai celia-oai marked this pull request as ready for review November 19, 2025 03:31
@celia-oai celia-oai force-pushed the dev/cc/error-message-change branch from 6ad8a5d to 04b49ca Compare November 19, 2025 03:36
@celia-oai celia-oai requested a review from pakrym-oai November 19, 2025 03:37
@chatgpt-codex-connector
Copy link
Contributor

💡 Codex Review

}
#[derive(Debug, Clone, Deserialize, Serialize, JsonSchema, TS)]
pub struct StreamErrorEvent {
pub message: String,
#[serde(default)]
pub status_code: Option<u16>,

P0 Badge Restore StreamErrorEvent struct literals

With this commit StreamErrorEvent now has a new status_code field, but the literals in codex-rs/tui/src/chatwidget/tests.rs (e.g. the stream_error_updates_status_indicator test) were not updated and still construct StreamErrorEvent { message: … }. Because the struct is not marked #[non_exhaustive] and the field isn’t given a default in the literal, cargo test -p codex-tui will no longer compile. Please add status_code: None (or similar) everywhere we construct that struct.

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Copy link
Contributor

@owenlin0 owenlin0 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nice! 👍

@celia-oai celia-oai force-pushed the dev/cc/error-message-change branch from 04b49ca to 17d478e Compare November 19, 2025 19:02
@celia-oai celia-oai force-pushed the dev/cc/error-message-change branch 3 times, most recently from 436da71 to 6425f44 Compare November 19, 2025 19:33
@celia-oai celia-oai force-pushed the dev/cc/error-message-change branch from 6425f44 to 9be42ef Compare November 19, 2025 19:37
@celia-oai celia-oai enabled auto-merge (squash) November 19, 2025 19:40
@celia-oai celia-oai merged commit c2ec477 into main Nov 19, 2025
25 checks passed
@celia-oai celia-oai deleted the dev/cc/error-message-change branch November 19, 2025 19:51
@github-actions github-actions bot locked and limited conversation to collaborators Nov 19, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants