(
state: StreamAccumulatorState,
assistant: {
session_id: string
parent_tool_use_id: string | null
message: { id: string }
},
)
| 208 | * signal that fires even when abort/interrupt/error skip SSE stop events. |
| 209 | */ |
| 210 | export function clearStreamAccumulatorForMessage( |
| 211 | state: StreamAccumulatorState, |
| 212 | assistant: { |
| 213 | session_id: string |
| 214 | parent_tool_use_id: string | null |
| 215 | message: { id: string } |
| 216 | }, |
| 217 | ): void { |
| 218 | state.byMessage.delete(assistant.message.id) |
| 219 | const scope = scopeKey(assistant) |
| 220 | if (state.scopeToMessage.get(scope) === assistant.message.id) { |
| 221 | state.scopeToMessage.delete(scope) |
| 222 | } |
| 223 | } |
| 224 | |
| 225 | type RequestResult = { ok: true } | { ok: false; retryAfterMs?: number } |
| 226 |
no test coverage detected