> For the complete documentation index, see [llms.txt](/llms.txt).
> A full single-fetch corpus is available at [llms-full.txt](/llms-full.txt).
---
title: Streaming output and durability
description: Understand which streaming events AGNT5 persists, what reconnect can replay, and how to design consumers for transient LLM output.
last_verified: 2026-07-10
---

**Streaming output** lets you observe a durable run while it executes. The run remains durable whether you call `run`, `submit`, `stream`, or `batch`, but AGNT5 does not persist every event sent over a live stream. This page defines the durability boundary for Server-Sent Events (SSE), including LLM token output.

## Durability model

AGNT5 classifies events by what they control. Events that determine run state are durable. High-volume display updates are transient.

| Event class | Examples | Persistence |
|---|---|---|
| Lifecycle and checkpoints | `run.started`, `run.completed`, `run.failed`, workflow steps, approvals | Durable |
| Execution boundaries | Model calls, tool calls, agent iterations | Durable and batched |
| Live output | `output.delta`, `lm.stream.delta`, `lm.message.delta`, thinking deltas, progress, logs | Transient |

`output.delta` is transient by design. Persisting every model token would multiply journal writes, replication traffic, indexing work, and storage without making the provider generation resumable.

The terminal event is authoritative. `run.completed` stores the final output, while `run.failed` stores the failure state. A consumer must use the terminal event or result endpoint for the durable outcome rather than rebuilding state from deltas.

<Callout type="info">
AGNT5 does not currently create automatic durable output snapshots. Use workflow checkpoints or durable application events when intermediate state must survive a failure.
</Callout>

## Live delivery guarantees

For one connected stream, AGNT5 sends live output before the terminal event. Treat each delta as a display update rather than a durable command.

- **Ordered while connected**: consume deltas in the order received.
- **Terminal once**: stop consuming when `run.completed`, `run.failed`, or `run.cancelled` arrives.
- **No side effects from deltas**: trigger durable side effects from workflow steps, tool results, or terminal state.
- **Final output wins**: replace any accumulated display text with the terminal output when the run completes.

A client disconnect does not change the durable run into a failed run. The worker can continue and write its terminal result even when no caller is watching the live stream.

## Reconnect behavior

Reconnect to `GET /v1/runs/<run-id>/events` with `Accept: text/event-stream` to receive durable history followed by the live tail. Send `Last-Event-ID` with the last durable event offset to continue after that event.

Transient deltas do not have durable offsets. A reconnect can therefore replay lifecycle and boundary events, but it cannot recover `output.delta` events emitted before the disconnect. After reconnecting:

1. Render the latest durable run state.
2. Consume new live events.
3. Fetch the terminal result when the run completes.
4. Replace partial display output with the authoritative final output.

Do not repeat the original component invocation to reconnect. Starting another invocation creates another durable run.

## LLM failure behavior

Persisted tokens would not let most model providers resume an interrupted generation at the next token. If a provider or worker fails mid-generation, AGNT5 preserves the run state and any durable checkpoints, then applies the configured failure or retry policy.

Design LLM streaming consumers with these expectations:

- Partial text can disappear after a disconnect or failed attempt.
- Reasoning and thinking deltas are transient and should not be used as an audit record.
- Tool results and model-call boundaries remain durable even when token deltas are transient.
- The final output is the only canonical model response for a completed run.

## Next steps

- [Deploying](/docs/run/deploying.md): trigger deployed components and consume their output.
- [Functions](/docs/build/functions.md): define functions that produce streamed output.
- [Workflows](/docs/build/workflows.md): checkpoint durable state independently of live output.
- [Run with AGNT5](/docs/run/overview.md): operate deployments, runs, traces, logs, and metrics.
