fix(langgraph): store and dispose RxPy subscription Disposables in stop() #10909

Merged
HAL9000 merged 3 commits from bugfix/m3-langgraph-disposables into master 2026-06-10 08:41:08 +00:00

3 Commits

Author SHA1 Message Date
controller-ci-rerun cb14e4d1d1 chore: re-trigger CI [controller]
CI / build (pull_request) Successful in 43s
CI / lint (pull_request) Successful in 49s
CI / quality (pull_request) Successful in 51s
CI / helm (pull_request) Successful in 46s
CI / push-validation (pull_request) Successful in 45s
CI / typecheck (pull_request) Successful in 1m19s
CI / security (pull_request) Successful in 1m21s
CI / unit_tests (pull_request) Successful in 4m30s
CI / docker (pull_request) Successful in 1m30s
CI / coverage (pull_request) Successful in 11m22s
CI / integration_tests (pull_request) Successful in 19m53s
CI / status-check (pull_request) Successful in 5s
2026-06-10 02:00:43 -04:00
HAL9000 59aa5b6898 style(tests): fix ruff format violations in tdd_langgraph_disposables_steps.py
ISSUES CLOSED: #10398
2026-06-10 02:00:43 -04:00
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