agent-substrate / agent-substrate/substrate

Feature: Add an Exec channel to run commands inside a running actor (E2B-style sandbox exec)

未关闭
#185 5 条评论 2 个 reaction 已指派 0 人 在 GitHub 查看
area/api area/api-machinery area/cli kind/feature
主要语言
Go
星标
1.8k
派生
316
平均合并
2 天 43 分钟
30 天内合并 PR
287

描述

**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.

贡献指南

打开贡献指南

评估

这个 Issue 还没有评估数据。

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。