agent-substrate / agent-substrate/substrate
Feature: Add an Exec channel to run commands inside a running actor (E2B-style sandbox exec)
- Linguagem predominante
- Go
- Estrelas
- 1.8k
- Forks
- 316
- Merge médio
- 2d 43min
- PRs com merge (30d)
- 287
Descrição
**Summary**
Add a first-class streaming Exec RPC that lets a client run an arbitrary command inside a running actor's gVisor sandbox, with bidirectional stdin / stdout / stderr, exit code, optional TTY, and window resize — analogous to
kubectl exec for Pods, or to E2B's Sandbox.commands.run / Sandbox.pty.create APIs for sandboxed code-execution platforms.
This is a management-plane channel, separate from the L7 actor traffic that atenet routes. It does not change the Actor lifecycle and is purely additive.
**Motivation**
Substrate is positioned as the runtime for agentic / sandboxed code-execution workloads (see README.md:199 "Sandbox Demo" and docs/api-guide.md:168 LangChain section). For that class of workload, "run a command in the
sandbox and stream the result back" is the single most fundamental primitive — it's what platforms like E2B, Modal sandboxes, and Daytona expose to end users. Today Substrate has no equivalent:
- pkg/proto/ateapipb/ateapi.proto — Control service exposes Create / Suspend / Resume / Delete / Get / List only.
- internal/proto/ateletpb/atelet.proto — AteomHerder exposes Run / Checkpoint / Restore only, all unary, Streams: [] confirmed in the generated atelet_grpc.pb.go:221.
- internal/proto/ateompb/ateom.proto — Ateom mirrors the same three unary RPCs.
- cmd/ateom-gvisor/runsc.go wraps runsc create / start / wait / kill / checkpoint / restore — runsc exec is not wrapped, even though it exists upstream.
- cmd/kubectl-ate/internal/cmd/ has create / get / delete / suspend / resume / logs / admin — no exec. logs_actors.go:73 falls back to kubelet Pods().GetLogs(...), i.e. log streaming is delegated to Kubernetes today.
Concretely this blocks the following use cases:
1. Agent tool calls that exec untrusted code (the canonical E2B use case). Today an agent has to embed an HTTP/RPC server in its image and let atenet route to it — every template author re-implements the same exec-server
boilerplate.
2. Interactive debugging of a stuck actor. SREs currently have to kubectl exec into the privileged atelet DaemonSet pod (which mounts the host's /run/ateom-gvisor) and hand-craft a runsc -root
/run/ateom-gvisor/actors/::/runsc-state exec ... invocation. This works but bypasses the control plane entirely (no audit, no lock against concurrent suspend/checkpoint, RBAC granularity = "all actors on the
cluster").
3. One-shot setup commands for templates (npm install, db migrate, …) without baking them into the container image or the workload entrypoint.
Guia de contribuição
Avaliação
Esta issue ainda não foi avaliada.