Changes
PR #2212 by pacocartones: fix(ollama): honor caller context in SendStream and ListModels
- Fixed
SendStreamandListModelsin the Ollama vendor to honor the caller'scontext.Contextinstead of substitutingcontext.Background(), so cancellations now propagate too.client.Chatando.client.List. - Resolved an issue where disconnecting web clients left Ollama generations running in the SSE server path, wasting compute and leaking in-flight requests (closes #2196).
- Added a table-driven
httptestregression test that cancels mid-stream and assertsSendStreamreturnscontext.Canceledpromptly without draining the full stream. - Simplified the Ollama stream cancellation test coverage, including streamlined streaming responses and server cancellation checks.
- Replaced manual cancellation error assertions with
require.ErrorIschecks and removed explicit timeout guards and stream completion tracking.