Skip to content

instance-mcp: sandbox_* tool family — backend-agnostic sandboxes (OrbStack first, Lambda MicroVMs later) #1547

Closed

Description

@chaodu-obk

Moved to openabdev/openab-computer#1 now that the repo is writable — the new issue merges this design plus the k3s driver comment. Closing this one in favor of the new location.

Activity

  1. github-actions commented on Sep 24, 2026

    @github-actions

    Thanks for the report! A maintainer will triage this shortly and apply the appropriate label. Once a type label is added, the issue will be re-validated automatically.

  2. chaodu-obk commented on Sep 24, 2026

    @chaodu-obk
    ContributorAuthor

    Additional driver candidate: k3s (Raspberry Pi / Intel mini PC / mixed cluster)

    Follow-up from the Discord discussion: if the host is a Raspberry Pi or an Intel mini PC instead of a Mac mini, the same sandbox_* schema maps onto a k3s cluster — arguably the cleanest driver of all, since the semantics correspond 1:1 to Kubernetes primitives:

    Tool k3s implementation
    sandbox_create Create a Pod (sleep infinity); ttl_secs → activeDeadlineSeconds
    sandbox_exec pods/exec subresource (the streaming WebSocket/SPDY API behind kubectl exec)
    sandbox_exec_start / poll nohup + tee to files inside the pod; poll reads byte offsets via exec (same job contract as instance-mcp)
    sandbox_list List pods by label selector
    sandbox_terminate Delete pod

    Per-sandbox resource quotas (CPU/RAM limits), multi-node scheduling, and node-failure rescheduling come for free from Kubernetes.

    Notes

    • Rewrite scope is small. The Mac-specific half of instance-mcp (ScreenCaptureKit / CGEvent / TCC) does not apply on Linux. The k3s gateway is just "MCP server + kube client" — a few hundred lines in Go (client-go) or Python (kubernetes client). The MCP tool schema and acceptance tests from this issue carry over unchanged.
    • The gateway does not need to run on the cluster node. The kube API is already remote; the gateway only needs a kubeconfig and can run anywhere on the tailnet (including next to the Fargate-hosted agent). This is more decoupled than the OrbStack driver, which must run on the Mac itself.
    • Single node: k3s server costs ~0.5–1 GB RAM on a Pi. For a permanently-single-node setup a plain docker driver is lighter, but k3s pays off the moment a second node is added (k3s agent join; sandboxes schedule across nodes with zero gateway changes).
    • Multi-arch: Pi = arm64, Intel mini PC = amd64. Toolchain images must be built multi-arch (docker buildx) or pods will fail to start on mismatched nodes.
    • Isolation is shared-kernel containers, same tier as the OrbStack driver. If a stronger boundary is needed later, k3s can swap the runtime to kata-containers without changing the driver interface.

    Updated driver matrix

    sandbox_* schema (stable)
     ├─ orbstack driver  → Mac mini (existing hardware, Phase 1)
     ├─ k3s driver       → Pi / mini PC / mixed cluster (self-hosted scale-out)
     └─ microvm driver   → AWS Lambda MicroVMs (strong isolation + per-second billing)
    
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions