Turn Reattach Stream
Re-attach to a turn that is already running (TOS-2090).
POST /messages/stream hands the reply to exactly one caller: the SSE stream IS that request's response body. Anyone who does not hold it - a pane React remounted when focus mode moved it, a reloaded page, a second tab, a second device - had no way to watch a turn in progress and saw the reply only once it finished and the assistant message landed.
This endpoint closes that gap by reading chat_stream_progress, which the running turn updates on a coalesced flush. It emits:
- snapshot - the accumulated text so far, so a late joiner catches up in one frame rather than starting from blank;
- progress - whenever any agent's seq advances or the visible agent row set changes. The payload carries the FULL current set rather than a delta, so a dropped or duplicated frame cannot desynchronise the bubbles;
- idle - the turn is over (or there was never one). The client closes and reconciles from /messages, where the outcome now lives.
Polling Postgres rather than subscribing in-process is deliberate: awen-api runs several Cloud Run pods and the re-attaching client rarely lands on the pod running the turn.
Request
- Base URL: https://app.thinqos.com (the document declares no server; this is the origin it was published from)
- URL: https://app.thinqos.com/api/chats/{chat_id}/turn-stream
- Auth: none declared
Path parameters
Headers
Response
Successful Response
Changes
No recorded changes to this operation across all 1 revision of this API.