Summary
On a fresh global npm installation, codex-acp login tries to launch a separate codex executable instead of the @openai/codex dependency bundled with @agentclientprotocol/codex-acp.
If codex is not available on PATH, the child process exits before answering the pending JSON-RPC initialize request. On Windows, the command reports only:
Login error: Pending response rejected since connection got disposed
Bare codex-acp startup and codex-acp cli ... already use the bundled CLI when CODEX_PATH is unset.
Environment
- Windows PowerShell
@agentclientprotocol/codex-acp@1.8.0
- Installed globally with npm
- No separate
codex executable on PATH
Reproduction
npm uninstall -g @zed-industries/codex-acp
npm install -g @agentclientprotocol/codex-acp
codex-acp login
Result:
Login error: Pending response rejected since connection got disposed
codex-acp cli login reaches the bundled Codex CLI instead.
Cause
src/login.ts defaults to the external command name codex:
const codexPath = process.env["CODEX_PATH"] ?? "codex";
Bare codex-acp follows a different path. src/index.ts passes the unset CODEX_PATH through as undefined. startCodexConnection() then resolves the package-local @openai/codex/bin/codex.js and starts it with the current Node executable. Its effective command is:
<current Node executable> <bundled @openai/codex/bin/codex.js> app-server
This does not search PATH. codex-acp cli ... uses the same bundled resolution when CODEX_PATH is unset.
| Invocation |
Default when CODEX_PATH is unset |
codex-acp |
Bundled Codex running app-server |
codex-acp cli ... |
Bundled Codex with the supplied CLI arguments |
codex-acp login |
External codex found through PATH |
login.ts turns an absent CODEX_PATH into the truthy string "codex" before calling startCodexConnection(). That forces the external-executable branch. If the executable is missing, the child process exits and disposes the JSON-RPC connection. The pending request then fails with the generic error above. OAuth has not started at that point.
The mismatch appears to have remained after #84 changed normal startup to use the npm dependency.
Expected behavior
When CODEX_PATH is unset, codex-acp login should use the bundled Codex CLI, matching bare codex-acp and codex-acp cli. An explicit CODEX_PATH should continue to override the bundled executable.
The login should remain visible to bare ACP startup when both commands use the same credential-store configuration.
Suggested fix
Reuse the bundled CLI resolution used by the other startup paths while preserving the dedicated login flow and its client metadata. Add regression coverage for both the bundled default and an explicit CODEX_PATH override.
Related
Summary
On a fresh global npm installation,
codex-acp logintries to launch a separatecodexexecutable instead of the@openai/codexdependency bundled with@agentclientprotocol/codex-acp.If
codexis not available onPATH, the child process exits before answering the pending JSON-RPCinitializerequest. On Windows, the command reports only:Bare
codex-acpstartup andcodex-acp cli ...already use the bundled CLI whenCODEX_PATHis unset.Environment
@agentclientprotocol/codex-acp@1.8.0codexexecutable onPATHReproduction
Result:
codex-acp cli loginreaches the bundled Codex CLI instead.Cause
src/login.tsdefaults to the external command namecodex:Bare
codex-acpfollows a different path.src/index.tspasses the unsetCODEX_PATHthrough asundefined.startCodexConnection()then resolves the package-local@openai/codex/bin/codex.jsand starts it with the current Node executable. Its effective command is:This does not search
PATH.codex-acp cli ...uses the same bundled resolution whenCODEX_PATHis unset.CODEX_PATHis unsetcodex-acpapp-servercodex-acp cli ...codex-acp logincodexfound throughPATHlogin.tsturns an absentCODEX_PATHinto the truthy string"codex"before callingstartCodexConnection(). That forces the external-executable branch. If the executable is missing, the child process exits and disposes the JSON-RPC connection. The pending request then fails with the generic error above. OAuth has not started at that point.The mismatch appears to have remained after #84 changed normal startup to use the npm dependency.
Expected behavior
When
CODEX_PATHis unset,codex-acp loginshould use the bundled Codex CLI, matching barecodex-acpandcodex-acp cli. An explicitCODEX_PATHshould continue to override the bundled executable.The login should remain visible to bare ACP startup when both commands use the same credential-store configuration.
Suggested fix
Reuse the bundled CLI resolution used by the other startup paths while preserving the dedicated login flow and its client metadata. Add regression coverage for both the bundled default and an explicit
CODEX_PATHoverride.Related