Skip to content

feat/claude sdk abstraction#51

Merged
motatoes merged 4 commits intomainfrom
feat/claude-sdk-abstraction
Mar 10, 2026
Merged

feat/claude sdk abstraction#51
motatoes merged 4 commits intomainfrom
feat/claude-sdk-abstraction

Conversation

@motatoes
Copy link
Contributor

@motatoes motatoes commented Mar 9, 2026

  • Replace /commands with session-based exec API
  • fix: VM network connectivity + exec SDK improvements
  • add claude agent sdk

motatoes and others added 3 commits March 7, 2026 00:38
Replace the fire-and-forget POST /commands endpoint with persistent,
reconnectable exec sessions. Sessions keep running independently of
client connections and support scrollback replay on reconnect.

Key changes:
- New gRPC RPCs: ExecSessionCreate, ExecSessionAttach (bidi stream),
  ExecSessionList, ExecSessionKill in both agent and worker protos
- ScrollbackBuffer: 1MB ring buffer with fan-out to subscribers
- Agent-side session manager with process group kill, env layering,
  disconnect timers, and 5-min exited session retention
- Host-side ExecSessionManager mirroring PTYManager pattern
- HTTP/WebSocket handlers with binary protocol (stream ID byte prefix)
- WebSocket auth: support token as query param for WS connections
- TypeScript SDK: Exec class with start/attach/run/list/kill
- Python SDK: Exec class with run/start/list/kill via WebSocket
- CLI: session-based exec with list/attach/kill subcommands
- Deploy fixes: use vmlinux-docker-5.10 kernel (vsock support),
  load vhost_vsock module, advertise public IP, open port 8081

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Add iptables FORWARD rules for 172.16.0.0/16 (Docker sets FORWARD
  policy to DROP, blocking VM outbound traffic)
- Add ExecSession.done promise for awaiting process exit
- Add WebSocket onclose/onerror handlers to prevent run() hanging
- Default run() timeout to 60s (matching Python SDK)
- Fix agent pipe drain race: WaitGroup ensures stdout/stderr readers
  finish before signaling exit
- Strip hardcoded IPs from example scripts

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@vercel
Copy link

vercel bot commented Mar 9, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
opensandbox Ready Ready Preview, Comment Mar 10, 2026 6:26am

Request Review

@motatoes motatoes marked this pull request as ready for review March 9, 2026 18:38
Copy link
Contributor

@breardon2011 breardon2011 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approve - one note

return c.JSON(http.StatusServiceUnavailable, errSandboxNotAvailable)
}

sessionID := c.Param("sid")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We never check if the session belongs to the sandbox.

Similarly in internal/worker/handlers.go (different binary)

Session endpoints looked up sessions by ID only without checking ownership,
allowing cross-sandbox session access if session IDs were known.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@motatoes motatoes merged commit e5abe64 into main Mar 10, 2026
4 checks passed
@github-actions
Copy link

Preview Environment Destroyed

The preview environment dev-pr-51 has been torn down.
All AWS resources for this environment have been cleaned up.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants