Skip to content
CantelopBeta

SSE and WebSocket

Cantelop supports server-sent events (SSE) and WebSocket for streaming Session output, including text deltas, progress, and completion events. Both work in production and with cantelop dev. Your Edge API authorizes subscribers.

  • SSE: the default transport. Browser EventSource automatically reconnects and requests replay after the last received event.
  • WebSocket: an output-only event stream using the cantelop.events.v1 subprotocol. Send prompts, steering, and cancellation through HTTP message routes; client messages over the socket are not supported.

Both include Session and message IDs plus stream positions for resuming.

Limitations#

  • Replay is bounded and in-memory. Cursors can expire and streams can reset; clients must recover from gaps. There is no durable event history.
  • Events must be JSON-compatible and at most 64 KiB. The handler or managed activity must remain running while publishing.
  • Disconnecting does not cancel the agent, and subscriptions do not keep a Sandbox warm.

See the SDK streaming guide for implementation, reconnection, and replay details, or the example clients.