openclaw - ✅(Solved) Fix [Bug]: Windows ACP Codex spawn via OpenClaw exits with code 1 while direct acpx codex initializes [1 pull requests, 1 comments, 2 participants]

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…
GitHub stats
openclaw/openclaw#60672Fetched 2026-04-08 02:48:27
View on GitHub
Comments
1
Participants
2
Timeline
5
Reactions
0
Author
Timeline (top)
commented ×1cross-referenced ×1labeled ×1mentioned ×1

On Windows with OpenClaw 2026.3.13, sessions_spawn(... runtime:"acp", agentId:"codex") fails with acpx exited with code 1, while direct acpx codex ... commands initialize successfully.

Error Message

  • acpx codex sessions new --name test-codex returns without error (no error output; command returned to prompt)

Root Cause

On Windows with OpenClaw 2026.3.13, sessions_spawn(... runtime:"acp", agentId:"codex") fails with acpx exited with code 1, while direct acpx codex ... commands initialize successfully.

Fix Action

Fixed

PR fix notes

PR #60678: fix(acpx): add windowsHide to MCP proxy spawn on Windows

Description (problem / solution / changelog)

On Windows, the MCP proxy spawns the target agent command (e.g., npx codex-acp) without the windowsHide option. This can cause issues where the spawned process exits with code 1 due to terminal window handling issues.

This fix adds windowsHide: true to the spawn options when running on Windows, consistent with how the main acpx spawn handles Windows terminals.

Fixes #60672

Changed files

  • extensions/acpx/src/runtime-internals/mcp-proxy.mjs (modified, +7/-2)
  • extensions/feishu/src/media.ts (modified, +3/-1)
  • extensions/ollama/index.ts (modified, +4/-1)
  • extensions/ollama/src/stream.ts (modified, +21/-2)

Code Example

Relevant observed evidence:

text
acpx runtime backend ready


text
sessions_spawn(... runtime:"acp", agentId:"codex" ...) -> acpx exited with code 1


text
C:\Users\User\AppData\Roaming\npm\node_modules\openclaw\extensions\acpx\node_modules\.bin\acpx.cmd --cwd C:\Users\User\.openclaw\workspace-jason codex sessions new --name test-codex

Result:
text
(no error output; command returned to prompt)


text
C:\Users\User\AppData\Roaming\npm\node_modules\openclaw\extensions\acpx\node_modules\.bin\acpx.cmd --cwd C:\Users\User\.openclaw\workspace-jason codex exec "Inspect the drayageconnection project and summarize it briefly."

Result:
text
[client] initialize (running)


Earlier Windows-specific spawn evidence before switching the ACPX agent command to direct node ...codex-acp.js:

text
spawn EINVAL


Codex ACP wrapper path inspection:

text
C:\Users\User\AppData\Roaming\npm\codex-acp.cmd
C:\Users\User\AppData\Roaming\npm\codex-acp.ps1
C:\Users\User\AppData\Roaming\npm\node_modules\@zed-industries\codex-acp\bin\codex-acp.js
RAW_BUFFERClick to expand / collapse

Bug type

Crash (process/app exits or hangs)

Beta release blocker

No

Summary

On Windows with OpenClaw 2026.3.13, sessions_spawn(... runtime:"acp", agentId:"codex") fails with acpx exited with code 1, while direct acpx codex ... commands initialize successfully.

Steps to reproduce

  1. Install OpenClaw 2026.3.13 on Windows.
  2. Enable the acpx plugin.
  3. Configure:
  • acp.allowedAgents = ["codex"]
  • acp.defaultAgent = "codex"
  1. Install Codex ACP:
  • npm install -g @zed-industries/codex-acp
  1. Create ACPX project config at C:\Users\User.openclaw\workspace-jason.acpxrc.json with: json { "agents": { "codex": { "command": "node C:\Users\User\AppData\Roaming\npm\node_modules\@zed-industries\codex-acp\bin\codex-acp.js" } } }

  2. Confirm gateway log shows:

  • acpx runtime backend ready
  1. Trigger an OpenClaw ACP Codex run via agent/session spawn:
  • observed from assistant-side sessions_spawn(runtime:"acp", agentId:"codex", ...)
  1. Observe failure:
  • acpx exited with code 1

Expected behavior

After acpx runtime backend ready and successful direct acpx codex initialization, an OpenClaw ACP Codex run should start successfully instead of exiting with code 1.

Actual behavior

OpenClaw ACP Codex runs fail with:

  • acpx exited with code 1

At the same time, direct ACPX commands succeed further:

  • acpx codex sessions new --name test-codex returns without error
  • acpx codex exec "Inspect the drayageconnection project and summarize it briefly." prints:
  • [client] initialize (running)

OpenClaw version

2026.3.13 (61d171a)

Operating system

Windows 11

Install method

npm global

Model

openai-codex/gpt-5.4

Provider / routing chain

openclaw -> openai-codex/gpt-5.4

Additional provider/model setup details

  • acpx plugin status: loaded

  • acp.allowedAgents: json ["codex"]

  • acp.defaultAgent: text codex

  • Gateway log previously showed ACPX runtime healthy:

  • acpx runtime backend ready

Logs, screenshots, and evidence

Relevant observed evidence:

text
acpx runtime backend ready


text
sessions_spawn(... runtime:"acp", agentId:"codex" ...) -> acpx exited with code 1


text
C:\Users\User\AppData\Roaming\npm\node_modules\openclaw\extensions\acpx\node_modules\.bin\acpx.cmd --cwd C:\Users\User\.openclaw\workspace-jason codex sessions new --name test-codex

Result:
text
(no error output; command returned to prompt)


text
C:\Users\User\AppData\Roaming\npm\node_modules\openclaw\extensions\acpx\node_modules\.bin\acpx.cmd --cwd C:\Users\User\.openclaw\workspace-jason codex exec "Inspect the drayageconnection project and summarize it briefly."

Result:
text
[client] initialize (running)


Earlier Windows-specific spawn evidence before switching the ACPX agent command to direct node ...codex-acp.js:

text
spawn EINVAL


Codex ACP wrapper path inspection:

text
C:\Users\User\AppData\Roaming\npm\codex-acp.cmd
C:\Users\User\AppData\Roaming\npm\codex-acp.ps1
C:\Users\User\AppData\Roaming\npm\node_modules\@zed-industries\codex-acp\bin\codex-acp.js

Impact and severity

No response

Additional information

No response

extent analysis

TL;DR

The issue might be resolved by adjusting the command path in the .acpxrc.json configuration file to correctly point to the codex-acp.js executable.

Guidance

  • Verify that the codex-acp.js file exists at the specified path C:\\Users\\User\\AppData\\Roaming\\npm\\node_modules\\@zed-industries\\codex-acp\\bin\\codex-acp.js and is executable.
  • Check the Windows-specific spawn evidence, which previously showed spawn EINVAL, indicating a potential issue with the command execution.
  • Consider modifying the command field in the .acpxrc.json file to use the node executable explicitly, like "command": "node C:\\Users\\User\\AppData\\Roaming\\npm\\node_modules\\@zed-industries\\codex-acp\\bin\\codex-acp.js".
  • Test the acpx command with the --cwd option, as shown in the logs, to ensure it works correctly.

Example

No code snippet is provided, as the issue seems to be related to configuration and command execution rather than code.

Notes

The issue might be specific to the Windows environment, and the solution may involve adjusting the command path or execution method. Further investigation into the spawn EINVAL error may be necessary to fully resolve the issue.

Recommendation

Apply a workaround by modifying the command field in the .acpxrc.json file to correctly point to the codex-acp.js executable, as this is the most likely cause of the issue.

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

FAQ

Expected behavior

After acpx runtime backend ready and successful direct acpx codex initialization, an OpenClaw ACP Codex run should start successfully instead of exiting with code 1.

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING

openclaw - ✅(Solved) Fix [Bug]: Windows ACP Codex spawn via OpenClaw exits with code 1 while direct acpx codex initializes [1 pull requests, 1 comments, 2 participants]