You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Surface non-content stream status in the turn status UI #28445
CLIIssues related to the Codex CLITUIIssues related to the terminal user interface: text input, menus and dialogs, and terminal displayenhancementNew feature or request
I ran into a case where a streaming Responses-compatible provider needs to send a non-content status update while a turn is still in progress. The specific use case is an account-capacity wait: the stream is still alive, but no model content is available yet, so the CLI should surface a transient status instead of adding anything to the transcript.
I prepared a small branch that adds a generic ResponseEvent::StreamStatus path and forwards it through the existing turn status surface. The parser currently maps codex.keepalive events with status: "waiting_for_account_capacity" into that generic status event.
I tried opening this as a PR, but the repository currently limits PR creation to collaborators, so I'm sharing the branch here instead.
Why
This lets a stream report transient backend/provider state without injecting assistant text or user-visible transcript content. It reuses the existing StreamError/retry status UI path, so the turn can still complete normally after the status update.
Test plan run locally
just test -p codex-api
just test -p codex-core keepalive_stream_status_emits_stream_error_status
I reviewed the linked branch/diff against current main. The approach is technically small and targets the right layer, but I would separate "stream status" semantics from "stream error" before merging.
What the branch currently does:
Adds ResponseEvent::StreamStatus { message, details } in codex-api.
Parses codex.keepalive with status = "waiting_for_account_capacity" in codex-rs/codex-api/src/sse/responses.rs.
Formats details from retry_after_seconds, waited_seconds, and reason.
Maps that new response event to EventMsg::StreamError(StreamErrorEvent { ... }) in codex-rs/core/src/session/turn.rs.
Excludes StreamStatus from TTFT in codex-rs/core/src/turn_timing.rs.
Adds tests for SSE parsing and the core event path.
That is a good proof of concept. The main concern is the protocol/UI boundary: waiting_for_account_capacity is a transient non-content status while the stream is still alive, not an error. Reusing StreamError may work with existing TUI surfaces, but it risks error-colored UI, error telemetry semantics, and future confusion for clients that interpret StreamError as a degraded/failed stream.
A cleaner shape would be:
Keep ResponseEvent::StreamStatus in codex-api.
Add a distinct protocol event, e.g. EventMsg::StreamStatus(StreamStatusEvent { message, details }) or a more generic TurnStatusUpdate.
Let TUI render it as a transient status while the turn remains in progress.
Keep StreamError for actual stream failures/retry-exhaustion.
The branch is also SSE-only. If websocket streaming can receive the same codex.keepalive / capacity status, the websocket event mapping should get parity or the UX will differ by transport.
Test gap I would add: a TUI/client-level assertion that receiving the status event during an active turn does not add a permanent error history cell and does not mark the turn failed. Current TUI tests already assert replayed StreamError does not add a history cell, but that is still relying on an error-shaped event for a non-error state.
Overall: this is worth doing, and the branch identifies the right event source. I would just avoid encoding a live wait/status as StreamError in the public protocol.
CLIIssues related to the Codex CLITUIIssues related to the terminal user interface: text input, menus and dialogs, and terminal displayenhancementNew feature or request
Activity
MakenRosa commentedon Jun 17, 2026
I reviewed the linked branch/diff against current
main. The approach is technically small and targets the right layer, but I would separate "stream status" semantics from "stream error" before merging.What the branch currently does:
ResponseEvent::StreamStatus { message, details }incodex-api.codex.keepalivewithstatus = "waiting_for_account_capacity"incodex-rs/codex-api/src/sse/responses.rs.retry_after_seconds,waited_seconds, andreason.EventMsg::StreamError(StreamErrorEvent { ... })incodex-rs/core/src/session/turn.rs.StreamStatusfrom TTFT incodex-rs/core/src/turn_timing.rs.That is a good proof of concept. The main concern is the protocol/UI boundary:
waiting_for_account_capacityis a transient non-content status while the stream is still alive, not an error. ReusingStreamErrormay work with existing TUI surfaces, but it risks error-colored UI, error telemetry semantics, and future confusion for clients that interpretStreamErroras a degraded/failed stream.A cleaner shape would be:
ResponseEvent::StreamStatusincodex-api.EventMsg::StreamStatus(StreamStatusEvent { message, details })or a more genericTurnStatusUpdate.StreamErrorfor actual stream failures/retry-exhaustion.The branch is also SSE-only. If websocket streaming can receive the same
codex.keepalive/ capacity status, the websocket event mapping should get parity or the UX will differ by transport.Test gap I would add: a TUI/client-level assertion that receiving the status event during an active turn does not add a permanent error history cell and does not mark the turn failed. Current TUI tests already assert replayed
StreamErrordoes not add a history cell, but that is still relying on an error-shaped event for a non-error state.Overall: this is worth doing, and the branch identifies the right event source. I would just avoid encoding a live wait/status as
StreamErrorin the public protocol.