handleStreamClosed drives what happens after one round's stream finishes: dispatch the next pending tool call, or, if none, finalize the turn and hand control back. A turn ends precisely when the assistant emits no tool calls; there is no loop tool to land on.
()
source not stored for this graph (policy: none)