mirror of
https://github.com/rcourtman/Pulse.git
synced 2026-09-11 14:00:29 +00:00
c9bbe8b3a8
The read loop in ChatStream breaks immediately on io.EOF without processing remaining buffered data. Per Go's io.Reader contract, Read may return both n > 0 and io.EOF simultaneously, so the final bytes (which may contain tool call deltas and [DONE]) are silently discarded. This causes the agentic loop to see tool_calls=0 even though the model correctly produced tool calls in the stream. Changes: - Process pendingData when EOF is received before breaking - Add fallback: emit accumulated tool calls if [DONE] was never reached (server closed connection early) Fixes #1411 Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>