Codex App built-in image_gen times out after ~240s for ordinary card-art prompts while simple prompts succeed
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?
- Open Codex App on macOS.
- Start a new thread.
- 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."
})
- Observe that the image succeeds in approximately 40 seconds.
- 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."
})
- Wait approximately 240 seconds.
- Observe this failure:
image generation failed: network error: error sending request for url (https://chatgpt.com/backend-api/codex/images/generations)
- 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>"
})
- After approximately 240 seconds, observe:
image generation failed: network error: error sending request for url (https://chatgpt.com/backend-api/codex/images/edits)
- 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.
14 Comments
I can reproduce the same failure on the current macOS Codex Desktop build.
Environment
26.623.81905codex-cli 0.142.526.5.2 (25F84)Observed behavior
On July 2, 2026, multiple calls to the built-in
image_gentool entered the generating state, waited approximately 4–5 minutes, and then failed with:This reproduced:
The tool is present and accepts the request; the failure occurs only after the long wait.
Control evidence
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.
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
26.623.8190526.623.101652codex-cli 0.142.526.5.2 (25F84)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:
The request remained in the generating state for approximately four minutes, then failed with the same error:
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:
The update restored basic generation but did not resolve complex-request timeout handling.
Requested improvement
Please consider:
network error;Affected Codex thread:
019f2147-4911-7dd2-af11-b696469e1e2f.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
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
26.715.21425 (5488)0.145.0-alpha.180.144.515.7.7 (24G720)x86_64imagegenonly; no API-key fallback and no third-party portrait skillMost useful A/B test: same Mac, account, app build, and phone hotspot
Adult portrait failed twice
Codex session:
019f6dd9-37ef-7d21-affd-71c06a6e3264The 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:Both terminal events were:
No-person landscape succeeded
Codex session:
019f6dda-675a-7900-ba10-b0ef91601a14Prompt: “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 duration86046 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.envproxy 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).019f64b4-b8d5-7aa2-8dc4-18721933877dand019f64b5-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:
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:
network error;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.
Additional Windows CLI reproduction with precise timing data.
Environment
0.144.5gpt-5.6-solControl test: simple prompt succeeds
The built-in
image_gentool successfully generated a square image containing one centered blue circle on a white background.2026-07-17T04:01:31.505Z2026-07-17T04:02:22.264ZComplex prompt: repeatable timeout-like failure
A policy-safe, detailed technology-brand image prompt asked for the exact letters
SXFintegrated into a semiconductor chip, with cinematic 3D materials, circuit traces, communication elements, lighting, composition, and negative constraints.Attempt 1:
success=falseAttempt 2 used a shortened/simplified version of the same concept:
success=falseBoth attempts ended with exactly:
The HTTP client log shows the POST session closing after approximately
306sidle time, with no useful HTTP status or structured backend error exposed.Networking observations
/backend-api/codex/modelsreturns200 OK.Expected behavior
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.
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
26.715.3651.00.145.0-alpha.18image_gen; no API key involvedControl and reproduction
``
``image generation failed: network error: error sending request for url (https://chatgpt.com/backend-api/codex/images/edits)
Network isolation
The failure was reproduced through both:
NO_PROXYcoveringchatgpt.com,openai.com,oaiusercontent.com,oaistatic.com,oaistatsig.com, andchallenges.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.
Try this and it works for me.
https://github.com/eagleagentic/codex-imagegen-143
Fresh Windows reproduction on 2026-07-26.
Environment:
Sequential control test:
image generation failed: network error: error sending request for url
(https://chatgpt.com/backend-api/codex/images/generations)
This has reproduced repeatedly:
This closely matches the issue description and shows the problem is still present in Codex Desktop 26.721.4979.0 on Windows.
Fresh Windows reproduction with a tight ~304–306s edits boundary (2026-07-29)
I reproduced the same built-in ImageGen failure pattern on the current Windows Codex Desktop build and collected precise A/B timing.
Environment
26.721.4979.00.146.0-alpha.3.1gpt-5.6-solimage_gen; no API key and no standalone CLI used for image generationA/B results
1254×1254PNG.All four failures surfaced the same generic terminal error:
No HTTP status, structured terminal cause, image request ID, or recoverable job ID was exposed.
The reference was a readable
946×945JPEG of approximately648 KiB. Because the same built-in route successfully generated an image from that reference once, an unreadable file or invalid path cannot be the sole cause. The four failures clustering inside a 2.8-second band around five minutes strongly suggests a fixed request-lifecycle or terminal-result boundary rather than random local connectivity loss.This is consistent with the other Windows/macOS reports here: simple or faster jobs can complete, while slower generations/edits reach a repeatable long-request boundary and collapse to
network error.Requested diagnostics / behavior
network error.Fresh macOS reproduction on 2026-08-01 (current desktop build)
I can confirm that this is still reproducible on a newer macOS build.
Environment
codex-cli 0.146.0-alpha.9.2image_genReproduction
image_generation_endwithstatus: failedand an empty result.No image was returned, and no retry was made.
This follows additional failures observed on 2026-07-31 on the same machine:
/backend-api/codex/images/edits: generic network error after roughly five minutes;/backend-api/codex/images/generations: one generic network error and one HTTP 503 / upstream connection termination after roughly five minutes.A trivial 10×10 white-image control succeeded earlier in the broader testing sequence, so the capability is at least intermittently reachable.
The near-five-minute boundary on the current macOS build matches the 303–306-second Windows evidence above and further supports a fixed Codex request/result-lifecycle timeout rather than prompt validation.
Codex session for correlation:
019fb749-9512-76e2-a622-7b9297d47051Built-in image generation times out for moderately complex prompts while simple prompts succeed
The Codex desktop app's built-in image generation tool accepts image requests and begins processing them, but moderately complex illustration prompts eventually fail with a network error after approximately 4–5 minutes.
Very simple prompts complete successfully, which indicates that the image generation tool is enabled, authentication is working, and requests are reaching the backend. The failure appears to depend on generation complexity or processing time.
This behavior closely resembles the issue reported in #29645, but I am providing an additional controlled reproduction with successful and failed prompts from the same Codex session.
Environment
ChatGPT.app26.727.51351codex-cli 0.146.0-alpha.9.225G72arm64)image_gentoolSteps to reproduce
Test 1: Simple object — succeeds
Start a new image generation request in Codex using the following prompt:
Result
The request completes successfully in approximately 17 seconds and produces a valid 1536 × 1536 PNG image.
---
Test 2: Moderately complex single-panel illustration — fails
In the same Codex session, submit the following prompt:
Result
The request is accepted and continues processing for approximately 4–5 minutes. It then fails with:
No generated image is returned.
---
Test 3: Highly simplified comic — succeeds, but slowly
Submit the following reduced-complexity prompt:
Result
The request completes successfully after approximately 2–3 minutes and produces a valid 1536 × 1024 PNG image.
Expected behavior
The built-in image generation tool should either:
A generation that is still processing should not eventually surface as a generic client-side network error.
Actual behavior
The request is not rejected immediately, so this does not appear to be a prompt validation, authentication, or tool availability problem.
Reproducibility
The failure was reproduced multiple times with:
The common behavior is:
/backend-api/codex/images/generations.At the same time, very simple prompts continue to succeed.
Diagnostics performed
I verified the following:
image_generationfeature is enabled in the Codex desktop logs.image_gentool.Suspected cause
Based on the controlled tests, this appears to be an upstream timeout, queueing, or connection-lifetime issue in the Codex image generation backend.
The request seems to continue processing until it reaches a fixed timeout boundary. More expensive generations are more likely to cross that boundary and fail, while lightweight generations finish before it.
The generic
network errormay therefore be masking a backend generation timeout or an upstream connection being closed before the image is returned.Impact
This makes the built-in image generator unreliable for normal creative work involving:
The current workaround is to simplify the prompt aggressively and generate one very simple element or panel at a time. This significantly limits the usefulness of the built-in image generation feature.
Suggested improvements
It would be helpful to:
Additional information
The successfully generated simple image and simplified comic confirm that the native tool itself is available and functional. The failure boundary appears to be related to generation duration or backend workload rather than installation or configuration.
I can provide the relevant sanitized Codex desktop log excerpts if needed.
Additional controlled test: reasoning level
I repeated the exact same moderately complex prompt after changing the Codex reasoning level from
mediumtomax.The result did not change:
/backend-api/codex/images/generations.This suggests that the failure is independent of the Codex reasoning setting and occurs after the native image-generation tool has already been invoked.
Timeout configuration investigation
I inspected the current
openai/codeximplementation.The built-in image-generation extension performs a synchronous HTTP POST through
ImagesClient. The generated request hastimeout: None, and the default HTTP client does not set a whole-request timeout.Therefore, the approximately 240-second failure does not appear to be caused by a configurable local Codex request timeout.
The documented
stream_idle_timeout_msoption applies to streaming Responses API connections and is not used by the unaryimages/generationsrequest path.This suggests that the connection is being closed by the Codex image backend or an upstream gateway. Increasing a local waiting period would not solve the issue because the client receives a terminal network error and is not given a generation ID that could be polled afterward.
A robust fix may require an asynchronous generation job:
I can reproduce this on a newer Codex Desktop build.
Environment
image_gen; no API key usedReproduction
image_gentool for an identity-preserving pixel-pet sprite edit.referenced_image_paths(768×1134, 696 KB).Actual result
I reproduced this repeatedly after:
No edited image was returned. Ordinary image generation still works on the same account and network, which matches the differential behavior reported here. Basic connectivity to
chatgpt.comis healthy, so this appears specific to the long-running authenticated Codex image-edit request rather than a general local network outage.This confirms the issue is still reproducible on 26.727.51351, newer than the build in the original report.
I have a controlled A/B rollback result on Windows that narrows this down to a Codex Desktop app regression.
A/B result
Because the model, account, network, and bundled core were unchanged, while changing only the Desktop app build toggles the failure on and off, this appears more likely to be a regression in the Desktop app's image-tool bridge / long-running request handling than a general connectivity or entitlement problem.
Please compare the image request transport, proxy handling, connection lifetime, and response handoff between builds 26.721.81911 and 26.727.51351.
I can confirm that this remains reproducible on a newer Windows Codex Desktop build and is severely disrupting production image work.
Environment
26.727.6591.026200, x64image_gentool; no API fallback usedLatest production reproduction
A normal policy-safe 9:16 educational cover edit used four valid local reference images for subject identity and visual style. The request was accepted by the built-in tool, then failed at the authenticated Codex image edit endpoint:
The latest failed call ran for approximately 47.5 seconds before returning the terminal network error. Earlier attempts on the same machine have also remained active for approximately 4–5 minutes before returning the same error.
The failure persists after:
/images/generationsand/images/edits.Controlled evidence on the same build
On the same Codex build, account, machine, and active network/proxy configuration:
/backend-api/codex/images/edits.This mixed success/failure pattern makes a static authentication, entitlement, local file-read, or VPN configuration problem unlikely. It matches the issue described here: lightweight control requests may succeed, while normal production requests fail unpredictably at the Codex-specific image endpoints.
Impact
This is not an occasional cosmetic failure. It repeatedly blocks paid production work because no partial image, generation ID, structured backend error, or actionable retry interval is returned. Users spend minutes waiting and then must restart the entire generation.
Please prioritize:
Sanitized affected Codex thread ID available for investigation:
019fc577-690a-7d82-abc5-216af8c79bd7.