Endpoint
POST /api/chat/stream- response content-type:
text/event-stream - frames are emitted as
data: {json}\n\n
Event Types
metastatuscleartokendone(terminal success)error(terminal failure)
Minimal Event Examples
Ordering Contract
Typical order:metastatus(searching)- branch-dependent
status/clear/token - terminal
doneor terminalerror
- stream should end with exactly one terminal event
- no further events are expected after terminal
Frontend Contract Notes
Clients should:- ignore unknown event types safely
- treat
suggested_sourcesas discovery actions (not citations) - use
message_idfromdonefor feedback binding - treat
model_nameandprovideras optional metadata (present when an LLM path executed) - when
provenance_notecontains a degraded-service warning (e.g., “reranker temporarily unavailable”), surface it to the user but do not treat the response as failed - the answer is still usable, just lower confidence