Skip to content

codex crash #21

Closed
Closed

Description

@cuacurie

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

Activity

  1. changed the title [-]codex chrash[/-] [+]codex crash[/+] on Apr 16, 2025
  2. rgregg commented on Apr 16, 2025

    @rgregg

    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.

    node:events:485
          throw er; // Unhandled 'error' event
          ^
    
    Error: spawn rg  ENOENT
        at ChildProcess._handle.onexit (node:internal/child_process:286:19)
        at onErrorNT (node:internal/child_process:484:16)
        at process.processTicksAndRejections (node:internal/process/task_queues:90:21)
    Emitted 'error' event on ChildProcess instance at:
        at ChildProcess._handle.onexit (node:internal/child_process:292:12)
        at onErrorNT (node:internal/child_process:484:16)
        at process.processTicksAndRejections (node:internal/process/task_queues:90:21) {
      errno: -2,
      code: 'ENOENT',
      syscall: 'spawn rg ',
      path: 'rg ',
      spawnargs: [ 'openai' ]
    }
    
    Node.js v23.9.0
    
  3. den-run-ai commented on Apr 16, 2025

    @den-run-ai

    same here with rg, which is in path:

    node:events:492
          throw er; // Unhandled 'error' event
          ^
    
    Error: spawn rg --files ENOENT
        at ChildProcess._handle.onexit (node:internal/child_process:286:19)
        at onErrorNT (node:internal/child_process:484: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:292:12)
        at onErrorNT (node:internal/child_process:484:16)
        at process.processTicksAndRejections (node:internal/process/task_queues:82:21) {
      errno: -2,
      code: 'ENOENT',
      syscall: 'spawn rg --files',
      path: 'rg --files',
      spawnargs: []
    }
    
    Node.js v20.9.0
  4. den-run-ai commented on Apr 16, 2025

    @den-run-ai

    I figured out the problem. This issue most likely only happens with gpt-4o, once I switched to o4-mini-2025-04-16, then the problem is resolved!

  5. cuacurie commented on Apr 16, 2025

    @cuacurie
    Author

    I figured out the problem. This issue most likely only happens with gpt-4o, once I switched to o4-mini-2025-04-16, then the problem is resolved!

    I was using that same model.

  6. den-run-ai commented on Apr 16, 2025

    @den-run-ai

    @cuacurie i also restarted the terminal after brew install ripgrep

  7. DeadmanLabs commented on Apr 16, 2025

    @DeadmanLabs

    OS: WSL Ubuntu
    Node Version: 18.20.6
    Tested Models: gpt-4o, o4-mini-2025-04-16

    same issues

  8. tibo-openai commented on Apr 16, 2025

    @tibo-openai
    Collaborator

    Removed rg as a hard req in #50

  9. afiodorov commented on Apr 16, 2025

    @afiodorov

    Seems to just die when tries to run a non-existing command:

    
        command.stdout (code: 0, duration: 0.1s)
    
        fastapi>=0.95.0
        uvicorn>=0.21.1
        httpx>=0.24.0
        mcp[cli]>=0.5.0
        ... (2 more lines)
    
        thinking for 40s
    
        thinking for 41s
    
        command
    
        $ mcp --help
    ╭────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮
    │( ●    )  Thinking                                                                                                                                                                                                                                                          │
    ╰────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯
      send q or ctrl+c to exit | send "/clear" to reset | send "/help" for commands | press enter to send
    
    node:events:485
          throw er; // Unhandled 'error' event
          ^
    
    Error: spawn mcp ENOENT
        at ChildProcess._handle.onexit (node:internal/child_process:286:19)
        at onErrorNT (node:internal/child_process:484:16)
        at process.processTicksAndRejections (node:internal/process/task_queues:90:21)
    Emitted 'error' event on ChildProcess instance at:
        at ChildProcess._handle.onexit (node:internal/child_process:292:12)
        at onErrorNT (node:internal/child_process:484:16)
        at process.processTicksAndRejections (node:internal/process/task_queues:90:21) {
      errno: -2,
      code: 'ENOENT',
      syscall: 'spawn mcp',
      path: 'mcp',
      spawnargs: [ '--help' ]
    }
    
    Node.js v23.10.0
    ➜  damn-vulnerable-MCP-server git:(main) mcp
    zsh: command not found: mcp
    
    
  10. afiodorov commented on Apr 16, 2025

    @afiodorov

    easy to replicate:

    user
    run command mcp
    
        thinking for 5s
    
        command
    
        $ mcp
    
    ╭────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮
    │Shell Command                                                                                                                                                                                                                                                               │
    │                                                                                                                                                                                                                                                                            │
    │$ mcp                                                                                                                                                                                                                                                                       │
    │                                                                                                                                                                                                                                                                            │
    │Allow command?                                                                                                                                                                                                                                                              │
    │                                                                                                                                                                                                                                                                            │
    │    Yes (y)                                                                                                                                                                                                                                                                 │
    │  ❯ Yes, always approve this exact command for this session (a) ✔                                                                                                                                                                                                           │
    │    Edit or give feedback (e)                                                                                                                                                                                                                                               │
    │    No, and keep going (n)                                                                                                                                                                                                                                                  │
    │    No, and stop for now (esc)                                                                                                                                                                                                                                              │
    ╰────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯
    node:events:485
          throw er; // Unhandled 'error' event
          ^
    
    Error: spawn mcp ENOENT
        at ChildProcess._handle.onexit (node:internal/child_process:286:19)
        at onErrorNT (node:internal/child_process:484:16)
        at process.processTicksAndRejections (node:internal/process/task_queues:90:21)
    Emitted 'error' event on ChildProcess instance at:
        at ChildProcess._handle.onexit (node:internal/child_process:292:12)
        at onErrorNT (node:internal/child_process:484:16)
        at process.processTicksAndRejections (node:internal/process/task_queues:90:21) {
      errno: -2,
      code: 'ENOENT',
      syscall: 'spawn mcp',
      path: 'mcp',
      spawnargs: []
    }
    
    Node.js v23.10.0
    
  11. afiodorov commented on Apr 16, 2025

    @afiodorov

    Fixed for myself in #119 - although a global try catch would be nice to stop it from crashing...

  12. tibo-openai commented on Apr 16, 2025

    @tibo-openai
    Collaborator

    Fixed in #79 and #50

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions