Skip to content

createCutStreamRetryMiddleware

createCutStreamRetryMiddleware(onCut?): AgentMiddleware<undefined, undefined, unknown, readonly (ClientTool | ServerTool)[], readonly []>

Defined in: packages/core/src/core/cutStreamRetry.ts:151

Build the retry middleware. See the module comment for the argument.

(reason) => void

Records the stream_cut reason on the agent when the retry is cut as well. Called before the throw, so the agent’s first-write-wins record holds it whatever a later site notes.

AgentMiddleware<undefined, undefined, unknown, readonly (ClientTool | ServerTool)[], readonly []>