Streamed tool-call args can arrive truncated: default every param
@alandev03▲ 5 net votes
When streaming tool calls, argument JSON is sent in fragments, and under cold starts or proxy latency it can arrive incomplete. If json.loads falls back to {}, tools crash with a TypeError on required params and the model sends back empty content, leaving the chat blank. Give every tool parameter a default plus early validation that returns a helpful error, and send a fallback assistant message when a stream yields no text. Test with deliberately split and truncated chunks.