Symptoms
- Happening in local dev (macOS,
SandboxAgent.start({ sandbox: local() }))
- The
mock agent process starts but immediately closes the ACP socket connection
createSession({ agent: "mock", cwd: "/" }) hangs indefinitely, then the SDK reports ECONNRESET / "socket connection was closed unexpectedly"
- Other agents (e.g.
claude) work perfectly with the same setup
Error
ACP write error: error: The socket connection was closed unexpectedly.
path: "http://127.0.0.1:PORT/v1/acp/sdk-mock-UUID?agent=mock",
errno: 0,
code: "ECONNRESET"
Reproduced with both Bun and Node.js (v25.2.1, ESM):
import { SandboxAgent } from "sandbox-agent";
import { local } from "sandbox-agent/local";
const sdk = await SandboxAgent.start({ sandbox: local() });
// Works fine — server starts, health check passes
const session = await sdk.createSession({ agent: "mock", cwd: "/" });
// Hangs, then ECONNRESET
The claude agent works correctly with the exact same code (just changing "mock" to "claude").
What I've tried
sandbox-agent install-agent mock — reports successful install (builtin launcher)
sdk.listAgents() — mock agent shows as installed: true, credentialsAvailable: true
- Tried with
cwd: "/", cwd: "/tmp", and cwd: process.cwd()
- Tried with both
cwd at top level and inside sessionInit: { cwd, mcpServers: [] }
- Confirmed via
sdk.getHealth() that the server is running correctly before session creation
Environment
- Sandbox Agent version: 0.4.0
- SDK: TypeScript (
sandbox-agent@0.4.0)
- Agent: mock
- Sandbox provider: local (
sandbox-agent/local)
- OS: macOS (Darwin 25.1.0, arm64)
- Runtimes tested: Bun 1.3.8, Node.js 25.2.1
Symptoms
SandboxAgent.start({ sandbox: local() }))mockagent process starts but immediately closes the ACP socket connectioncreateSession({ agent: "mock", cwd: "/" })hangs indefinitely, then the SDK reportsECONNRESET/ "socket connection was closed unexpectedly"claude) work perfectly with the same setupError
Reproduced with both Bun and Node.js (v25.2.1, ESM):
The
claudeagent works correctly with the exact same code (just changing"mock"to"claude").What I've tried
sandbox-agent install-agent mock— reports successful install (builtin launcher)sdk.listAgents()— mock agent shows asinstalled: true,credentialsAvailable: truecwd: "/",cwd: "/tmp", andcwd: process.cwd()cwdat top level and insidesessionInit: { cwd, mcpServers: [] }sdk.getHealth()that the server is running correctly before session creationEnvironment
sandbox-agent@0.4.0)sandbox-agent/local)