Skip to content

fix(ollama): honor stream context cancellation - #2197

Open
drawliin wants to merge 1 commit into
danielmiessler:mainfrom
drawliin:fix/ollama-stream-context-cancel
Open

fix(ollama): honor stream context cancellation#2197
drawliin wants to merge 1 commit into
danielmiessler:mainfrom
drawliin:fix/ollama-stream-context-cancel

Conversation

@drawliin

Copy link
Copy Markdown
Contributor

What this Pull Request (PR) does

fixes an ollama streaming bug.. sendstream was replacing the caller context with context.background().. so canceled cli sessions or disconnected http clients would not actually stop the in flight ollama request..

this pr makes the ollama stream path honor the incoming context.. and adds a regression test to verify the stream returns context.canceled and closes the channel cleanly when the caller is gone..

Related issues

closes #2196

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: ollama stream ignores request cancellation

1 participant