OpenClaw ACP minimal repro: disconnect at session/prompt (Gateway disconnected: 1005/1006)
- Report time (Asia/Shanghai): 2026-04-02 09:42:40 CST
- Impact:
acpx -> openclaw acp frequently fails to return model output; CLI times out
- Severity: High (ACP path becomes unreliable/unusable for production workflows)
1) Environment
openclaw --version
openclaw gateway --version
acpx --version
claude --version
gemini --version
Observed output:
OpenClaw 2026.3.28 (f9b1079)
OpenClaw 2026.3.28 (f9b1079)
acpx 0.3.0
Claude Code 2.1.69
Gemini CLI 0.34.0
Gateway probe:
Key output:
Reachable: yes
Local loopback ws://127.0.0.1:18799
Connect: ok (40ms) · RPC: ok
2) Minimal repro steps
Step A (control, succeeds)
acpx --timeout 40 --format json claude-code exec "Reply exactly OK"
Result: succeeds and returns OK.
Step B (problem path, fails)
acpx --timeout 40 --format json openclaw exec "Reply exactly OK"
Consistent output pattern:
{"jsonrpc":"2.0","id":2,"method":"session/prompt", ...}
{"jsonrpc":"2.0","id":2,"error":{"code":-32603,"message":"Internal error","data":{"details":"Gateway disconnected: 1005: "}}}
{"jsonrpc":"2.0","id":null,"error":{"code":-32070,"message":"Timed out after 40000ms","data":{"acpxCode":"TIMEOUT","origin":"cli"}}}
3) Expected vs actual
- Expected:
openclaw acp completes session/prompt and returns model text (e.g. OK).
- Actual:
initialize and session/new succeed, but session/prompt fails with Internal error + Gateway disconnected: 1005/1006, then timeout.
4) Key log points (/tmp/openclaw/openclaw-2026-04-02.log)
4.1 session/prompt disconnect errors
- line 361 @
2026-04-02T09:23:27.494+08:00: Gateway disconnected: 1005
- line 404 @
2026-04-02T09:24:50.054+08:00: Gateway disconnected: 1005
- line 608 @
2026-04-02T09:28:03.654+08:00: Gateway disconnected: 1005
- line 735 @
2026-04-02T09:30:50.477+08:00: Gateway disconnected: 1006
- line 907 @
2026-04-02T09:35:13.678+08:00: Gateway disconnected: 1006
4.2 Accompanying errors (possibly related)
[lcm] Migration failed: database is locked: 15 occurrences, latest:
- line 989 @
2026-04-02T09:42:02.184+08:00
ERR_USE_AFTER_CLOSE: readline was closed: 2 occurrences
- line 742 @
2026-04-02T09:30:50.932+08:00
- line 744 @
2026-04-02T09:30:51.017+08:00
5) What has already been ruled out
- Not "all ACP is broken":
claude-code succeeds on the same machine with the same style command.
- Not "gateway fully unreachable":
openclaw gateway probe reports Reachable: yes, RPC: ok.
claude-code was previously misconfigured as a plain CLI command; after fixing to ACP adapter command it works, while openclaw path still fails.
6) Initial hypothesis
This looks like an instability in openclaw acp bridge handling at session/prompt (WS close 1005/1006), rather than simple network unreachability or pure model timeout.
Likely hotspots to inspect:
- ACP
session/prompt forwarding path and websocket lifecycle handling
- Post-disconnect retry/error mapping (
-32603 + TIMEOUT combination)
- Potential amplification by LCM DB lock contention during high-concurrency/backfill workloads
7) Current workaround
- Use
acpx -> claude-code / acpx -> codex for external dev-agent workflows.
- Avoid concurrent long backfill tasks and ACP stress on the same session.
- Split high-load tasks and throttle to reduce session saturation.
If helpful, I can also provide a single zipped diagnostics bundle (commands output + log snippets + timeline).
OpenClaw ACP minimal repro: disconnect at
session/prompt(Gateway disconnected: 1005/1006)acpx -> openclaw acpfrequently fails to return model output; CLI times out1) Environment
Observed output:
OpenClaw 2026.3.28 (f9b1079)OpenClaw 2026.3.28 (f9b1079)acpx 0.3.0Claude Code 2.1.69Gemini CLI 0.34.0Gateway probe:
Key output:
Reachable: yesLocal loopback ws://127.0.0.1:18799Connect: ok (40ms) · RPC: ok2) Minimal repro steps
Step A (control, succeeds)
Result: succeeds and returns
OK.Step B (problem path, fails)
Consistent output pattern:
{"jsonrpc":"2.0","id":2,"method":"session/prompt", ...} {"jsonrpc":"2.0","id":2,"error":{"code":-32603,"message":"Internal error","data":{"details":"Gateway disconnected: 1005: "}}} {"jsonrpc":"2.0","id":null,"error":{"code":-32070,"message":"Timed out after 40000ms","data":{"acpxCode":"TIMEOUT","origin":"cli"}}}3) Expected vs actual
openclaw acpcompletessession/promptand returns model text (e.g.OK).initializeandsession/newsucceed, butsession/promptfails withInternal error+Gateway disconnected: 1005/1006, then timeout.4) Key log points (
/tmp/openclaw/openclaw-2026-04-02.log)4.1
session/promptdisconnect errors2026-04-02T09:23:27.494+08:00:Gateway disconnected: 10052026-04-02T09:24:50.054+08:00:Gateway disconnected: 10052026-04-02T09:28:03.654+08:00:Gateway disconnected: 10052026-04-02T09:30:50.477+08:00:Gateway disconnected: 10062026-04-02T09:35:13.678+08:00:Gateway disconnected: 10064.2 Accompanying errors (possibly related)
[lcm] Migration failed: database is locked: 15 occurrences, latest:2026-04-02T09:42:02.184+08:00ERR_USE_AFTER_CLOSE: readline was closed: 2 occurrences2026-04-02T09:30:50.932+08:002026-04-02T09:30:51.017+08:005) What has already been ruled out
claude-codesucceeds on the same machine with the same style command.openclaw gateway probereportsReachable: yes,RPC: ok.claude-codewas previously misconfigured as a plain CLI command; after fixing to ACP adapter command it works, whileopenclawpath still fails.6) Initial hypothesis
This looks like an instability in
openclaw acpbridge handling atsession/prompt(WS close 1005/1006), rather than simple network unreachability or pure model timeout.Likely hotspots to inspect:
session/promptforwarding path and websocket lifecycle handling-32603+TIMEOUTcombination)7) Current workaround
acpx -> claude-code/acpx -> codexfor external dev-agent workflows.If helpful, I can also provide a single zipped diagnostics bundle (commands output + log snippets + timeline).