Skip to main content

Module runtime

Module runtime 

Source
Expand description

Agent runtime — run agents as managed, isolatable units (provision/start/stop/health). Agent runtime — a place to run agents as managed, isolatable units.

The AgentRuntime port is a platform capability: it provisions, starts, stops, health-checks, and serves back the output of agent instances, independently of how each agent serves requests once running (AgentServer is that per-agent leaf). This is the keystone of Pillar 3 — a future control-plane and the Terraform provider drive a real backend through this port instead of a single in-process fan-out.

Per the hexagonal rules this lives in the platform layer (never in the pure a2a-rs protocol crate): a capability port plus a first-class adapter. LocalProcessRuntime supervises agents as child a2a run OS processes (dev/test, no Docker); a ContainerRuntime (Docker/Podman) and the control-plane service are later drop-ins behind the same port — which is why every method returns Result even though the local adapter rarely fails.

Identity is shared with the registry: a runtime instance and its registry entry use the same AgentId, so the two compose at the control-plane edge.

A runtime also answers whether it outlives the supervisor (AgentRuntime::recover → Recovered). That is what separates a backend a control plane can be restarted over — containers, whose engine keeps the record — from one whose state dies with the process.

Structs§

AgentSpec
What to run and how to reach it — the unit of deployment a runtime manages.
ContainerHardening
What ContainerRuntime asks the engine to enforce on each agent.
ContainerRuntime
An AgentRuntime that runs each agent in its own container via a docker/podman CLI (shelled out through tokio::process, so no Docker API dependency — the engine binary is the only requirement).
EnvAllowlist
The environment variables a deployed agent config is permitted to reference via ${VAR} — least privilege over the deploying process’s secrets.
InMemoryAgentRuntime
An AgentRuntime that tracks lifecycle state in a map without spawning any processes.
LocalProcessRuntime
An AgentRuntime that runs each agent as a child a2a run --config <path> OS process.
RuntimeStatus
A managed agent’s id, current RuntimeHealth, and endpoint.

Enums§

Recovered
The outcome of asking a backend what it is already running (AgentRuntime::recover, ControlPlane::recover).
RuntimeError
Errors a runtime operation can return.
RuntimeHealth
Liveness of a managed agent instance.

Traits§

AgentRuntime
The capability the platform needs to run agents: provision, start, stop, health-check, and list managed instances. One trait per capability (hex rule 2); implemented by LocalProcessRuntime today, a container or control-plane adapter later.