codex - 💡(How to fix) Fix macOS app: stream disconnected before completion after image_generation_call events [2 comments, 2 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#19122Fetched 2026-04-24 06:00:28
View on GitHub
Comments
2
Participants
2
Timeline
6
Reactions
0
Timeline (top)
labeled ×3commented ×2unlabeled ×1

Error Message

stream disconnected before completion: An error occurred while processing your request... 2026-04-23 02:51:39 websocket error type=server_error request_id=7b68ddbe-13be-9caa-a7d5-5a71d25fdd82

  • upstream error pasted into the thread: 173cb339-4dc3-4c8b-8392-11614ebb67a2 The turn should either continue streaming normally or fail with a handled and clear error state, without repeated disconnect retries and unhandled image-generation events.

Code Example

2026-04-23 02:50:31 response.output_item.added item.type=image_generation_call status=in_progress
2026-04-23 02:50:31 failed to parse ResponseItem from output_item.added
2026-04-23 02:50:32 unhandled responses event: response.image_generation_call.in_progress
2026-04-23 02:50:38 unhandled responses event: response.image_generation_call.generating
2026-04-23 02:51:39 websocket error type=server_error request_id=7b68ddbe-13be-9caa-a7d5-5a71d25fdd82
2026-04-23 02:54:55 stream disconnected - retrying sampling request (1/5 in 216ms)
2026-04-23 02:56:05 stream disconnected - retrying sampling request (2/5 in 401ms)
2026-04-23 02:57:10 stream disconnected - retrying sampling request (3/5 in 768ms)
2026-04-23 03:00:17 stream disconnected - retrying sampling request (4/5 in 1.503s)
2026-04-23 03:03:26 stream disconnected - retrying sampling request (5/5 in 2.912s)
RAW_BUFFERClick to expand / collapse

What version of the Codex App are you using (From "About Codex" dialog)?

Observed in local logs as 0.122.0-alpha.13

What subscription do you have?

ChatGPT sign-in

What platform is your computer?

macOS

What issue are you seeing?

Repeated:

stream disconnected before completion: An error occurred while processing your request...

This does not appear to be isolated to a single conversation.

For thread 019db9b2-baa2-7970-92f0-568f1d16d025, the thread itself later retried multiple times and failed around 2026-04-23 02:50-03:03 in America/Los_Angeles.

What steps can reproduce the bug?

In this case the thread was working normally, then the app received websocket events for an image_generation_call, after which the turn retried repeatedly and failed.

Relevant sanitized sequence from local logs:

2026-04-23 02:50:31 response.output_item.added item.type=image_generation_call status=in_progress
2026-04-23 02:50:31 failed to parse ResponseItem from output_item.added
2026-04-23 02:50:32 unhandled responses event: response.image_generation_call.in_progress
2026-04-23 02:50:38 unhandled responses event: response.image_generation_call.generating
2026-04-23 02:51:39 websocket error type=server_error request_id=7b68ddbe-13be-9caa-a7d5-5a71d25fdd82
2026-04-23 02:54:55 stream disconnected - retrying sampling request (1/5 in 216ms)
2026-04-23 02:56:05 stream disconnected - retrying sampling request (2/5 in 401ms)
2026-04-23 02:57:10 stream disconnected - retrying sampling request (3/5 in 768ms)
2026-04-23 03:00:17 stream disconnected - retrying sampling request (4/5 in 1.503s)
2026-04-23 03:03:26 stream disconnected - retrying sampling request (5/5 in 2.912s)

Request IDs involved:

  • upstream error pasted into the thread: 173cb339-4dc3-4c8b-8392-11614ebb67a2
  • later failure in the same thread: 7b68ddbe-13be-9caa-a7d5-5a71d25fdd82

Separate same-day failures from another thread:

  • 68b83d22-a510-414d-a424-41737234752d
  • 22a4bf92-3114-43be-b5bc-20b82a23f87c

What is the expected behavior?

The turn should either continue streaming normally or fail with a handled and clear error state, without repeated disconnect retries and unhandled image-generation events.

Additional information

Possibly related to #19107.

I have also added a follow-up comment with the corrected request ID and the same sanitized excerpt. If helpful, I can provide a larger sanitized excerpt from macOS app logs and ~/.codex/sessions.

extent analysis

TL;DR

The issue may be resolved by handling unhandled image_generation_call events and improving error handling for websocket server errors.

Guidance

  • Investigate the cause of the failed to parse ResponseItem from output_item.added error, which may be related to the image_generation_call event.
  • Handle the unhandled responses event: response.image_generation_call.in_progress and unhandled responses event: response.image_generation_call.generating events to prevent repeated disconnect retries.
  • Review the error handling for websocket server errors, such as the websocket error type=server_error event, to provide a clear error state instead of retrying the request.
  • Check if the issue is related to the one described in #19107 and consider applying any available fixes or workarounds.

Notes

The provided log excerpt suggests that the issue is related to the handling of image_generation_call events and websocket server errors. However, without more information about the Codex App's implementation, it is difficult to provide a more specific solution.

Recommendation

Apply workaround: Handle unhandled image_generation_call events and improve error handling for websocket server errors, as this may resolve the issue and prevent repeated disconnect retries.

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

codex - 💡(How to fix) Fix macOS app: stream disconnected before completion after image_generation_call events [2 comments, 2 participants]