react-langchain: a subagent transcript repeats its descendants' messages

Author: okisdevCreated Sep 18, 2026Updated Sep 18, 2026
Labelsbug

noticed while reviewing #7699; predates it and is out of its scope.

problem

useSubagentTranscripts builds each subagent transcript from messagesProjection(snapshot.namespace) and converts that store wholesale, then attaches each child's transcript under the task tool call in its parent's transcript. the store is not scoped to the subagent's own namespace: on the non-root branch messagesProjection calls openProjectionSubscription with channels: ["messages", "values"] and no depth, which defaults to 1, and its onEvent applies every delivered event without a namespace check (the exact-namespace guard exists only on the root-bus branch, dist/stream/projections/messages.js in the pinned @langchain/langgraph-sdk).

so a subagent one level below another receives its children's messages into its own store. the child's messages should then appear twice in its parent's transcript: once inline, once inside the nested transcript attached to the task call.

next step

confirm against a running deep agent with two levels of task nesting before choosing a fix; the shape of the duplication decides whether the filter belongs in the conversion (drop messages whose namespace is below the resource's) or in how transcripts are attached. the subagent snapshot's namespace is available per resource, but the message objects themselves do not carry the namespace they arrived under, so the filter likely needs the projection's event stream rather than the store snapshot.

related: #7422, #7701.

Track in Rupic

Source: assistant-ui/assistant-ui