Conversation
aibrahim-oai
commented
Mar 17, 2026
- route realtime startup, input, and transport failures through a single shutdown path
- emit one realtime error/closed lifecycle while clearing session state once
Co-authored-by: Codex <noreply@openai.com>
Co-authored-by: Codex <noreply@openai.com>
Co-authored-by: Codex <noreply@openai.com>
Co-authored-by: Codex <noreply@openai.com>
Co-authored-by: Codex <noreply@openai.com>
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 24ffd8d6f8
ℹ️ 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".
| if let Err(err) = handle_start_inner(sess, &sub_id, params).await { | ||
| error!("failed to start realtime conversation: {err}"); | ||
| let message = err.to_string(); | ||
| sess.send_event_raw(Event { | ||
| id: sub_id.clone(), | ||
| msg: EventMsg::RealtimeConversationRealtime(RealtimeConversationRealtimeEvent { | ||
| payload: RealtimeEvent::Error(message), | ||
| }), | ||
| }) | ||
| .await; | ||
| end_realtime_conversation(sess, sub_id, RealtimeConversationEnd::Error).await; |
There was a problem hiding this comment.
Do not shutdown active session on pre-start validation failure
handle_start now calls end_realtime_conversation for any handle_start_inner error. But realtime_api_key() / realtime_request_headers() can fail before conversation.start() runs. In that case, a malformed new start request can terminate an unrelated already-running realtime session via shutdown(). Previously these preflight failures only emitted an error event and did not close existing state.
Useful? React with 👍 / 👎.
Co-authored-by: Codex <noreply@openai.com>
Co-authored-by: Codex <noreply@openai.com>
|
@codex review this |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 0e0481ba0f
ℹ️ 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".
| if sess.conversation.running_state().await.is_some() { | ||
| let message = err.to_string(); | ||
| sess.send_event_raw(Event { | ||
| id: sub_id.clone(), | ||
| msg: EventMsg::RealtimeConversationRealtime(RealtimeConversationRealtimeEvent { | ||
| payload: RealtimeEvent::Error(message), | ||
| }), | ||
| }) | ||
| .await; | ||
| end_realtime_conversation(sess, sub_id, RealtimeConversationEnd::Error).await; | ||
| } else { |
There was a problem hiding this comment.
Gate error shutdown to avoid out-of-order realtime lifecycle
This branch can emit RealtimeEvent::Error + RealtimeConversationClosed("error") from input ops while the transport task has already queued upstream realtime events. When that queue drains afterward, clients may receive additional realtime events/errors after closed, or duplicate error notifications. This violates the intended single ordered error/closed lifecycle and can confuse app-server/TUI state machines.
Useful? React with 👍 / 👎.
Co-own the realtime fanout task so shutdown stops the full session before closed is emitted. Also keep start/connect failures as error-only until started is sent.\n\nCo-authored-by: Codex <noreply@openai.com>
|
@codex review this |
|
Codex Review: Didn't find any major issues. Can't wait for the next one! ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
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". |
Co-authored-by: Codex <noreply@openai.com>
Co-authored-by: Codex <noreply@openai.com>
Co-authored-by: Codex <noreply@openai.com>
Co-authored-by: Codex <noreply@openai.com>
Co-authored-by: Codex <noreply@openai.com>