bug: codex mistakenly parses content in prompts as "files to read" and crashes when not finding them

Resolved 💬 4 comments Opened Apr 21, 2025 by mathusiast Closed Apr 23, 2025
💡 Likely answer: A maintainer (BadPirate, contributor) responded on this thread — see the highlighted reply below.

What version of Codex is running?

0.1.2504172351

Which model were you using?

o4-mini

What platform is your computer?

Darwin 24.5.0 arm64 arm

What steps can reproduce the bug?

Provide the following prompt:

<prompt>

We do not trigger the /userinfo call, and Avatar showing Welcome Guest.

Below is a list of all URLs requested in the app:

    https://play.tarab.ai/v/S-rB0pHI9fU
    https://play.tarab.ai/assets/index-CRZkWbO9.js
    https://play.tarab.ai/assets/index-DWTmva-f.css
    https://play.tarab.ai/api/v2/play/song/S-rB0pHI9fU
    https://play.tarab.ai/auth
    https://play.tarab.ai/images/tarab-logo.png
    https://play.tarab.ai/favicon.ico
    https://play.tarab.ai/favicon.png

</prompt>

Codex thinks substring of some of those URLs are files it needs to "read", and fail when not found..

What is the expected behavior?

The session loop cannot crash. Say user did provided an input file, but had a typo, that's it, hours of work is now gone?

So for a start, make sure session look is always running, and errors are captured and handled.

Besides, there should be a format for input, since prompt can contain paths which are not necessarily meant to be "Go read this path"...

What do you see instead?

node:internal/fs/promises:634
  return new FileHandle(await PromisePrototypeThen(
                        ^

Error: ENOENT: no such file or directory, open 'ai/images/tarab-logo.png'
    at async open (node:internal/fs/promises:634:25)
    at async Object.readFile (node:internal/fs/promises:1238:14)
    at async WA (file:///opt/homebrew/lib/node_modules/@openai/codex/dist/cli.js:271:8860)
    at async file:///opt/homebrew/lib/node_modules/@openai/codex/dist/cli.js:271:12843 {
  errno: -2,
  code: 'ENOENT',
  syscall: 'open',
  path: 'ai/images/tarab-logo.png'
}

Node.js v23.11.0

Additional information

_No response_

View original on GitHub ↗

4 Comments

emcd · 1 year ago
BadPirate contributor · 1 year ago

I think this has to do with parsing for images I found you can reproduce by simply saying somenonexistantimage.png and it will crash. However, if you provide a proper local path to an existing image, then it pulls the images into the command prompt.

dllu · 1 year ago

!Image

Same, I was trying to describe a file naming strategy to codex and it crashed immediately.

mathusiast · 1 year ago

Hi,

I was not able to reproduce this with the latest version

$ codex --version
0.1.2504221401