Skip to content

Mock agent process crashes on session creation (ECONNRESET) #281

Description

@marcus-sa

Environment

  • SDK version: sandbox-agent@0.4.0
  • Platform: macOS (Darwin 25.1.0, arm64)
  • Runtime: Bun 1.3.8 and Node.js 25.2.1
  • Agent: mock (installed via sandbox-agent install-agent mock)

Symptoms

Creating a session with agent: "mock" causes the mock agent process to crash immediately after the ACP connection is established. The SDK receives an ECONNRESET / "other side closed" error.

The claude agent works perfectly with the same setup.

Reproduction

import { SandboxAgent } from "sandbox-agent";
import { local } from "sandbox-agent/local";

const sdk = await SandboxAgent.start({ sandbox: local() });
console.log("Started:", sdk.sandboxId);

// This hangs then errors with ECONNRESET
const session = await sdk.createSession({ agent: "mock", cwd: "/" });

Error output:

ACP write error: error: The socket connection was closed unexpectedly.
  path: "http://127.0.0.1:<port>/v1/acp/sdk-mock-<uuid>?agent=mock",
  code: "ECONNRESET"

Same error occurs with both Bun and Node.js, confirming it's not runtime-specific.

Expected behavior

createSession({ agent: "mock" }) should return a session handle that responds to prompts with mock data, as documented in the quickstart.

What works

  • SandboxAgent.start() succeeds
  • sdk.listAgents() shows mock as installed with all capabilities
  • sdk.getHealth() returns { status: "ok" }
  • createSession({ agent: "claude" }) works perfectly
  • session.prompt(...) works with claude agent

Impact

The mock agent is intended for SDK/integration testing without provider credentials. Without it, tests must use the claude agent with real API keys.

Metadata

Metadata

Assignees

No one assigned

    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