SseHooks
Defined in: core/src/transport.ts:35
Properties
Section titled “Properties”finished?
Section titled “finished?”optional finished?: () => boolean;Defined in: core/src/transport.ts:53
Whether the turn already stated its finish, so only trailing frames (the
usage record, [DONE]) are left. Once this says true, a read that fails
ends the stream instead of throwing. Kimi, GLM and OpenCode Go drop the
socket there, and the failure threw away an answer the reader had already
been shown (cc-proxy, measured on live traffic). The usage may be lost;
the answer is not.
Returns
Section titled “Returns”boolean
maxFrameChars?
Section titled “maxFrameChars?”optional maxFrameChars?: number;Defined in: core/src/transport.ts:58
Largest partial frame held before giving up. Defaults to 8 MiB.
onActivity?
Section titled “onActivity?”optional onActivity?: () => void;Defined in: core/src/transport.ts:38
Every read of the body, keep-alives and partial frames included: the stream is alive even when no event is complete yet.
Returns
Section titled “Returns”void
onDone?
Section titled “onDone?”optional onDone?: () => void;Defined in: core/src/transport.ts:44
The body said [DONE]. The payload itself is swallowed, but its arrival is
the OpenAI dialect’s only proof that a stream which stated no finish reason
was not simply cut off.
Returns
Section titled “Returns”void
provider?
Section titled “provider?”optional provider?: string;Defined in: core/src/transport.ts:60
Names the provider on the oversized-frame error.
signal?
Section titled “signal?”optional signal?: AbortSignal;Defined in: core/src/transport.ts:56
The request’s signal. A caller’s Stop is never swallowed, finished or not: a loop that sees a clean end goes on to run the turn’s tools.