Skip to content

AI junk - #474

Closed
DSeaStar wants to merge 2 commits into
pallets:mainfrom
DSeaStar:fix-stream-with-context-g
Closed

AI junk#474
DSeaStar wants to merge 2 commits into
pallets:mainfrom
DSeaStar:fix-stream-with-context-g

Conversation

@DSeaStar

Copy link
Copy Markdown

stream_with_context copied only the request context. The generator is iterated later, after the original request task has popped its app context, so _push_appctx created a fresh empty g.

Copy the current app context as well (it already shares g) and restore both while streaming.

Fixes #361.

SeaStar Deng and others added 2 commits August 14, 2026 19:30
The generator runs after the request task has popped its app context, so
copy that context as well and restore it while streaming.
@davidism davidism closed this Aug 14, 2026
@davidism davidism changed the title Fix stream_with_context not propagating g AI junk Aug 14, 2026
@davidism

Copy link
Copy Markdown
Member

https://palletsprojects.com/contributing/llm-ai

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.

stream_with_context does not propagate g

2 participants