You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
feat(sandboxes): plumb sandbox.ttlMs to E2B's external timer
E2B sandboxes have their own service-enforced idle timer (default 300s =
5 min). Without bumping it, any warm-sandbox ttlMs > 300s gets the
substrate killed externally before our reaper sees it. The flag has been
in E2BSubstrateOptions since runtime-e2b was built; the example server
just wasn't forwarding it.
Extend the substrate factory signature from () => Substrate to
((opts?: { timeoutMs?: number }) => Substrate). Non-e2b substrates
(bwrap, local) ignore the arg. The e2b registration in main() forwards
opts.timeoutMs into E2BSubstrateOptions when present.
All three sandbox construction sites — POST /sandboxes, createRestoredSandbox,
replaceAgentInPlace — now compute substrateTimeoutMs = ttlMs + 30s grace
and pass it to the factory. /run + /tasks pass nothing (default E2B
behavior preserved; out of scope for this fix).
scripts/test-sandboxes.py gains --runtime ∈ {bwrap, local, e2b} so the
suite can be retargeted without code edits.
Live verification on api.clawagent.sh (E2B Firecracker, real substrate):
e2b × claude-agent-sdk: 12/12 (cold 32.9s → warm 3.1s — 10× speedup)
e2b × gitagent: 12/12 (cold 28.3s → warm 2.2s)
Warm-pool value prop is dramatic on E2B: every avoided cold-boot saves
~30s of Firecracker spin-up + npm install + harness boot.
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
0 commit comments