mirror of
https://github.com/langchain-ai/langgraph.git
synced 2026-09-02 14:28:46 +02:00
`StreamMessagesHandlerV2` inherited v1's `on_chat_model_start` / `on_chain_start`, which slice the ns tuple with `[:-1]`. On the protocol-v2 wire this stripped subgraph chat-model deltas down to one level (`["research:<uuid>"]`), slipping them through the JS client's `namespaces=[[]], depth=1` root-feed filter and polluting the main conversation with subgraph tokens. Override both methods on the v2 class to keep the full `tuple(task_checkpoint_ns.split(NS_SEP))`, matching JS's `handleChatModelStart` in `libs/langgraph-core/src/pregel/messages-v2.ts`. The v1 handler and the stripped `langgraph_checkpoint_ns` metadata field are unchanged.