[1.x] Stream tool input as it arrives
Right now every gateway waits for a tool call's input to finish before emitting ToolCall, even though providers stream it in pieces. With a big input that's a long silence in the UI. On one of our Anthropic turns a 4.7 KB tool input took 11 seconds to arrive, leaving users staring at a plain loader instead of seeing the model work.
This adds ToolInputStart and ToolInputDelta events and emits them from every gateway except Ollama, which sends calls whole. xAI also sends each call in one chunk, so it emits a single delta. Azure gets them through the OpenAI gateway. The Vercel protocol maps them to tool-input-start / tool-input-delta:
data: {"type":"tool-input-start","toolCallId":"toolu_1","toolName":"GetWeather"}
data: {"type":"tool-input-delta","toolCallId":"toolu_1","inputTextDelta":"{\"city\":"}
data: {"type":"tool-input-delta","toolCallId":"toolu_1","inputTextDelta":"\"Lisbon\"}"}
data: {"type":"tool-input-available","toolCallId":"toolu_1","toolName":"GetWeather","input":{"city":"Lisbon"}}
Anthropic holds each parameter back until it is complete unless the tool sets eager_input_streaming, so streamed requests now set it on every function tool (provider tools are left alone). Vercel AI SDK does the same, and its tool-input-* chunks are the shapes above. A proxy behind ANTHROPIC_URL that rejects the field will fail streamed requests with tools; there's no opt-out yet (Vercel has toolStreaming: false).
AG-UI now sends TOOL_CALL_START as soon as the call begins and one TOOL_CALL_ARGS per fragment, instead of all three events at the end. Calls that don't stream look the same as before.
Tools still run at the same point as before, so unlike #1209 this only changes what the client sees.
If a call gets cut off before it completes (say by the token limit), the loop emits a ToolInputError and both protocols report the call as failed rather than leaving it open. Broadcast agents will see one event per fragment, like TextDelta; #[WithoutBroadcasting(ToolInputDelta::class)] opts out.
Raw SSE consumers see three new event types: tool_input_start, tool_input_delta and tool_input_error.
Streamed and prompted Anthropic requests now send slightly different tool definitions, so the two don't share a prompt cache. Vercel accepts the same trade-off.