Expand description
The harness-integration seam: the AgentHarness / AgentSession traits.
The harness-integration seam: the AgentHarness trait an integrator implements and the
live AgentSession it produces.
This is the SDK’s published extension seam, mirroring aion-client’s WorkflowTransport
(a dedicated #[async_trait] contract module). It is harness-blind by construction: no
signature names a concrete harness, a transport, or a wire protocol. A harness is integrated
by implementing these traits in a separate adapter crate; the seam speaks only neutral run
identity, the neutral ActivityEvent / InterventionCommand types, the neutral
InterventionCapabilities advertisement, and a neutral terminal Payload.
§Designed from two cases so it is provably general
The seam is designed against two deliberately different integrations at once, so it cannot be shaped by any one harness:
- a full rich-path harness (a bidirectional channel, streamed events out, acknowledged commands in, a structured terminal result), and
- a plain-stdout, observability-only CLI agent (no command channel at all): it demuxes
interleaved stdout into
ActivityEvents (mostlyaion_core::ActivityEventKind::Raw), advertises an emptyInterventionCapabilitiesset, and yields its final output as the result.
The empty-capability case is what forces AgentSession::intervene to be
optional-by-capability: an empty advertisement is a valid, first-class tier, and a session
that advertises it rejects every command with HarnessError::CapabilityNotSupported.
Traits§
- Agent
Harness - How to run one agent harness — the SDK’s published extension seam.
- Agent
Session - A live agent run for one activity attempt.
- DynAgent
Harness - An object-safe erased
AgentHarness, so a worker can HOLD a harness behind aArc<dyn DynAgentHarness>(the typedAgentHarnessis not object-safe — it has an associatedSessiontype). - DynAgent
Session - An object-safe erased
AgentSession, so a worker can drive a session behind aBox<dyn ..>without being generic over the concrete harness.