When using --image with exec codex hangs

Resolved 💬 4 comments Opened Aug 27, 2025 by SawyerHood Closed Jan 24, 2026
💡 Likely answer: A maintainer (oyiakoumis, contributor) responded on this thread — see the highlighted reply below.

What version of Codex is running?

0.25.0

Which model were you using?

gpt-5-med

What platform is your computer?

Darwin 24.6.0 arm64 arm

What steps can reproduce the bug?

Running:

codex exec "Tell me what you see" --image "/Users/sawyerhood/Downloads/shapes\ at\ 25-08-19\ 17.28.40.png"

Hangs the codex cli (it never exits or responds even left for 10 minutes)

This happens with any image I pass it.

What is the expected behavior?

I expect Codex to respond.

What do you see instead?

➜  terragon git:(main) codex exec "Tell me what you see" --image "/Users/sawyerhood/Downloads/shapes\ at\ 25-08-19\ 17.28.40.png"
[2025-08-27T20:34:46] OpenAI Codex v0.25.0 (research preview)
--------
workdir: /Users/sawyerhood/terragon
model: gpt-5
provider: openai
approval: never
sandbox: read-only
reasoning effort: medium
reasoning summaries: auto
--------
[2025-08-27T20:34:46] User instructions:
Tell me what you see

This and it never responds

Additional information

_No response_

View original on GitHub ↗

4 Comments

oyiakoumis contributor · 12 months ago

I raised a PR with a proposed fix: https://github.com/openai/codex/pull/2843

I also discovered another bug with images and codex exec: when the image path was placed directly into the prompt, it was treated as plain text, so the model could only access its metadata rather than opening it.

With the fix, both of the following now work as expected:

  • codex exec --image ./photo.jpg "describe this"
  • codex exec "what do you see in ./photo.jpg?"
andresssantos · 11 months ago

Any update? This issue is really critical

oyiakoumis contributor · 11 months ago

@bolinfest or @aibrahim-oai

There’s a pending PR that fixes this and closes the issue: https://github.com/openai/codex/pull/2843. Let me know if you’d like any changes.

TL;DR:
With the fix, both of the following now work as expected (previously: the first hung indefinitely, and the second failed to find the image):

codex exec --image ./photo.jpg "describe this"
codex exec "what do you see in ./photo.jpg?"
montagao · 11 months ago

would be great to get this one merged/fixed