codex - 💡(How to fix) Fix Interrupted commentary-heavy streams can loop visible retries without substantive progress [2 comments, 3 participants]

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…
GitHub stats
openai/codex#17480Fetched 2026-04-12 13:27:57
View on GitHub
Comments
2
Participants
3
Timeline
7
Reactions
0
Author
Timeline (top)
labeled ×3commented ×2cross-referenced ×1unlabeled ×1

Error Message

The affected core area is the turn/retry loop in codex-rs/core/src/codex.rs, plus retry outcome classification in protocol/runtime error handling.

Root Cause

From the outside, the session looks active because you may still see commentary, reconnect text, or partial reasoning narration. But the turn is not actually converging on a completed response, and the retry loop is not classifying that lack of substantive progress honestly.

RAW_BUFFERClick to expand / collapse

What version of Codex is running?

Observed in current Responses/WebSocket-era builds; the exact version is less important than the retry behavior in the core turn loop.

What subscription do you have?

No response

Which model were you using?

No response

What platform is your computer?

Platform-independent.

What terminal emulator and version are you using (if applicable)?

No response

What issue are you seeing?

Interrupted streams can produce visible commentary or retry narration, but still fail to make substantive progress toward a completed turn.

The problem is that visible output appears to count as progress strongly enough that the retry loop can keep going even when the user is not getting a real completion.

From the outside, the session looks active because you may still see commentary, reconnect text, or partial reasoning narration. But the turn is not actually converging on a completed response, and the retry loop is not classifying that lack of substantive progress honestly.

What steps can reproduce the bug?

A generic reproduction shape is:

  1. Start a turn that produces a commentary-heavy or long-running stream.
  2. Interrupt the stream partway through, or hit a transient disconnect before a real completed response arrives.
  3. Let Codex retry.
  4. Observe that later attempts may still emit visible commentary or retry narration.
  5. Despite that visible output, no real completed answer arrives, and the turn can remain in a misleading retry loop.

What is the expected behavior?

Visible-only commentary should not indefinitely reset the no-progress logic.

If repeated attempts keep producing visible narration but no substantive completion, Codex should:

  • preserve enough visible context for the user to understand what happened
  • avoid treating commentary-only retries as meaningful forward progress
  • terminate or classify the failure honestly after bounded retries

Additional information

This looks separate from pure websocket reconnect detection.

Related issues such as #17199, #17003, and #17201 describe reconnect loops or dead-connection symptoms. This report is narrower: the bug is in how the retry loop classifies progress once visible output exists but completion still never arrives.

A local fork validated a narrow runtime slice for this behavior using:

  • cargo test -p codex-core stream_no_completed -- --nocapture

The affected core area is the turn/retry loop in codex-rs/core/src/codex.rs, plus retry outcome classification in protocol/runtime error handling.

extent analysis

TL;DR

Modify the retry loop in codex-rs/core/src/codex.rs to distinguish between substantive progress and visible commentary or retry narration.

Guidance

  • Review the codex-rs/core/src/codex.rs file to understand how the retry loop classifies progress and how it handles visible output.
  • Consider introducing a separate metric to track substantive progress, such as the arrival of a completed response, and use this metric to determine when to terminate the retry loop.
  • Update the retry outcome classification in protocol/runtime error handling to avoid treating commentary-only retries as meaningful forward progress.
  • Test the modified retry loop using a local fork and the cargo test -p codex-core stream_no_completed -- --nocapture command to validate the changes.

Example

No code snippet is provided as the issue does not contain sufficient information to generate a specific example.

Notes

The solution may require careful consideration of the trade-offs between preserving visible context for the user and avoiding misleading retry loops. The fix may also need to account for various edge cases, such as transient disconnects and commentary-heavy streams.

Recommendation

Apply a workaround by modifying the retry loop to distinguish between substantive progress and visible commentary or retry narration, as this approach directly addresses the root cause of the issue and can be tested and validated using a local fork.

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING