Skip to content

Codex update fails on native Windows because the maintenance plan drops the resolved executable path #5428

Closed

Description

@dillonzq

Summary

Updating Codex on an enrolled native Windows machine fails before the updater starts with File not found: . bb correctly discovers the native codex.exe, but its maintenance bridge discards that path and asks node-pty to spawn the extensionless codex command instead.

Versions and environment

  • bb 0.46.0, npm installation; currently the latest published desktop release.
  • Enrolled native Windows machine connected to a remote bb server. The Windows build number was not captured.
  • Node v24.19.0; Codex CLI 0.160.0, installed as a native executable under %LOCALAPPDATA%\Programs\OpenAI\Codex\bin\codex.exe.
  • Latest upstream main checked: e9dafb6c0245a37c6972dffa71134d546f3d497e. The faulty plan is still present. A new regression test against this commit fails because the plan returns command: "codex" despite discovering an absolute executable path.
  • The live Windows reproduction below comes from the original investigation on 0.46.0. The new main regression was run on macOS; I have not run a rebuilt main daemon on Windows.

Steps to reproduce

  1. Enroll a native Windows machine with a native Codex installation on PATH, older than the version offered in Settings → Updates.
  2. Run bb machine list --json and obtain the Windows host ID.
  3. Run bb updates status --json. Confirm that Codex has an absolute .exe executablePath and an available update action.
  4. Run bb updates apply --machine <windows-host-id> --json.

A download is unnecessary to isolate the startup failure. From the Windows bb npm installation directory, save and run this as repro.cjs with node repro.cjs:

const pty = require('./node_modules/node-pty');
(async () => {
  for (const command of ['codex', 'codex.exe']) {
    await new Promise((resolve) => {
      try {
        const child = pty.spawn(command, ['--version'], {
          cwd: process.cwd(), env: process.env, cols: 120, rows: 30,
        });
        let output = '';
        child.onData((text) => { output += text; });
        child.onExit(({ exitCode }) => {
          console.log(JSON.stringify({ command, exitCode, output }));
          resolve();
        });
      } catch (error) {
        console.log(JSON.stringify({ command, error: error.message }));
        resolve();
      }
    });
  }
})();

Expected vs actual

Expected: the update plan launches the executable bb already discovered, with update as a separate argument.

Actual bb output:

{
  "results": [
    {
      "hostId": "host_cduug7iwc9",
      "hostName": "Dillon-Workstation",
      "provider": "codex",
      "success": false,
      "message": "File not found: "
    }
  ]
}

In the original node-pty experiment, codex --version throws File not found: , whereas codex.exe --version and the absolute codex.exe path both exit 0 and print codex-cli 0.160.0. Codex remains at 0.160.0 after the failed bb update.

Evidence

What I ruled out

  • Not a missing Codex installation: both the .exe name and absolute path launch successfully in the same node-pty environment.
  • Not a download/registry failure: --version reproduces the startup failure before any update download.
  • Not Provider CLI maintenance should recognize externally managed executables and defer to their package manager #3166: this concerns spawning a native Windows executable, rather than package-manager ownership policy.
  • Searched open and closed issues for Windows Codex updates and File not found, plus related Windows provider PRs; found no matching report.

Suggested priority and effort

Medium: blocks the bb Codex updater for native Windows installations; using the discovered executable path is a small provider-local fix. This report establishes process startup, not whether the subsequent vendor updater succeeds.

AGENT GENERATED

Activity

  1. added theissue type on Oct 13, 2026
  2. added
    providers
    provider-codex
    partial-repro
    on Oct 13, 2026
  3. bb-slop-cop commented on Oct 13, 2026

    @bb-slop-cop
    Contributor

    🚨 SLOP COP 🚨 · new-issue-autopilot

    • Classification: Bug · Priority: Medium · Effort: Low. Applied providers, provider-codex, and partial-repro; no existing classifications were replaced.
    • Report: https://get-bb.github.io/reports/issues/5428.html
    • Verdict: PARTIALLY REPRODUCED · root-cause confidence: high. The public maintenance regression fails in two clean checkouts of trusted main: executable discovery succeeds, but the update plan returns codex instead of the absolute path. Native Windows startup and vendor-update completion remain unverified.
    • Root cause: The provider's update-command helper discards executablePath; the daemon forwards the resulting bare command directly to node-pty.
    • No duplicate PR: Open PR #5429 already links to this issue. Its branch was not run; no additional fix was pushed.

    AGENT GENERATED

  4. mathias-pedersen commented on Oct 19, 2026

    @mathias-pedersen

    We can reproduce the same launch failure on two Windows machines with bb 0.46.1 and npm-installed Codex. Using bb's bundled node-pty with read-only --version commands:

    • codex resolves to the extensionless npm shell shim and exits with code 2; the absolute path to that shim exits with code 193.
    • codex.cmd --version succeeds in the same environment.
    • We also see claude --version fail with File not found:, while the full path to claude.exe succeeds.

    This adds an npm-installed Codex case and a related Claude updater case to the native Codex case reported here. These checks establish process startup; we have not tested the proposed fix. Happy to test a fix against both installation types.

    AGENT GENERATED

  5. zom-2018 commented on Oct 20, 2026

    @zom-2018
    Contributor

    Same failure for Claude Code on bb 0.46.2-nightly.39288295552.1. Open PR #5429 only changes plugins/provider-codex, so it won't fix this one.

    • Windows host, native Claude install at %USERPROFILE%\.local\bin\claude.exe (2.1.302), which is on PATH.
    • Settings → Updates → Claude Code → Update fails with File not found: (empty path after the colon).
    • Running claude update from cmd on the same machine works (2.1.302 → 2.1.304).

    Cause, from the bundled provider-claude-code host: claudeExecutable() returns the bare string "claude" whenever which("claude") finds it on win32. It only falls back to the absolute ~/.local/bin/claude.exe when PATH lookup fails. The run plan is {command: "claude", args: ["update"]}. node-pty's get_shell_path doesn't apply PATHEXT, so claude → File not found: . An npm-global install (claude.cmd) would hit the same problem.

    Suggested fix: same as #5429. Launch the resolved executablePath in the Claude run plan, and maybe add a shared helper so Pi and other providers don't repeat this. Workaround for now: set BB_CLAUDE_CODE_EXECUTABLE=C:\Users\<user>\.local\bin\claude.exe in the host daemon's environment.

    AGENT GENERATED

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

    partial-reproprovider-codexproviders

    Type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions