Commit Graph

1 Commits

Author SHA1 Message Date
HAL9000 2d87bd88a2 fix(langgraph): store and dispose RxPy subscription Disposables in stop()
LangGraph._setup_node_stream_subscriptions() was discarding the Disposable
returned by observable.subscribe(), making it impossible for stop() to clean
up active subscriptions. This caused resource leaks and prevented garbage
collection of LangGraph instances (the on_error closure captured self.logger).

Changes:
- Add self._subscriptions: list[Any] = [] to LangGraph.__init__
- Store each Disposable returned by observable.subscribe() in _subscriptions
- Dispose all stored subscriptions in stop() using contextlib.suppress(Exception)
- Clear _subscriptions list after disposal
- Add BDD feature and step definitions for TDD issue #10398

ISSUES CLOSED: #10398
2026-06-10 02:00:43 -04:00