Skip to main content

stream_execution

Function stream_execution 

Source
pub async fn stream_execution(
    platform: Arc<dyn Platform>,
    reply_ctx: ReplyCtx,
    rx: Receiver<AgentEvent>,
    prior: Option<Box<StreamState>>,
) -> RunOutcome
Expand description

Consume rx until a terminal AgentEvent or a pause, rendering into platform as it goes. Dispatches to the streaming edit-in-place mode when platform.capabilities().edit_message, else the legacy per-message mode (issue #452’s original behavior, preserved verbatim for adapters that can’t edit).

prior is the state a previous stream_execution call returned inside RunOutcome::Paused when the SAME logical run paused on a question and is now resuming after the answer — pass it back so the resumed run keeps editing the same status message. Pass None for a fresh run.