-
-
Notifications
You must be signed in to change notification settings - Fork 69.4k
Bug: ACP sessions fail with ACP_TURN_FAILED — acpx spawns Claude Code without PTY (Ink raw mode crash) #28786
Description
Environment
- OpenClaw:
2026.2.26(bc50708) - acpx:
0.1.13 - macOS arm64, Node 22.22.0
- Claude Code:
2.1.62
Symptom
Every sessions_spawn runtime="acp" agentId="claude" fails immediately with:
AcpRuntimeError: Internal error: code=ACP_TURN_FAILED
Session histories are empty — agents never execute a single line. Same failure for agentId="codex".
Root Cause Confirmed
acpx spawns the Claude Code queue owner process without a PTY. Claude Code uses Ink (React terminal UI) which requires raw mode TTY — it crashes immediately.
Error from Claude Code process:
ERROR: Raw mode is not supported on the current process.stdin, which Ink uses as input stream by default.
The spawn call in runtime-internals/process.ts is hardcoded:
return spawn(resolved.command, resolved.args, {
cwd: params.cwd,
env: process.env,
stdio: ["pipe", "pipe", "pipe"], // ← no PTY, hardcoded
shell: resolved.shell,
});How I Found It
acpx execworks fine (different code path, no queue owner needed)acpx promptfails because it starts a persistent queue owner which spawns claude — but without TTY it dies instantly- Verbose output:
agent needs reconnect→starting detached queue owner→ immediate crash - Also confirmed in gateway logs:
--session ""(empty session name) because the queue owner never initialises
Additional Signals
Gateway logs on every restart:
acp startup identity reconcile (renderer=v1): checked=32 resolved=0 failed=32
/acp doctor reports healthy. openclaw doctor --fix ran but didn't resolve it.
Requested Fix
spawnWithResolvedCommand in runtime-internals/process.ts needs to support spawning with a pseudo-terminal (PTY) for harnesses like Claude Code that require raw mode TTY.
Workaround (current)
Using exec with pty:true and claude --dangerously-skip-permissions -p directly — works but bypasses the full ACP session management.