[GH-ISSUE #122] fix: exclude files from subagent state updates / reopen pr #67 #33

Closed
opened 2026-02-16 06:16:55 -05:00 by yindo · 0 comments
Owner

Originally created by @antonnak on GitHub (Jan 15, 2026).
Original GitHub issue: https://github.com/langchain-ai/deepagentsjs/issues/122

PR #74 does not fix this issue
After upgrading to v1.3.1 (which includes PR #74 ), the error still occurs, when running parallel subagents.

The Problem
PR #74 fixed schema object identity (WeakMap lookup issue).

This PR (#67 ) addresses a different issue: parallel subagents returning shared input files.

EXAMPLE

User uploads 4 files


state.files = { A, B, C, D }


Parent spawns 4 parallel subagents, each receives ALL 4 files

├─► Subagent 1: state.files = { A, B, C, D }
├─► Subagent 2: state.files = { A, B, C, D }
├─► Subagent 3: state.files = { A, B, C, D }
└─► Subagent 4: state.files = { A, B, C, D }


Each subagent returns Command with ALL files


4 Commands × 4 files = 16 updates to files channel in ONE step

Error: "LastValue can only receive one value per step"

The subagents return the same input files they received, causing duplicate updates.

@dqbd noted that EXCLUDED_STATE_KEYS is used for both input and output. If needed, we can split into two lists:

const EXCLUDED_FROM_SUBAGENT_INPUT = ["messages", "todos", "jumpTo"];
const EXCLUDED_FROM_SUBAGENT_OUTPUT = ["messages", "todos", "jumpTo", "files"];

This keeps input behavior unchanged while fixing the parallel return issue.

Can this PR be reopened?

Originally created by @antonnak on GitHub (Jan 15, 2026). Original GitHub issue: https://github.com/langchain-ai/deepagentsjs/issues/122 PR #74 does not fix this issue After upgrading to v1.3.1 (which includes PR #74 ), the error still occurs, when running parallel subagents. The Problem PR #74 fixed schema object identity (WeakMap lookup issue). This PR (#67 ) addresses a different issue: parallel subagents returning shared input files. EXAMPLE User uploads 4 files │ ▼ state.files = { A, B, C, D } │ ▼ Parent spawns 4 parallel subagents, each receives ALL 4 files │ ├─► Subagent 1: state.files = { A, B, C, D } ├─► Subagent 2: state.files = { A, B, C, D } ├─► Subagent 3: state.files = { A, B, C, D } └─► Subagent 4: state.files = { A, B, C, D } │ ▼ Each subagent returns Command with ALL files │ ▼ 4 Commands × 4 files = 16 updates to files channel in ONE step Error: "LastValue can only receive one value per step" The subagents return the same input files they received, causing duplicate updates. @dqbd noted that EXCLUDED_STATE_KEYS is used for both input and output. If needed, we can split into two lists: const EXCLUDED_FROM_SUBAGENT_INPUT = ["messages", "todos", "jumpTo"]; const EXCLUDED_FROM_SUBAGENT_OUTPUT = ["messages", "todos", "jumpTo", "files"]; This keeps input behavior unchanged while fixing the parallel return issue. Can this PR be reopened?
yindo closed this issue 2026-02-16 06:16:55 -05:00
yindo changed title from fix: exclude files from subagent state updates / reopen pr #67 to [GH-ISSUE #122] fix: exclude files from subagent state updates / reopen pr #67 2026-06-05 17:21:05 -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#33