openclaw - 💡(How to fix) Fix acpx: `toAcpRuntimeError` drops real cause details when foreign error codes are numeric

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…

toAcpRuntimeError in errors-InpFF2ID.js:36 (bundled output) only recognises foreign error codes when they are strings present in ACP_ERROR_CODES. ACP SDK errors arrive as RequestError(-32603, "Internal error", data) with the real cause in data.details. Because -32603 is a number (not a key in ACP_ERROR_CODES), the recogniser falls through, the message degrades to a generic "Internal error", and data.details is discarded entirely.

End-user impact: operator sees ACP_TURN_FAILED: Internal error with no signal as to which option/parameter actually caused the rejection. We spent significant time bisecting before realising the underlying detail string described the real problem.

Error Message

toAcpRuntimeError in errors-InpFF2ID.js:36 (bundled output) only recognises foreign error codes when they are strings present in ACP_ERROR_CODES. ACP SDK errors arrive as RequestError(-32603, "Internal error", data) with the real cause in data.details. Because -32603 is a number (not a key in ACP_ERROR_CODES), the recogniser falls through, the message degrades to a generic "Internal error", and data.details is discarded entirely. End-user impact: operator sees ACP_TURN_FAILED: Internal error with no signal as to which option/parameter actually caused the rejection. We spent significant time bisecting before realising the underlying detail string described the real problem. 2. Observe the error surfaced to the caller. It will be "Internal error"; the underlying details field (which would have said something like unknown config option: timeout) is lost. In toAcpRuntimeError, recognise foreign codes by both string and number lookups, and always preserve data.details on the wrapped error (e.g. as a cause or by concatenating into the message). At minimum: when the foreign error has data.details, surface it.

Root Cause

toAcpRuntimeError in errors-InpFF2ID.js:36 (bundled output) only recognises foreign error codes when they are strings present in ACP_ERROR_CODES. ACP SDK errors arrive as RequestError(-32603, "Internal error", data) with the real cause in data.details. Because -32603 is a number (not a key in ACP_ERROR_CODES), the recogniser falls through, the message degrades to a generic "Internal error", and data.details is discarded entirely.

Fix Action

Fix / Workaround

Workaround until fixed

RAW_BUFFERClick to expand / collapse

Repo: openclaw/openclaw Component: @openclaw/acpx (ACP harness) Found: 2026-05-11 while bringing up Claude Code via ACP on macOS.

Summary

toAcpRuntimeError in errors-InpFF2ID.js:36 (bundled output) only recognises foreign error codes when they are strings present in ACP_ERROR_CODES. ACP SDK errors arrive as RequestError(-32603, "Internal error", data) with the real cause in data.details. Because -32603 is a number (not a key in ACP_ERROR_CODES), the recogniser falls through, the message degrades to a generic "Internal error", and data.details is discarded entirely.

End-user impact: operator sees ACP_TURN_FAILED: Internal error with no signal as to which option/parameter actually caused the rejection. We spent significant time bisecting before realising the underlying detail string described the real problem.

Reproduction

  1. Spawn a Claude ACP session via sessions_spawn({ runtime: "acp", agentId: "claude", timeoutSeconds: 60 }) against @agentclientprotocol/[email protected] (see companion bug report on timeoutSeconds).
  2. Observe the error surfaced to the caller. It will be "Internal error"; the underlying details field (which would have said something like unknown config option: timeout) is lost.

Suggested fix

In toAcpRuntimeError, recognise foreign codes by both string and number lookups, and always preserve data.details on the wrapped error (e.g. as a cause or by concatenating into the message). At minimum: when the foreign error has data.details, surface it.

Workaround until fixed

Operators have to read raw acp-stream.jsonl files at ~/.openclaw/agents/*/sessions/*.acp-stream.jsonl to see the real cause — the API surface hides it.

Environment

  • OpenClaw 2026.5.7
  • macOS 15 (arm64), Node 24.15.0
  • @openclaw/acpx from npm ~/.openclaw/npm/node_modules/@openclaw/acpx/
  • @agentclientprotocol/[email protected]

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

openclaw - 💡(How to fix) Fix acpx: `toAcpRuntimeError` drops real cause details when foreign error codes are numeric