The Stream() path was broken end to end:
- requests always went out with "stream": false, so the SSE parser found
no data lines and every stream ended empty
- Config.Model was discarded at construction, and the agent loop never
sets req.Model, so requests carried an empty model (hard API error)
- tool-call deltas were ignored entirely: the agent never executed tools
over a stream with this provider (which also backs the ollama type)
- usage was neither requested nor parsed, so token tracking stayed at 0
Now mirrors the proven llamacpp client: stream flag + stream_options
.include_usage, per-index tool-call fragment accumulation flushed on
finish_reason, usage passthrough, a 4MB SSE scanner buffer (64KB default
kills the stream on large tool arguments), and an empty-choices guard in
toResponse instead of a panic.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>