Skip to content

Claude ACP agent fails: all sessions end with 0 turns, agent disconnects after ~3s #29

@danyeoakl

Description

@danyeoakl

Environment

  • acpx: 0.1.13
  • @zed-industries/claude-agent-acp: 0.19.2
  • @agentclientprotocol/sdk: 0.14.1 (both sides)
  • @anthropic-ai/claude-agent-sdk: 0.2.62
  • Claude Code CLI: 2.1.50
  • Node: v24.13.1
  • macOS (arm64)

Problem

Claude ACP sessions never complete a turn. Codex ACP works fine with the same acpx version.

Observed behavior

  1. acpx claude sessions new → session created ✅
  2. acpx claude prompt --session <name> --file -agent needs reconnectstarting detached queue owner[error] RUNTIME: Internal error
  3. Session record shows: agentCapabilities: yes, protocolVersion: 1, but turns: 0, lastAgentDisconnectReason: connection_close
  4. Queue owner process stays alive (heartbeating), but the Claude agent subprocess exits ~3 seconds after start
  5. Claude debug logs show clean startup through ripgrep test — no errors logged
  6. Direct claude --print works fine (auth is good)
  7. Tested 13 sessions across multiple attempts — all show same pattern

Timeline from session record

  • agentStartedAt: T+0s
  • lastPromptAt: T+0.5s
  • lastAgentExitAt: T+2.6s
  • lastAgentExitCode: null
  • lastAgentExitSignal: null
  • lastAgentDisconnectReason: connection_close

Comparison with Codex (working)

  • Codex sessions: 3/3 completed, 2 turns each
  • Claude sessions: 13/13 failed, 0 turns each
  • Both use @agentclientprotocol/sdk@0.14.1
  • Both have agentCapabilities set (init handshake works)

Config

permissionMode: approve-all
nonInteractivePermissions: deny
authPolicy: skip

Likely cause

Something in the lifecycle between queue owner starting the claude agent subprocess and delivering the first prompt. The agent connects, exchanges capabilities, but then disconnects before any turn completes. The newSession or prompt RPC may not be reaching the agent correctly.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions