Skip to content
Shihao Qi
ProjectsWritingNotesSearchAbout

TAG

Streaming

Everything filed under this tag.

1 entries

01Writing

Breaking Out of an Async Generator Triggers aclose(): Code After the Last Yield Never Runs2026-11-07The consumer breaks on the last event, the async generator gets aclose(), GeneratorExit is thrown into the suspended yield, and the create_task after it never runs while a finally would. Autarkia’s conversation-history save never ran once because of it; the pattern was fixed in April and reintroduced in August for a reasonable-sounding reason.#Python#asyncio#Streaming#Autarkia
← All tagsSearch the site
© 2026 Shihao Qi
TagsRSSGitHubEmail