#2196·Fabric

[Bug]: ollama stream ignores request cancellation

Author: drawliinCreated Aug 23, 2026Updated Aug 23, 2026

What happened?

when ollama streaming starts.. the request context gets replaced with context.background() inside sendstream..

that means canceled cli sessions or closed http clients do not actually stop the ollama request.. it keeps running until ollama finishes or times out..

this also means stream sends can block longer than they should when the caller is already gone..

expected behavior.. sendstream should honor the incoming context for the ollama chat request and for writes into the stream channel.. returning context.canceled when the caller is gone..

steps to reproduce.. start an ollama stream request.. cancel the caller context or disconnect the client.. notice the ollama request keeps running instead of stopping immediately..

Operating System

linux - amd64

OS Version

bash
Linux amd64

How did you install Fabric?

go install

Version

v1.4.470