---
slug: "durable-streaming"
name: "Durable Streaming"
packType: "harness"
canonicalPattern: "hybrid"
version: "0.1.0"
trust: "Verified"
publisher: "Agent Workspace"
updatedAt: "2026-04-15"
---

# Durable Streaming

> Stream plan and execution state through stored events, not transient sockets alone.

## Summary

A transport and persistence pattern for agents that need progressive rendering, reconnect safety, and post-run replay without losing the benefits of token or step streaming.

## Install

```sh
npx attrition-sh pack install durable-streaming
```

### Claude Code / AGENTS.md snippet

```md
# Durable Streaming
# See: /packs/durable-streaming

```

## Contract

_No execution contract defined for this pack type._

## Layers

_No three-layer split defined for this pack type._

## Use When

- The app needs live progress plus later replay or audit.
- Users may reconnect mid-run or review the run after completion.
- You want plan, steps, and final answer to stream through one event system.

## Avoid When

- A simple transient text stream is enough and replay is unnecessary.
- The app has no need to surface intermediate state to the user.

## Key Outcomes

- Streaming survives beyond one network response.
- The same event log powers UX, audit, and evaluation playback.
- Step state is visible before the final answer completes.

## Minimal Instructions

Persist streaming as ordered events.

Emit events such as:
- run.started
- plan.created
- step.started
- step.completed
- text.delta
- quality.checked
- run.completed

Render the UI from stored events, not just an in-flight response.

## Full Instructions

Implement streaming as a durable event log.

When a run starts:
1. create a draft assistant message
2. append ordered events for plan, steps, deltas, and completion
3. update the message as text accumulates
4. finalize the answer packet at completion

The UI should subscribe to event state and progressively render:
- draft answer text
- planned steps
- executed steps
- source additions
- quality checks

Prefer durability over pure SSE when operator review matters.

## Evaluation Checklist

- Can the UI recover mid-run if the page reconnects?
- Are plan and step states visible before the final answer completes?
- Does the final packet reconcile cleanly with the streamed events?

## Failure Modes

- **[MID] The app shows a spinner until completion and hides real state changes.**
  - Trigger: (legacy — trigger not separated)
  - Prevention: (legacy — no explicit prevention)
- **[MID] Streaming works only during the request and cannot be replayed later.**
  - Trigger: (legacy — trigger not separated)
  - Prevention: (legacy — no explicit prevention)
- **[MID] The final answer and event stream diverge because there is no final reconciliation step.**
  - Trigger: (legacy — trigger not separated)
  - Prevention: (legacy — no explicit prevention)

## Transfer Matrix

_No measured cross-model transfer data._

## Telemetry

_No telemetry recorded._

## Security Review

_No security review on file._

## Compares With

_No comparative data._

## Related Packs

_No related packs._

## Changelog

_No changelog entries._

## Sources

- [Persistent Text Streaming component](https://github.com/get-convex/persistent-text-streaming) — Reference implementation for durable streaming with Convex.
- [Convex AI platform overview](https://www.convex.dev/ai) — Shows persistent text streaming as a first-class AI building block.

## Examples

- [Open shared studio](/chat)
