Expand description
Spawn an autonomous A2A agent runtime with auto peer discovery.
Stands up an A2AServer (Axum) on a configurable host:port, publishes an
agent card at /.well-known/agent.json, and runs a background discovery
loop that polls each --peer seed for its agent card. New peers are
registered in the local bus and (unless --no-auto-introduce is set) sent
a one-shot non-blocking message/send introduction.
Each spawned process is a self-contained A2A node: there is no central
broker. Two codetether spawn instances pointing at each other form the
minimal mesh; n instances form a fully-connected mesh as long as the
seed graph is connected.
§Lifecycle
- Resolve identity (
--name, bind addr, public URL). - Build the default
AgentCardand let--descriptionoverride the default text. - Initialize
AgentBus, start the best-effort training-record S3 sink, register self in the registry, and announce-ready with the card’s skill ids as capabilities. - Spawn [
discovery_loop] for--peerseeds. - Bind the
A2AServer::routerand serve until SIGINT. - On shutdown: abort discovery and exit cleanly.
§Discovery
Every discovery_interval_secs (clamped to ≥ 5):
- For each seed, build candidates via [
peer_candidates] (triesseedandseed/a2aunless the seed already ends in/a2a). - First successful agent-card fetch wins; the card is registered in
bus.registry. - On first sighting of a given
endpoint::card.namepair: emitDiscovered A2A peerand (ifauto_introduce) call [send_intro] over the A2A client. - Re-sightings re-register the card (refresh) but do not re-introduce.
Outbound discovery and intro calls attach CODETETHER_AUTH_TOKEN as a
bearer if set.
§See also
Full prose documentation lives at docs/a2a-spawn.md (CLI reference,
HTTP/JSON-RPC API, curl recipes, cross-host setup, troubleshooting,
source map).
Structs§
- A2APeer
Handle - Handle to A2A peer background tasks (server + discovery loop + mDNS).
- Spawn
Options - Inputs for starting an A2A peer runtime.
Functions§
- auto_
agent_ name - Auto-derive a stable, human-readable agent name from
<short-host>-<repo-basename>-<short-pid>. Falls back gracefully if any component is unavailable. - run
- Run the
codetether spawncommand. Owns its own bus and S3 sink, blocks on ctrl_c with graceful shutdown. - start_
a2a_ in_ background - Start an A2A peer runtime in the background, attached to the given bus.