Codex App built-in image_gen times out after ~240s for ordinary card-art prompts while simple prompts succeed

Open 💬 7 comments Opened Jun 23, 2026 by dondong

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

OpenAI Codex 26.616.71553 (4265)

What subscription do you have?

ChatGPT Plus

What platform is your computer?

Darwin 25.5.0 arm64 arm macOS 26.5.1 Build 25F80 Apple Silicon

What issue are you seeing?

The Codex App built-in image_gen tool works for a very simple image prompt, but consistently times out for ordinary, policy-safe card-art illustration prompts.

A minimal prompt generated successfully in approximately 40 seconds:

"A single matte red wooden cube centered on a plain light gray background, soft studio lighting, no text, no logo."

However, an ordinary illustration prompt consistently ran for approximately 240 seconds and then failed:

"Square cel-shaded anime illustration: one young fantasy scout stepping across a shallow creek in dark storm ruins, centered full body, navy and brown clothing, cyan highlights, generous margins, no text or frame."

The resulting error was:

image generation failed: network error: error sending request for url (https://chatgpt.com/backend-api/codex/images/generations)

Image generation with three valid local PNG reference images also failed after approximately 240 seconds:

image generation failed: network error: error sending request for url (https://chatgpt.com/backend-api/codex/images/edits)

The same behavior occurred with:

  • a detailed structured prompt;
  • a shortened prompt;
  • an extremely short one-sentence prompt;
  • local image references passed through referenced_image_paths;
  • conversation images passed through num_last_images_to_include;
  • a text-only generation request with no image references.

The tool invocation itself appears valid because:

  • the minimal red-cube prompt succeeded with the same image_gen tool;
  • requests passed argument validation and reached the correct generations or edits endpoint;
  • invalid parameters would normally fail immediately rather than after approximately four minutes.

The Codex App has been restarted multiple times. ChatGPT's normal conversational image generation works on the same account and network.

This appears to be a Codex image-generation backend timeout, queueing, rate-limiting, or error-reporting problem rather than an invalid prompt or invocation.

What steps can reproduce the bug?

  1. Open Codex App on macOS.
  1. Start a new thread.
  1. Invoke the built-in image_gen tool without references:

tools.image_gen__imagegen({
prompt: "A single matte red wooden cube centered on a plain light gray background, soft studio lighting, no text, no logo."
})

  1. Observe that the image succeeds in approximately 40 seconds.
  1. Invoke the same built-in tool with this policy-safe illustration prompt:

tools.image_gen__imagegen({
prompt: "Square cel-shaded anime illustration: one young fantasy scout stepping across a shallow creek in dark storm ruins, centered full body, navy and brown clothing, cyan highlights, generous margins, no text or frame."
})

  1. Wait approximately 240 seconds.
  1. Observe this failure:

image generation failed: network error: error sending request for url (https://chatgpt.com/backend-api/codex/images/generations)

  1. Optionally retry with valid local PNG reference images:

tools.image_gen__imagegen({
referenced_image_paths: [
"<redacted-path>/reference-1.png",
"<redacted-path>/reference-2.png",
"<redacted-path>/reference-3.png"
],
prompt: "<ordinary policy-safe card illustration prompt>"
})

  1. After approximately 240 seconds, observe:

image generation failed: network error: error sending request for url (https://chatgpt.com/backend-api/codex/images/edits)

  1. Restarting Codex App and repeating the test does not resolve the issue.

What is the expected behavior?

The built-in image_gen tool should successfully generate ordinary policy-safe illustrations, including requests with valid local reference images.

If the backend rejects, rate-limits, queues, or times out a request, Codex should fail promptly and expose a specific structured error instead of waiting approximately four minutes and returning a generic network error.

Simple and more detailed prompts should use the same reliable generation path.

Additional information

Authentication:

  • Signed into Codex through ChatGPT.
  • No OPENAI_API_KEY is configured.
  • The built-in image_gen workflow is documented as not requiring an API key.

Control test:

  • Simple red-cube generation succeeded.
  • Ordinary illustration prompts repeatedly failed.
  • Therefore, the image_gen tool is present, callable, and at least partially authenticated.

Reference-image validation:

  • All three reference files were readable PNG images.
  • Two were square.
  • One was a wide landscape image.
  • The same failure occurred without any reference images, ruling out local file paths as the sole cause.

At least six image-generation attempts failed across the generations and edits endpoints.

ChatGPT conversational image generation works normally on the same account and network.

Possibly related but not identical:
https://github.com/openai/codex/issues/23015

That report concerns Codex CLI reconnecting for a much longer period after an image-generation rejection. This report concerns Codex App requests failing after approximately 240 seconds with a generic backend network error.

View original on GitHub ↗

7 Comments

jxb127039-hash · 18 days ago

I can reproduce the same failure on the current macOS Codex Desktop build.

Environment

  • Codex App: 26.623.81905
  • Bundled CLI: codex-cli 0.142.5
  • Subscription: ChatGPT Plus
  • macOS: 26.5.2 (25F84)
  • Architecture: Apple Silicon / arm64
  • Authentication: signed into Codex with ChatGPT; built-in image generation path, no API key

Observed behavior

On July 2, 2026, multiple calls to the built-in image_gen tool entered the generating state, waited approximately 4–5 minutes, and then failed with:

image generation failed: network error: error sending request for url (https://chatgpt.com/backend-api/codex/images/generations)

This reproduced:

  • in multiple fresh Codex threads;
  • with both a detailed Chinese infographic prompt and a shorter retry prompt;
  • after restarting Codex;
  • across multiple network/VPN exit regions.

The tool is present and accepts the request; the failure occurs only after the long wait.

Control evidence

  • ChatGPT conversational image generation succeeds with the same ChatGPT account and network.
  • Codex built-in image generation previously succeeded on this machine through June 30, 2026.
  • Codex Desktop updated on July 1, 2026; the repeated failures started after the update.
  • The error is isolated to the Codex image endpoint rather than general ChatGPT access or account image entitlement.
  • A direct endpoint probe from the affected environment received a Cloudflare challenge response (HTTP 403, cf-mitigated: challenge), although the authenticated Codex tool surfaces only the generic network error.

Expected behavior

Codex should either complete image generation or surface the actual structured backend/Cloudflare/rate-limit error promptly instead of waiting 4–5 minutes and reporting a generic network failure.

Related local Codex thread ID available for investigation: 019f2147-4911-7dd2-af11-b696469e1e2f.

This looks identical or very close to the timeout reported here, with the additional signal that ChatGPT image generation continues to work normally on the same account and network.

jxb127039-hash · 18 days ago

Follow-up after updating Codex Desktop on July 3, 2026: the issue is only partially improved and remains reproducible for complex image requests.

Updated environment

  • Previous Codex App build: 26.623.81905
  • Current Codex App build: 26.623.101652
  • Bundled CLI remains: codex-cli 0.142.5
  • macOS: 26.5.2 (25F84)
  • Apple Silicon / arm64
  • ChatGPT Plus authentication

A/B result after the app update

Simple control prompt succeeded

A minimal prompt requesting one matte red wooden cube on a light gray background completed successfully in approximately 16 seconds.

Complex prompt still timed out

A policy-safe Chinese educational infographic prompt requested:

  • vertical 4:5 layout;
  • six connected causal steps;
  • large Chinese headings and labels;
  • simple cartoon icons;
  • two summary sections.

The request remained in the generating state for approximately four minutes, then failed with the same error:

image generation failed: network error: error sending request for url (https://chatgpt.com/backend-api/codex/images/generations)

Compressed fallback succeeded

Immediately afterward, the content was reduced from six detailed steps plus two summary sections to four short steps and one summary section. That simplified request succeeded in approximately one minute.

Comparison with ChatGPT Images

ChatGPT Images successfully generated a substantially denser version from the same source material and account/network: eight causal steps, multiple analysis sections, policy recommendations, illustrations, and Chinese text.

This makes an account entitlement or general image-model outage unlikely. The observed boundary is now:

  • simple / compressed prompt: succeeds;
  • detailed structured infographic prompt: consistently reaches the ~240-second boundary and fails with a generic network error.

The update restored basic generation but did not resolve complex-request timeout handling.

Requested improvement

Please consider:

  1. allowing long-running image jobs to continue asynchronously beyond the current timeout;
  2. polling a server-side generation job instead of holding one request open;
  3. returning the actual backend status (queue timeout, moderation, rate limit, gateway timeout, etc.) instead of mapping everything to network error;
  4. exposing a lower-quality/draft option in the built-in tool so complex layouts can complete reliably.

Affected Codex thread: 019f2147-4911-7dd2-af11-b696469e1e2f.

Tuttotorna · 13 days ago

This looks like a terminal-outcome classification issue around the built-in image_gen tool, not only a generic connectivity failure.

The important split is:

tool invocation accepted

generation terminal outcome observed

In the report, the invocation appears to pass the early support checks:

  • tool is present
  • account is authenticated
  • simple prompt succeeds
  • arguments pass validation
  • request reaches the generation/edit endpoint

But for ordinary prompts, the terminal outcome collapses into:

network error after ~240s

A more useful runtime contract would separate these terminal states:

  • backend_rejected
  • policy_rejected
  • rate_limited
  • queued_timeout
  • transport_timeout
  • generation_timeout
  • backend_unavailable
  • unknown_terminal_failure

Minimal invariant:

once image_gen dispatch is accepted, Codex should return exactly one structured terminal outcome, not a generic network error after a fixed wait window.

A useful regression matrix:

  1. simple prompt succeeds => terminal outcome = succeeded
  2. invalid args => fail before dispatch with argument_validation_error
  3. backend rejects prompt => backend_rejected / policy_rejected
  4. backend queues too long => queued_timeout
  5. transport fails before response => transport_timeout
  6. generation endpoint times out after accepted dispatch => generation_timeout
  7. edit request with valid local PNG references reaches endpoint but fails => structured terminal failure, not generic network error

That keeps the boundary explicit:

a callable tool and accepted dispatch are not enough;
the runtime also needs a supported terminal outcome for the generation transition.

longer96 · 5 days ago

network error: error sending request for url (https://chatgpt.com/backend-api/codex/images/edits)

I also encountered this problem. I uploaded 3 reference images, but the images couldn't be generated

babysorry · 4 days ago

Additional cross-network/device A/B evidence (July 16–17, 2026)

I reproduced the same behavior with the current unified ChatGPT/Codex desktop build and collected several useful controls.

Environment

  • Desktop app: 26.715.21425 (5488)
  • Runtime recorded by current Codex tasks: 0.145.0-alpha.18
  • Standalone Codex CLI: 0.144.5
  • macOS: 15.7.7 (24G720)
  • Architecture: Intel x86_64
  • Authentication: signed in with ChatGPT
  • Official built-in imagegen only; no API-key fallback and no third-party portrait skill

Most useful A/B test: same Mac, account, app build, and phone hotspot

Adult portrait failed twice

Codex session: 019f6dd9-37ef-7d21-affd-71c06a6e3264

The prompt requested a clearly adult 25-year-old East Asian woman, a tasteful photorealistic half-length historical portrait, vermilion clothing, soft palace lanterns, no text or watermark. The first built-in call failed after roughly two minutes. A second, simplified English version failed after roughly four minutes. Total task duration was 448737 ms (about 7m29s). Both returned:

image generation failed: network error: error sending request for url (https://chatgpt.com/backend-api/codex/images/generations)

Both terminal events were:

image_generation_end
status: failed
result: ""

No-person landscape succeeded

Codex session: 019f6dda-675a-7900-ba10-b0ef91601a14

Prompt: “Generate a distant view of Mount Fuji, with no people.”

The image-generation event completed in about 64 seconds and the whole task completed in 98022 ms (about 1m38s), returning and saving a PNG.

This makes the phone-hotspot comparison particularly useful: the network, machine, account, app build, and approximate test time were the same, while the ordinary adult portrait repeatedly failed and the no-person landscape completed normally.

Other controls

  • 019f6b2a-e96c-79b3-a80f-d8cde6300193: a wireless-earbud product image completed in about 74 seconds; total task duration 86046 ms.
  • 019f64a2-e0dd-7530-bc89-9a1a722c26d6: the same policy-safe adult-woman-on-a-train prompt first timed out twice in one turn (about 21 minutes total), then succeeded when submitted unchanged without prompt expansion/translation; the successful generation took about 78 seconds and the turn about 91 seconds.
  • 019f6dc7-3416-7002-8bfc-ba853c29617d: after disabling project .env proxy variables, a Chinese structured version and a simplified English version of the adult portrait both failed after roughly five minutes each with the same generations-endpoint network error. Total task duration: 674061 ms (about 11m14s).
  • Two other short adult portrait prompts (019f64b4-b8d5-7aa2-8dc4-18721933877d and 019f64b5-2d40-76e1-be7d-7174740bc709) succeeded on July 15 in roughly 58–65 seconds of generation time. This shows that adult-person content is not categorically rejected and the failure is intermittent.

Network and device matrix

The same long waits or failures were observed across:

  • company network;
  • home network;
  • phone hotspot;
  • Clash Verge Global mode;
  • Clash Verge TUN mode;
  • multiple proxy nodes;
  • a different proxy provider;
  • project proxy environment variables disabled;
  • this macOS machine;
  • another Windows machine.

At home, one person-image request eventually succeeded after approximately six minutes, while another failed. The Windows machine showed the same general intermittent/slow behavior. Corporate routing or proxy quality may influence reliability, but it cannot explain all results.

ChatGPT Chat vs. Codex task control

The updated desktop app now displays ordinary ChatGPT cloud chats and local Codex tasks in one sidebar, but they remain distinguishable: ChatGPT chats only expose chat actions, while Codex tasks expose a working directory, Codex session ID, deep link, and task continuation actions.

Using the same desktop app, account, and network, ordinary ChatGPT Chat successfully generated the same kind of adult portrait while a Codex task continued to fail. The successful Chat conversation did not create a corresponding local entry under ~/.codex/sessions.

This does not prove the exact server endpoint used by Chat, but it is a strong control showing that account image entitlement, the prompt category, and general access to ChatGPT image generation are working. The failure is more narrowly associated with the Codex built-in ImageGen dispatch/queue/timeout/result-return path.

About the session IDs

The representative Codex session IDs above are included only in case they can be correlated with internal telemetry. They are Codex session IDs, not image-backend request/job IDs. Local transcripts remain under ~/.codex/sessions, and the current ImageGen error does not expose a backend generation request ID.

If the session ID alone is not sufficient for internal correlation, exposing a generation job/request ID in future errors would make reports like this much more actionable.

Interpretation

The combined evidence is more consistent with intermittent Codex-specific queueing, timeout, or terminal-event handling than with an invalid prompt, adult-person policy rejection, missing account entitlement, or one broken proxy node. Possible failure modes include:

  1. a server-side generation job outliving the client request timeout;
  2. different prompt classes being assigned to different queues or processing paths;
  3. a real queue/rate-limit/gateway/moderation result being collapsed into generic network error;
  4. the image completing server-side but the Codex client failing to receive or recover the terminal result.

It would help if Codex could return a traceable image job/request ID, poll an asynchronous job rather than hold a single long request, distinguish queue/generation/transport/gateway/rate-limit errors, and resume result retrieval after a reconnect.

HeyStarXF · 3 days ago

Additional Windows CLI reproduction with precise timing data.

Environment

  • Codex CLI/TUI: 0.144.5
  • Platform: Windows, PowerShell / Windows Terminal
  • Model: gpt-5.6-sol
  • Authentication: ChatGPT sign-in; no API key used for the built-in tool
  • Ordinary text conversations and Responses WebSocket requests work normally

Control test: simple prompt succeeds

The built-in image_gen tool successfully generated a square image containing one centered blue circle on a white background.

  • Tool invocation started: 2026-07-17T04:01:31.505Z
  • Generation completed around: 2026-07-17T04:02:22.264Z
  • Approximate duration: 50.8 seconds

Complex prompt: repeatable timeout-like failure

A policy-safe, detailed technology-brand image prompt asked for the exact letters SXF integrated into a semiconductor chip, with cinematic 3D materials, circuit traces, communication elements, lighting, composition, and negative constraints.

Attempt 1:

  • Tool duration: 306,417 ms
  • Result: success=false

Attempt 2 used a shortened/simplified version of the same concept:

  • Tool duration: 306,213 ms
  • Result: success=false

Both attempts ended with exactly:

image generation failed: network error: error sending request for url
https://chatgpt.com/backend-api/codex/images/generations

The HTTP client log shows the POST session closing after approximately 306s idle time, with no useful HTTP status or structured backend error exposed.

Networking observations

  • Codex successfully reaches authenticated Codex endpoints; /backend-api/codex/models returns 200 OK.
  • Text conversations remain usable in the same session.
  • Different proxy exit nodes were tested.
  • The behavior correlates much more strongly with generation complexity/duration than with general connectivity: a simple image succeeds, while detailed prompts repeatedly terminate near the same ~306-second boundary.

Expected behavior

  1. Detailed but supported image-generation requests should be allowed enough time to finish, or use an asynchronous/polling delivery path that is not constrained by a single long-held request.
  2. If the backend queues, rejects, times out, or loses the generated result, Codex should return a structured error distinguishing service timeout, gateway timeout, moderation, overload, and client transport failure.
  3. Ideally expose a safe request/correlation ID so maintainers can determine whether the render completed server-side before delivery failed.

This Windows CLI reproduction appears to be the same underlying issue as the macOS App report, but with a very consistent ~306-second failure boundary. Full logs are available and can be shared after redacting account identifiers.

FELAX77 · 2 days ago

Additional Windows reproduction: simple generation succeeds, reference-image edits fail after network-path isolation

I can reproduce the same failure pattern on Windows with a current Codex Desktop build.

Environment

  • Codex Desktop: 26.715.3651.0
  • Bundled runtime / codex-cli: 0.145.0-alpha.18
  • Windows x64
  • Signed in through ChatGPT; built-in image_gen; no API key involved

Control and reproduction

  1. A minimal text-to-image request succeeded in approximately 18 seconds and returned a valid PNG.
  2. In the same app/account session, an edit using one readable local landscape PNG remained pending for roughly 148–180 seconds and then failed with:

``
image generation failed: network error: error sending request for url (https://chatgpt.com/backend-api/codex/images/edits)
``

  1. I re-encoded and downscaled the reference to a 960×540 JPEG (about 86 KB), copied it into the writable workspace, and retried. The same endpoint failed in the same way.
  2. The reference was independently readable through Codex's image-viewing path, so this was not simply an unreadable file.

Network isolation
The failure was reproduced through both:

  • an explicit local HTTP/HTTPS proxy; and
  • a TUN/direct route with NO_PROXY covering chatgpt.com, openai.com, oaiusercontent.com, oaistatic.com, oaistatsig.com, and challenges.cloudflare.com.

Direct endpoint reachability was available, and the minimal generation control still succeeded. ChatGPT web reference-image generation also works on the same account and network.

Sandbox check
The current Windows sandbox log reported successful setup with errors=[] during these reproductions. Older ACL setup failures seen on a previous build no longer reproduced, so changing the sandbox mode is not supported by this current run as the explanation or workaround.

Expected
A reference-image edit should return the generated image, or fail promptly with a specific terminal/backend status. Waiting several minutes and surfacing a generic network error makes a backend/terminal-result lifecycle failure indistinguishable from actual connectivity loss.

This Windows reproduction suggests the issue is not limited to macOS, reference file size/path, DNS/TCP reachability, or one proxy mode.