Skip to content

Function: terminateRunningToolEvents()

terminateRunningToolEvents(toolEventsByMessage): Record<string, ToolEvent[]>

Settle any tool-progress pills still marked running to done. A cancelled or interrupted turn stops delivering the tool-result / tool-error chunks that would otherwise close them, so without this a Genie / chart pill would spin forever after the user hits stop. Returns the same map when nothing was running so callers can skip a needless state update.

Record<string, ToolEvent[]>

Record<string, ToolEvent[]>