Reconnect to an active SSE stream for a task. If a stream is currently in progress (or recently finished), replays all buffered events and then subscribes to live events until the stream ends. Returns 204 if no active stream exists for this task.
Uses Redis Streams for replay (XRANGE) and live following (XREAD BLOCK). This is race-condition-free: XRANGE returns all events up to now, then XREAD picks up exactly where XRANGE left off using the last event ID. Keepalive events are sent every 15s during live following to prevent proxy/client disconnects.
after: optional Redis Stream id (as returned in
TaskMessageResponse.last_event_id). If present, only events
strictly after this id are replayed — this lets a reconnecting
client combine a DB snapshot with a live delta without duplicating
content already persisted. If the cursor has fallen off the buffer
the response contains a single {type: "resync_required"} SSE event
and the client should refetch /messages as the source of truth.
Documentation Index
Fetch the complete documentation index at: https://docs.codecobra.ai/llms.txt
Use this file to discover all available pages before exploring further.