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.
7 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.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:
But for ordinary prompts, the terminal outcome collapses into:
network error after ~240s
A more useful runtime contract would separate these terminal states:
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:
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.
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.