Files
langgraph/libs
nick-hollon-lc 93cb1f87e8 fix(langgraph): type undeclared v3 stream projections
`stream_events(version="v3")` returns `GraphRunStream`, which declares only
the four always-registered native projections. Native projections are
attached from a registry, so any other one — opt-in built-ins, and
projections from transformers in other packages like `tool_calls`
(langgraph-prebuilt) or `subagents` (langchain) — was invisible to type
checkers, raising `attr-defined`. These returned `Any` before 1.2.10, so
the errors are new.

- Declare the opt-in native projections this package ships (`updates`,
  `custom`, `checkpoints`, `debug`, `tasks`).
- Add `__getattr__ -> StreamChannel[Any]` to both run streams for
  projections declared outside this package. The body only raises
  `AttributeError`, now listing the registered projections; it reads the
  mux from `__dict__` so a miss before `__init__` can't recurse.

Projections owned by other distributions are deliberately not annotated
here — that would bind this package's typing surface to another's private
module. Precise types for those need a downstream subclass, which composes
with this since declared attributes take precedence over `__getattr__`.

Tradeoff: a misspelled projection name now type-checks and fails at
runtime instead.
2026-08-11 11:59:18 -04:00
..
2026-08-11 09:55:59 -04:00