From 8aea03b1aef02cf26c4cb65b362aa1ffee5cc361 Mon Sep 17 00:00:00 2001 From: hugocasa Date: Mon, 14 Sep 2026 09:48:02 +0200 Subject: [PATCH] docs: condense the stream-classification invariant Co-Authored-By: Claude Opus 5 (1M context) --- frontend/src/lib/components/chat/utils.ts | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/frontend/src/lib/components/chat/utils.ts b/frontend/src/lib/components/chat/utils.ts index 70c978213d..b903e26c39 100644 --- a/frontend/src/lib/components/chat/utils.ts +++ b/frontend/src/lib/components/chat/utils.ts @@ -14,12 +14,10 @@ export type StreamEvent = | { kind: 'tool_result'; callId: string; name: string; result: string; success: boolean } /** - * The `type` values the switch below reads, for callers that must recognise the - * protocol before an event can be read from it: a `token_delta` carrying nothing - * is dropped by the parser and is still proof the stream is an agent's. - * - * Add a name here whenever the switch gains a case, or a stream opening with the - * new event is taken for something else entirely. + * The `type` values the switch below reads. Classifying a stream needs these + * rather than the parser, which yields nothing for an event carrying nothing — + * an opening `token_delta` with no content is still proof of an agent. A case + * added below needs its name here, or a stream opening with it is misread. */ export const STREAM_EVENT_TYPES = [ 'token_delta',