Function attach_session
pub async fn attach_session(
builder: LiveSessionBuilder,
session: SessionHandle,
) -> Result<LiveHandle, AgentError>Expand description
Attach the full L1 control plane (three-lane processor, phase machine, extractors, watchers, tool dispatch, …) to an already connected L0 session.
This is the seam that makes replay possible without touching the network:
connect the L0 session over any Transport
(e.g. ReplayTransport or MockTransport), then hand
it here together with a configured LiveSessionBuilder.
Note: the builder’s own SessionConfig is not re-sent — the setup
message was already encoded from the config given to the L0 connect call.
Subscribe to events after this returns and only then let the transport
stream (for ReplayTransport, call
ReplayControl::release),
otherwise early frames race the subscription.