[PR #563] fix(deepagents): isolate subagent projections per task invocation #561

Open
opened 2026-06-05 17:23:45 -04:00 by yindo · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/langchain-ai/deepagentsjs/pull/563
Author: @christian-bromann
Created: 6/1/2026
Status: 🔄 Open

Base: mainHead: cb/fix-subagent-stream-same-type-isolation


📝 Commits (1)

  • acfa9bb fix(deepagents): isolate subagent projections per task invocation

📊 Changes

4 files changed (+148 additions, -132 deletions)

View changed files

.changeset/fix-subagent-stream-invocation-keys.md (+9 -0)
📝 libs/deepagents/src/stream.test.ts (+85 -0)
📝 libs/deepagents/src/stream.ts (+54 -41)
📝 pnpm-lock.yaml (+0 -91)

📄 Description

Summary

  • Fix createSubagentTransformer so each task invocation gets its own messages / toolCalls / nested subagents channels, keyed by task:${tool_call_id} instead of subagent_type.
  • Route child-namespace events via toolsNodeToKey and scope pending child tool state with ${invocationKey}:${toolCallId} to avoid collisions across sibling subagents.
  • Add a unit regression test for two parallel researcher invocations with isolated ping tool-call routing.

fixes #560


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/langchain-ai/deepagentsjs/pull/563 **Author:** [@christian-bromann](https://github.com/christian-bromann) **Created:** 6/1/2026 **Status:** 🔄 Open **Base:** `main` ← **Head:** `cb/fix-subagent-stream-same-type-isolation` --- ### 📝 Commits (1) - [`acfa9bb`](https://github.com/langchain-ai/deepagentsjs/commit/acfa9bb0f43c5d56342d5881d5558f585cff14b8) fix(deepagents): isolate subagent projections per task invocation ### 📊 Changes **4 files changed** (+148 additions, -132 deletions) <details> <summary>View changed files</summary> ➕ `.changeset/fix-subagent-stream-invocation-keys.md` (+9 -0) 📝 `libs/deepagents/src/stream.test.ts` (+85 -0) 📝 `libs/deepagents/src/stream.ts` (+54 -41) 📝 `pnpm-lock.yaml` (+0 -91) </details> ### 📄 Description ## Summary - Fix `createSubagentTransformer` so each `task` invocation gets its own `messages` / `toolCalls` / nested `subagents` channels, keyed by `task:${tool_call_id}` instead of `subagent_type`. - Route child-namespace events via `toolsNodeToKey` and scope pending child tool state with `${invocationKey}:${toolCallId}` to avoid collisions across sibling subagents. - Add a unit regression test for two parallel `researcher` invocations with isolated ping tool-call routing. fixes #560 --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
yindo added the pull-request label 2026-06-05 17:23:45 -04:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: langchain-ai/deepagentsjs#561