Skip to content

codex-acp cli fails on Windows when CODEX_PATH contains a space #602

Open

Description

@zeroliu

Problem

On Windows, spawnCodexCli launches a custom CODEX_PATH through the shell:

return spawn(codexPath, args, {...options, shell: process.platform === "win32"});

With shell: true, Node joins the command and its arguments without quoting and passes the result to cmd.exe. When CODEX_PATH points at a codex.exe under a path that contains a space, such as C:\Users\Jane Doe\..., cmd.exe splits the path at the space and the command never starts. This breaks codex-acp cli login, cli logout and cli app-server.

Context

#588 fixed the same problem for the app-server launch by switching startCodexConnection to cross-spawn on Windows. cross-spawn runs .exe files directly and runs .cmd shims through cmd.exe with correct escaping. CodexCli.ts on main still uses shell: true.

Proposal

Use the same cross-spawn call in spawnCodexCli on Windows.

Why it matters to us

Copilot for Obsidian ships codex-acp with a bundled native Codex installed under the user's profile folder, so any Windows username with a space hits this. Our Windows package tests run the adapter from a path containing a space, and we carry a local patch that sets shell: false until this is fixed upstream.

Activity

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