Skip to content

mock createSession hangs/times out while claude succeeds on same server (0.2.0) #188

@handfuloflight

Description

@handfuloflight

Summary

mock sessions fail to create (timeout/hang), while claude sessions create successfully on the exact same sandbox-agent server instance.

Environment

  • sandbox-agent server: @sandbox-agent/cli@0.2.0
  • sandbox-agent SDK: sandbox-agent@0.2.0
  • Runtime host: Sprite (alpha)
  • Sprite OS: Linux alpha 6.12.47-fly ... x86_64
  • Node: v22.20.0
  • npm: 11.10.0

Minimal repro (inside the same Sprite)

Start server:

sandbox-agent server --no-token --host 127.0.0.1 --port 8080

Run probe:

import { SandboxAgent } from "sandbox-agent";

const baseUrl = "http://127.0.0.1:8080";
const withTimeout = (p, ms, label) => Promise.race([
  p,
  new Promise((_, rej) => setTimeout(() => rej(new Error(`${label} timeout ${ms}ms`)), ms)),
]);

async function run(agent) {
  const sdk = await SandboxAgent.connect({ baseUrl });
  try {
    const session = await withTimeout(
      sdk.createSession({ id: `repro_${agent}_${Date.now()}`, agent, sessionInit: { cwd: "/", mcpServers: [] } }),
      30000,
      `createSession(${agent})`
    );
    console.log(`[${agent}] createSession ok: ${session.id}`);
  } catch (err) {
    console.log(`[${agent}] createSession error: ${err?.message || err}`);
  } finally {
    await sdk.dispose().catch(() => {});
  }
}

await run("claude");
await run("mock");

Observed output:

[claude] createSession ok: repro_claude_...
[mock] createSession error: createSession(mock) timeout 30000ms

Additional symptom seen from remote URL access

When connecting to the same server through Sprite URL (not loopback), mock also intermittently fails with:

  • 502 stream error: failed writing to agent stdin: Broken pipe (os error 32)
  • followed by createSession timeout

Expected

mock should create promptly and be usable as a control/test agent independent of provider credentials.

Actual

mock createSession hangs/times out, while other agents on same server can create sessions.

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