ClouisleClouisle

SSE Streaming Events

Parse Server-Sent Events from Agent chat and workflow runs

Clouisle's streaming interfaces return Content-Type: text/event-stream. Clients should read each event: and data: line, handle unknown events, and release resources on error or connection close.

Agent Events

EventDescription
message_startReturns conversation_id and message_id
rag_start / rag_contextStarts retrieval and returns sources
reasoning_start / reasoning_delta / reasoning_endReasoning (if the model supports it and it is not hidden)
content_deltaText delta
tool_call / tool_resultTool name, arguments, and result
media_resultImage/video display payload
compression_start / compression_endContext compression details
output_truncatedReached the maximum output Token
iteration_cap_reachedReached the Agent's tool iteration cap
message_endToken usage, elapsed time, and termination status
errorError details

Workflow Events

Workflow streams contain status events for run start, node start/output/skipped, run complete, failure, cancel, and timeout. Use the stream_url from the initial Webhook response to subscribe; use from_sequence to resume reading.

Client Strategy

  • Concatenate content_delta in order; do not overwrite earlier fragments.
  • Store reasoning separately from text; do not render hidden content where display is not allowed.
  • Treat message_end as normal termination and error as failed termination.
  • Configure heartbeats and reconnection for long connections; after reconnecting, use the conversation/run ID instead of creating new resources.

How is this guide?

On this page