openclaw - 💡(How to fix) Fix sessions_spawn(runtime: "acp", agentId: "claude") returns ACP_TURN_FAILED reliably [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#78212Fetched 2026-05-07 03:39:35
View on GitHub
Comments
1
Participants
2
Timeline
2
Reactions
2
Author
Timeline (top)
closed ×1commented ×1

Error Message

  • Internal completion event fires within ~1 second: failed: AcpRuntimeError: Internal error, 0 tokens, no useful detail in client-facing error.
  • Gateway log shows: agent errorCode=UNAVAILABLE errorMessage=AcpRuntimeError: Internal error code=ACP_TURN_FAILED.
  1. Surface a more specific error than "Internal error" when ACP_TURN_FAILED fires.

Fix Action

Workaround

  • Invoke claude -p "$prompt" --output-format json --add-dir <workspace> --permission-mode acceptEdits --model claude-opus-4-7 > /tmp/output.log 2>&1 & in the background.
  • Bypasses sessions_spawn entirely.
  • Cost: no live progress visibility, no announce delivery, manual log parsing on completion.

Code Example

sessions_spawn runtime="acp" agentId="claude" mode="run" task="Say hello"
# Returns 1-second failure with ACP_TURN_FAILED
RAW_BUFFERClick to expand / collapse

Affected version

[email protected] with @agentclientprotocol/[email protected].

Severity

Medium. Intended-public agent-spawn path is broken, forces fallback to direct CLI invocation.

Symptoms

  • sessions_spawn returns status: "accepted" immediately with a child session key.
  • Internal completion event fires within ~1 second: failed: AcpRuntimeError: Internal error, 0 tokens, no useful detail in client-facing error.
  • Gateway log shows: agent errorCode=UNAVAILABLE errorMessage=AcpRuntimeError: Internal error code=ACP_TURN_FAILED.
  • Reproduces every time across multiple sessions on 2026-05-05.

Verified working in isolation

  • The Claude ACP bridge (@agentclientprotocol/[email protected]) responds correctly to JSON-RPC initialize when invoked directly via ~/.openclaw/acpx/claude-agent-acp-wrapper.mjs. Returns full agent capabilities.
  • claude -p (the underlying Claude Code CLI) works correctly when invoked in background.
  • Auth is working (ANTHROPIC_API_KEY accepted).

Failure is in OpenClaw's ACP runtime → bridge handshake, not in any of: wrapper, bridge, Claude Code, or auth.

Workaround

  • Invoke claude -p "$prompt" --output-format json --add-dir <workspace> --permission-mode acceptEdits --model claude-opus-4-7 > /tmp/output.log 2>&1 & in the background.
  • Bypasses sessions_spawn entirely.
  • Cost: no live progress visibility, no announce delivery, manual log parsing on completion.

What upstream needs to fix

  1. Surface a more specific error than "Internal error" when ACP_TURN_FAILED fires.
  2. If the failure is a timeout, expose the timeout boundary.
  3. If it's a credential mismatch, name the credential.
  4. Provide an openclaw doctor check that exercises the ACP runtime end-to-end, not just plugin presence.

Repro

sessions_spawn runtime="acp" agentId="claude" mode="run" task="Say hello"
# Returns 1-second failure with ACP_TURN_FAILED

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 sessions_spawn(runtime: "acp", agentId: "claude") returns ACP_TURN_FAILED reliably [1 comments, 2 participants]