Skip to content

Mock agent process crashes immediately on ACP connection (v0.4.0) #280

Description

@marcus-sa

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

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Fields

No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions