replay_session

Function replay_session 

pub async fn replay_session(
    config: SessionConfig,
    builder: LiveSessionBuilder,
    entries: &[WireEntry],
) -> Result<ReplaySession, AgentError>
Expand description

Replay a recorded wire log through the real L1 processor, offline.

  • config is used to open the replay transport (its re-encoded setup message becomes the first outbound frame, mirroring the original run). Use the same configuration as the recorded session for a faithful setup comparison. No network is touched and no credential is used.
  • builder supplies the control plane: dispatcher, phases, extractors, watchers, state, callbacks. Attach the original tool implementations to re-execute tools deterministically; without a dispatcher, recorded tool calls surface as events but produce no responses.
  • entries is the recorded log; only its inbound frames are replayed (outbound entries are kept in the log purely for comparison/audit).

Frames are delivered as fast as the session loop consumes them (no original-timing pacing). The replay is gated: nothing past the setup handshake flows until ReplaySession::release is called, so subscribe to events first.