Built-in image_gen generates an inline image, but does not return or expose a usable saved file path.
Open 💬 4 comments Opened Jun 18, 2026 by CandlelightOVO
💡 Likely answer: A maintainer (github-actions[bot], contributor)
responded on this thread — see the highlighted reply below.
Issue: Built-in image_gen generates an inline image, but does not return or expose a usable saved file path.
Environment:
Windows
Codex CLI: codex-cli 0.130.0-alpha.5
Date: 2026-06-18
Steps:
- Use the built-in image_gen tool in a Codex desktop thread.
- Generate a simple image with no input-image dependencies.
- The image appears inline in the conversation.
- Check C:\Users\79447\.codex\generated_images and common cache/temp directories.
Actual:
The image is visible inline, but no new PNG/JPG appears in .codex\generated_images.
The tool response exposes no saved_path/file_path/artifact_path.
From the agent side this is effectively path = null.
Expected:
image_gen should return a usable saved_path, or save consistently to .codex\generated_images, or expose an artifact handle that Codex can copy into the workspace.
Impact:
Generated images cannot be copied into the project, versioned, post-processed, or referenced reliably by path.
4 Comments
Potential duplicates detected. Please review them and close your issue if it is a duplicate.
Powered by Codex Action
I can reproduce this on Windows with the Microsoft Store Codex Desktop app, and I have some additional regression evidence.
Environment:
Observed behavior on 0.140.0-alpha.19:
image_generation_endevent contains base64 PNG data inresult, but nosaved_pathfield.C:\Users\PC\.codex\generated_images\<thread-id>.resultis a valid PNG, so generation itself is not failing; the filesystem persistence / saved_path handoff appears to be failing or skipped.Example failing event shape from a diagnostic thread:
Regression comparison from local session logs:
A known-good
0.140.0-alpha.2image_generation_endevent had this extra field:The default directory exists and is writable. Some files that appeared later under
generated_imageswere manually extracted from session JSONL by scripts, not automatically saved by the built-in image generation path. The reliable discriminator is whetherimage_generation_endcontainssaved_path; on 0.140.0-alpha.19 it does not.Expected:
CODEX_HOME/generated_images/<thread-id>/ig_<image_id>.pngand includesaved_pathonimage_generation_end, or expose a stable artifact/file handle so Codex can copy the generated image into a workspace without scraping base64 from rollout logs.it exists on 0.141 too, any workaround?
Same signature reproduced on macOS 0.144.1 / Desktop 26.707.x — complete, CRC-valid PNG in the JSONL,
status: "generating", nosaved_path. Now tracked in #32153 after the extension pipeline switch.Workaround that automates exactly what you did manually (strict decode → validate → atomic save → display), and defers to the official
saved_pathonce fixed: https://github.com/jianxunzhang1101/recover-codex-images