codex crash
Asked to change the code in a hello world file. everytime it crashes.
node:events:495
throw er; // Unhandled 'error' event
^
Error: spawn rg ENOENT
at ChildProcess._handle.onexit (node:internal/child_process:284:19)
at onErrorNT (node:internal/child_process:477:16)
at process.processTicksAndRejections (node:internal/process/task_queues:82:21)
Emitted 'error' event on ChildProcess instance at:
at ChildProcess._handle.onexit (node:internal/child_process:290:12)
at onErrorNT (node:internal/child_process:477:16)
at process.processTicksAndRejections (node:internal/process/task_queues:82:21) {
errno: -2,
code: 'ENOENT',
syscall: 'spawn rg',
path: 'rg',
spawnargs: [ '--json-path', '.text', '--json-seq' ]
}
Node.js v18.19.0
13 Comments
I'm getting this as well - but on Node.js v23.9.0 and I have ripgrep installed and in my path on macOS 15.4. I can't seem to get it to anything because it wants to search the code using rg and fails every time.
Same error. On v 23.5.0
same here with rg, which is in path:
I figured out the problem. This issue most likely only happens with
gpt-4o, once I switched too4-mini-2025-04-16, then the problem is resolved!I was using that same model.
@cuacurie i also restarted the terminal after
brew install ripgrepOS: WSL Ubuntu
Node Version: 18.20.6
Tested Models: gpt-4o, o4-mini-2025-04-16
same issues
Confirmed.
brew install ripgrepthen restart terminalRemoved rg as a hard req in https://github.com/openai/codex/pull/50
Seems to just die when tries to run a non-existing command:
easy to replicate:
Fixed for myself in https://github.com/openai/codex/pull/119 - although a global try catch would be nice to stop it from crashing...
Fixed in https://github.com/openai/codex/pull/79 and https://github.com/openai/codex/pull/50