Skip to content

Codex uses bundled pnpm instead of host toolchain #30440

Description

@kkaatii

What version of the Codex App are you using (From “About Codex” dialog)?

26.623.42026

What subscription do you have?

Pro

What platform is your computer?

Darwin 24.6.0 arm64 arm

What issue are you seeing?

Codex is consistently failing to run my build script because that script invokes pnpm install.

As per its own diagnosis:

  • My local projects uses PNPM v10
  • Codex comes bundled with PNPM v11 in ~/.cache/codex-runtimes/codex-primary-runtime/dependencies/bin/pnpm
  • When running the build script, Codex uses the bundled one, leading to failure to resolve dependencies, whereas the build script is run fine in any local terminal

What steps can reproduce the bug?

  1. Create a pnpm v10 project with dependencies in package.json
  2. Run pnpm install in terminal to install the dependencies
  3. Create a js script
    import { spawn } from "node:child_process";
       
    const child = spawn("pnpm", ["install"], {
      cwd: process.cwd(),
      stdio: ["ignore", "pipe", "pipe"],
    });
    
    child.on("close", (code) => {
      process.exit(code ?? 1);
    });
  4. Ask Codex (with pnpm v11 bundled) to run node script.mjs inside project dir

What is the expected behavior?

Codex should use my local pnpm binary, and ask for permission elevation when needed.

In fact, using this to run the build script is fine: PATH="path-to-my-local-nodejs/bin:$PATH" CI=true node script.mjs

Additional information

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    appIssues related to the Codex desktop appbugSomething isn't workingsandboxIssues related to permissions or sandboxing

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions