Agent Sandbox Registry

python-sdk

Decision: CLI template profile, server stays provider-free

无中文版

.agents/notes/proposed/architecture/2026-10-12-template-provider-profile.md

Decision: CLI template profile, server stays provider-free

Status: proposed

Problem

Template generation taught one Dockerfile (CMD ["python3", "commands.py"], WORKDIR /app, an unconstrained FROM) while the Alibaba Cloud Express base image forbids CMD / ENTRYPOINT and uses platform start_cmd / ready_cmd. Those facts were starting to live on agent_sandbox.server and on official_base_image(), so every provider inherited the FC image.

Decision

The HTTP server is not a provider. Port 9000 stays the server listen default. commands.py imports only agent_sandbox.server and calls serve(port=9000) under if __name__ == "__main__".

The image contract is a CLI template profile: base_image, entrypoint_replaceable, server_start (image_cmd | platform_start_cmd), cmd, start_cmd, ready_cmd, arch, workdir, reserved_ports, and a registry note. alicloud-express is the built-in FC profile (no CMD / ENTRYPOINT, workdir /home/user/app, reserved ports 49983 / 5000 / 49999). Every other provider uses the generic profile (FROM python:3.12-slim, CMD ["python3", "commands.py"], WORKDIR /app) unless abx-provider.toml has a [template] table. A missing profile is announced and never falls through to the FC image. OpenSandbox keeps the generic profile; its create entrypoint is unchanged in this pass.

abx resolves the provider the same way as the rest of the CLI (--provider / ABX_PROVIDER / default alicloud-express). The guide, the codegen prompt, and scaffolds describe that one profile. The client SDK does not select a provider. official_base_image() stays a pure string helper and the generator does not call it with no arguments. server.contract still holds the FC port constants, marked as the alicloud-express profile rather than the HTTP API.

API Design

Plugin manifest table [template] with the fields above. No new server or client API.

Alternatives considered

Dependencies

CLI provider resolution (resolveProviderId). Server package agent-sandbox-server in the scaffold install snippet.

Test Strategy

Profile selection (default, explicit provider with no profile, unknown id, declared [template]), guide text (FC FROM and no CMD instruction versus generic CMD), and scaffold Dockerfiles.

Acceptance criteria