openclaw - 💡(How to fix) Fix ACPX gateway startup should not depend on live npx adapter resolution [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#73202Fetched 2026-04-29 06:22:14
View on GitHub
Comments
1
Participants
2
Timeline
4
Reactions
0
Author
Participants
Timeline (top)
cross-referenced ×2closed ×1commented ×1

OpenClaw ACPX became unstable when the ACP adapter command depended on live npx package resolution at gateway runtime. Pinning the ACP adapters locally and pointing OpenClaw at local wrapper scripts fixed gateway startup and allowed both Codex ACP and Claude ACP sessions to pass.

I am filing this as an upstream robustness issue rather than a local npm bug: ACPX should not require live npm registry/DNS/cache behavior during gateway startup or managed ACP session launch.

Root Cause

OpenClaw ACPX became unstable when the ACP adapter command depended on live npx package resolution at gateway runtime. Pinning the ACP adapters locally and pointing OpenClaw at local wrapper scripts fixed gateway startup and allowed both Codex ACP and Claude ACP sessions to pass.

I am filing this as an upstream robustness issue rather than a local npm bug: ACPX should not require live npm registry/DNS/cache behavior during gateway startup or managed ACP session launch.

Fix Action

Fix / Workaround

Workaround That Fixed It

The 'gpt-5.5' model requires a newer version of Codex. Please upgrade to the latest app or CLI and try again.

Code Example

npx -y @agentclientprotocol/claude-agent-acp@0.31.0

---

~/.openclaw/acpx/claude-agent-acp-local

---

~/.openclaw/acpx/claude-agent-acp-wrapper.mjs

---

./claude-agent-acp-local/node_modules/@agentclientprotocol/claude-agent-acp/dist/index.js

---

CLAUDE_MODEL=claude-opus-4-6
CLAUDE_CODE_EXECUTABLE=/opt/homebrew/bin/claude

---

The 'gpt-5.5' model requires a newer version of Codex. Please upgrade to the latest app or CLI and try again.

---

@zed-industries/codex-acp@0.12.0

---

~/.openclaw/acpx/codex-acp-local

---

~/.openclaw/acpx/codex-acp-wrapper.mjs

---

~/.openclaw/acpx/codex-acp-local/node_modules/@zed-industries/codex-acp-darwin-arm64/bin/codex-acp

---

gateway ready (8 plugins: acpx, anthropic, browser, device-pair, memory-core, phone-control, talk-voice, telegram; 8.4s)
embedded acpx runtime backend registered

---

Status: loaded
Origin: bundled
Version: 2026.4.25
Services:
acpx-runtime

---

openclaw acp client \
  --cwd ~/.openclaw/workspace \
  --server ~/.openclaw/acpx/codex-acp-wrapper.mjs \
  --verbose \
  --server-verbose

---

Please respond with exactly: ACP_CODEX_OK

---

ACP_CODEX_OK

---

openclaw acp client \
  --cwd ~/.openclaw/workspace \
  --server ~/.openclaw/acpx/claude-agent-acp-wrapper.mjs \
  --verbose \
  --server-verbose

---

Please respond with exactly: ACP_CLAUDE_OK

---

ACP_CLAUDE_OK
RAW_BUFFERClick to expand / collapse

Summary

OpenClaw ACPX became unstable when the ACP adapter command depended on live npx package resolution at gateway runtime. Pinning the ACP adapters locally and pointing OpenClaw at local wrapper scripts fixed gateway startup and allowed both Codex ACP and Claude ACP sessions to pass.

I am filing this as an upstream robustness issue rather than a local npm bug: ACPX should not require live npm registry/DNS/cache behavior during gateway startup or managed ACP session launch.

Environment

  • OpenClaw: 2026.4.25 (aa36ee6)
  • Install mode: global npm/pnpm package, not git checkout
  • OS: macOS 26.4.1, Apple Silicon M4
  • Node: v22.22.2
  • npm/npx: 10.9.7
  • Gateway: LaunchAgent, local loopback gateway
  • ACPX plugin: bundled OpenClaw extension

Symptoms Observed

With ACPX configured to use a live adapter command such as:

npx -y @agentclientprotocol/[email protected]

gateway startup became fragile:

  • openclaw status --deep initially showed gateway reachable, but enabling ACPX caused slow/unreliable health checks during startup.
  • WebSocket health probes timed out / closed with 1006-style symptoms.
  • Gateway CPU stayed high for an extended period.
  • npm view @agentclientprotocol/[email protected] version hung locally and had to be killed.
  • Later, npm view @zed-industries/codex-acp version also hung in the same environment until run outside the restricted/sandboxed path.

The practical failure mode was: ACPX/gateway behavior depended on npm registry/DNS/cache behavior in the live service runtime.

Workaround That Fixed It

I removed live npx from the hot path and pinned both adapters locally.

Claude ACP

Installed locally:

~/.openclaw/acpx/claude-agent-acp-local

Wrapper:

~/.openclaw/acpx/claude-agent-acp-wrapper.mjs

The wrapper launches the local package entrypoint directly:

./claude-agent-acp-local/node_modules/@agentclientprotocol/claude-agent-acp/dist/index.js

and sets:

CLAUDE_MODEL=claude-opus-4-6
CLAUDE_CODE_EXECUTABLE=/opt/homebrew/bin/claude

Codex ACP

The cached @zed-industries/[email protected] initialized but rejected gpt-5.5:

The 'gpt-5.5' model requires a newer version of Codex. Please upgrade to the latest app or CLI and try again.

I installed and pinned:

@zed-industries/[email protected]

under:

~/.openclaw/acpx/codex-acp-local

and updated:

~/.openclaw/acpx/codex-acp-wrapper.mjs

to launch the local native adapter binary directly:

~/.openclaw/acpx/codex-acp-local/node_modules/@zed-industries/codex-acp-darwin-arm64/bin/codex-acp

The wrapper also strips OpenClaw ACP client compatibility args (acp, --verbose) before passing through to codex-acp.

Verification After Local Pinning

After replacing live npx with local pinned wrappers:

  • Gateway restarted successfully with ACPX enabled.
  • Gateway log showed:
gateway ready (8 plugins: acpx, anthropic, browser, device-pair, memory-core, phone-control, talk-voice, telegram; 8.4s)
embedded acpx runtime backend registered
  • openclaw plugins inspect acpx reported:
Status: loaded
Origin: bundled
Version: 2026.4.25
Services:
acpx-runtime
  • openclaw health passed.
  • openclaw channels status passed.
  • Gateway CPU settled back to idle.

ACP session tests

Codex ACP GPT-5.5 test:

openclaw acp client \
  --cwd ~/.openclaw/workspace \
  --server ~/.openclaw/acpx/codex-acp-wrapper.mjs \
  --verbose \
  --server-verbose

Prompt:

Please respond with exactly: ACP_CODEX_OK

Result:

ACP_CODEX_OK

Claude ACP test:

openclaw acp client \
  --cwd ~/.openclaw/workspace \
  --server ~/.openclaw/acpx/claude-agent-acp-wrapper.mjs \
  --verbose \
  --server-verbose

Prompt:

Please respond with exactly: ACP_CLAUDE_OK

Result:

ACP_CLAUDE_OK

Expected Behavior

OpenClaw/ACPX should provide a first-class way to pin/cache/install ACP adapters locally so the gateway does not depend on live npx package resolution during startup or session launch.

Possible acceptable behaviors:

  1. ACPX installs adapter dependencies into a plugin-local directory during setup/update.
  2. ACPX can auto-install/cache adapters once, then launch local binaries thereafter.
  3. openclaw doctor / openclaw acp doctor can validate adapter presence, auth, model compatibility, and network reachability in the same environment used by the gateway.
  4. If live npx is used, failures should surface as explicit npm/DNS/registry errors rather than gateway timeouts or high CPU symptoms.

Related Issues

This looks related to, but not exactly the same as:

  • #40006 - global npm install does not install ACPX extension subdependencies
  • #32380 - ACPX plugin install fallback references an unpublished package
  • #44810 - Codex ACP stalls when gateway child environment lacks network/proxy access
  • #44198 - manual ACPX/Codex works, OpenClaw ACP integration reports dead runtime
  • #60585 - ACP runtime sessions fail with acpx exited with code 1
  • #60672 - direct ACPX Codex initializes while OpenClaw spawn exits

Impact

For a long-running OpenClaw gateway, live npx is too fragile as a runtime dependency. It makes ACPX behavior depend on npm registry availability, DNS, cache state, and the launchd/service environment. Local pinning resolved the issue completely in this setup.

extent analysis

TL;DR

Pinning ACP adapters locally and using wrapper scripts to launch them can resolve the instability issue with OpenClaw ACPX.

Guidance

  • Identify the ACP adapters used in the OpenClaw configuration and pin them locally to avoid dependence on live npx package resolution.
  • Create wrapper scripts to launch the local adapters, setting any required environment variables and passing through necessary arguments.
  • Update the OpenClaw configuration to use the local wrapper scripts instead of live npx commands.
  • Verify the gateway startup and ACP session tests after making these changes to ensure the issue is resolved.

Example

For example, to pin the Claude ACP adapter locally, you can create a wrapper script claude-agent-acp-wrapper.mjs with the following content:

const { exec } = require('child_process');

exec('./claude-agent-acp-local/node_modules/@agentclientprotocol/claude-agent-acp/dist/index.js', {
  env: {
    CLAUDE_MODEL: 'claude-opus-4-6',
    CLAUDE_CODE_EXECUTABLE: '/opt/homebrew/bin/claude',
  },
});

Similarly, for the Codex ACP adapter, you can create a wrapper script codex-acp-wrapper.mjs with the following content:

const { exec } = require('child_process');

exec('./codex-acp-local/node_modules/@zed-industries/codex-acp-darwin-arm64/bin/codex-acp');

Notes

This solution assumes that the ACP adapters can be installed and run locally without issues. If there are any dependencies or compatibility issues, additional troubleshooting may be required.

Recommendation

Apply the workaround of pinning ACP adapters locally and using wrapper scripts to launch them, as this has been shown to resolve the instability issue with OpenClaw ACPX.

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…

Still need to ship something?

×6

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

Back to top recommendations

TRENDING