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.
Parameters
Section titled “Parameters”toolEventsByMessage
Section titled “toolEventsByMessage”Record<string, ToolEvent[]>
Returns
Section titled “Returns”Record<string, ToolEvent[]>