Description:
The Claude Code ACP agent (@zed-industries/claude-agent-acp) in prompt mode (persistent session) consistently fails shortly after connection with the error "Query closed before response received" and "lastAgentDisconnectReason": "connection_close". The agent disconnects without an exit code or signal, leading to task failures when OpenClaw attempts to use it in a continuous interaction mode.
Context:
- This occurs when using the OpenClaw Gateway's ACP runtime to spawn a Claude Code agent in a persistent session (analogous to
acpx claude prompt).
- The
exec mode (acpx claude exec) works without issues for one-shot tasks.
- The problem is observed when the ACP runtime relies on the agent's
prompt mode for continuous interaction within a session.
Error Message:
"Query closed before response received"
"lastAgentDisconnectReason": "connection_close"
Steps to reproduce (using OpenClaw CLI, assuming acpx plugin is installed and configured):
- Configure OpenClaw to use the acpx plugin for ACP runtime.
- Attempt to spawn a Claude Code agent in a thread-bound session, e.g., via
sessions_spawn(runtime="acp", agentId="claude", mode="session", task="Your task that requires continuous interaction").
- Observe the
ACP_TURN_FAILED error in the OpenClaw logs, with the underlying cause being the Claude Code agent's connection closing unexpectedly.
Expected behavior:
The Claude Code ACP agent should maintain a persistent connection in prompt mode, allowing for continuous interaction and task execution within an ACP session.
Impact:
This bug prevents the reliable use of Claude Code via OpenClaw's ACP runtime for any tasks requiring multi-turn interaction or persistent sessions.
Description:
The Claude Code ACP agent (
@zed-industries/claude-agent-acp) inpromptmode (persistent session) consistently fails shortly after connection with the error "Query closed before response received" and "lastAgentDisconnectReason": "connection_close". The agent disconnects without an exit code or signal, leading to task failures when OpenClaw attempts to use it in a continuous interaction mode.Context:
acpx claude prompt).execmode (acpx claude exec) works without issues for one-shot tasks.promptmode for continuous interaction within a session.Error Message:
Steps to reproduce (using OpenClaw CLI, assuming acpx plugin is installed and configured):
sessions_spawn(runtime="acp", agentId="claude", mode="session", task="Your task that requires continuous interaction").ACP_TURN_FAILEDerror in the OpenClaw logs, with the underlying cause being the Claude Code agent's connection closing unexpectedly.Expected behavior:
The Claude Code ACP agent should maintain a persistent connection in
promptmode, allowing for continuous interaction and task execution within an ACP session.Impact:
This bug prevents the reliable use of Claude Code via OpenClaw's ACP runtime for any tasks requiring multi-turn interaction or persistent sessions.