mirror of
https://github.com/langchain-ai/langgraph.git
synced 2026-08-17 21:25:46 +02:00
9af25217c3
## Description v3 event streaming's `stream.abort()` (sync and async) only closed the mux and stopped pumping, leaving the underlying `astream`/`stream` generator — and any running subgraphs — alive until they finished, burning resources. The fix closes the underlying graph iterator so `GeneratorExit` propagates into in-flight nodes/subgraphs and cancels them, matching v2's `aclose()` behavior. Fixes #8029. ## Release Note v3 streaming `stream.abort()` now cancels running subgraphs instead of letting them run to completion. ## Test Plan - [x] `TEST="tests/test_pregel_stream_events_v3.py -k abort" make test` (new `test_abort_cancels_running_subgraph` asserts the looping subgraph stops after abort) Made by [Open SWE](https://openswe.vercel.app) --------- Co-authored-by: Nick Hollon <274035459+nick-hollon-lc@users.noreply.github.com> Co-authored-by: open-swe[bot] <open-swe@users.noreply.github.com>