Skip to main content

Module streaming

Module streaming 

Source
Expand description

§Module: Streaming

§Responsibility

Emits agent reasoning events (thought, action, observation, result, error) as Server-Sent Events (SSE) over a tokio::sync::broadcast channel so that multiple HTTP clients can subscribe to a single agent run in real time.

§Design

§Guarantees

  • Non-panicking: all operations return Result
  • No unwrap / expect / panic in production paths
  • Thread-safe: StreamBroadcaster and AgentEventStream are Clone, Send, and Sync

§NOT Responsible For

  • HTTP transport (callers wire the Receiver output into their own HTTP layer — axum, actix-web, hyper, etc.)
  • Persistence of streamed events

Structs§

AgentEventStream
High-level typed event stream for a single agent run.
StreamBroadcaster
A broadcast publisher for raw SSE strings.

Enums§

AgentEvent
A single event emitted by a running agent.