Generated images are not saved to disk and no path is returned (regression in 0.140/0.141, Linux)
What version of Codex CLI is running?
codex-cli 0.141.0 (broken on 0.140.0 and 0.141.0; last working: 0.139.0)
What subscription do you have?
ChatGPT Pro
Which model were you using?
gpt-5.5
What platform is your computer?
Ubuntu 24.04.4 LTS (noble), kernel 6.17.0-35-generic x86_64, Node v24.6.0
What terminal emulator and version are you using (if applicable)?
GNOME Terminal (default Ubuntu terminal)
Codex doctor report
not available
What issue are you seeing?
Built-in image generation no longer writes a file to disk and returns no path, starting with 0.140.0 (also broken on 0.141.0). On 0.139.0 the same prompt generated an image, saved it under ~/.codex/generated_images/, and printed the saved path in the console.
On 0.140.0 and 0.141.0 the agent reports that it generated and saved the image, but:
- no PNG/JPG appears in ~/.codex/generated_images/
- no saved_path/file_path is printed or returned to the agent (path = null)
- the file does not exist anywhere on disk
I verified this repeatedly on both 0.140.0 and 0.141.0 — the file is definitely never created. After downgrading to 0.139.0 it works correctly again (file is saved and the path is printed).
What steps can reproduce the bug?
- Install codex 0.140.0 or 0.141.0 on Ubuntu 24.04.
- Ask it to generate an image, e.g. "generate a red square and save it".
- The agent claims the image was generated and saved.
- Check ~/.codex/generated_images/ → empty. No path printed. No file on disk.
Downgrading to 0.139.0 makes the same steps work as expected.
What is the expected behavior?
image_gen should write the file to disk (e.g. under ~/.codex/generated_images/) and return/print a usable saved path, as it did in 0.139.0.
Additional information
Regression range:
- Working: 0.139.0
- Broken: 0.140.0, 0.141.0 (verified on both)
3 Comments
Potential duplicates detected. Please review them and close your issue if it is a duplicate.
Powered by Codex Action
I encountered this problem too on v0.141.0 on linux in the terminal. Codex could not find the images anywhere and concluded that they did not exist. After I prompted it to do a test generation and then look for a way to save it on the same turn, it was able to figure out that image_gen stores the PNG payload in the Codex session JSONL as base64. It is obviously unintended for the agent to be mystified as to the location of the generated images though.
Confirming this is still the case in 0.144.1 (see #32153 for the current regression). The good news: the JSONL copy is complete and losslessly recoverable — I published a small read-only Skill/script that extracts the newest
image_generation_call.result, validates it, and writes it to~/.codex/generated_images: https://github.com/jianxunzhang1101/recover-codex-imagesWorks for past sessions too via
--session /path/to/rollout-*.jsonl.