Cancel an in-flight chat stream. (Auth policies: ApiKeyOrJwt)
User-initiated cancellation for the active POST /api/chat/completions stream.
Returns 202 Accepted whether or not a stream was actually found — the request is
idempotent and the client doesn’t need to know if it lost a race with stream
completion. Wave 7 of chat-agent-fault-ux.
Used by the frontend’s Stop button. Closing the SSE connection alone is not enough
because the resulting OperationCanceledException is indistinguishable from
a network drop or a Cloud Run preemption — the failure classifier would conservatively
emit halt_ambient_cancellation (warning amber) instead of user_cancelled
(neutral grey). With this endpoint the registry sets a flag the classifier reads,
so the two cases stay distinct in metrics and in the chat UI.
Authorization: tenant + author ownership in one call (same as
ConversationController.GetRun) — throws ForbiddenException on mismatch
before signalling, so a user can never cancel another user’s stream even by
guessing a valid id pair.