7087fbf733a557d9e7bf76367679a88afacd346a
Two compounding streaming bugs caused the bot to render only a 'Gute Frage — lass mich' preamble when claude-haiku spent all MAX_TOOL_ITERATIONS=5 on tool calls without producing final text. 1. Preamble leak: stream posted first content delta as soon as it crossed MIN_CHARS_BEFORE_POST=20, before tool_calls deltas had arrived. Added 1.2s TOOL_GRACE_SECONDS buffer so the suppression path catches the upcoming tool_calls before we go visible. 2. No final synthesis: when the loop exhausted iterations while still requesting tools, reply was empty and the orphaned preamble stayed on screen. Added a forced tools=None final call to make the model summarize accumulated tool results before send/edit.
Description
Matrix AI voice agent - LiveKit + LiteLLM
Languages
Python
99.1%
Dockerfile
0.8%
Shell
0.1%