[PR #67] [CLOSED] fix: exclude files from subagent state updates #96

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

📋 Pull Request Information

Original PR: https://github.com/langchain-ai/deepagentsjs/pull/67
Author: @antonnak
Created: 11/25/2025
Status: Closed

Base: mainHead: fix/exclude-files-from-subagent-state


📝 Commits (1)

  • 57e3efb fix: exclude files from subagent state updates

📊 Changes

1 file changed (+1 additions, -1 deletions)

View changed files

📝 src/middleware/subagents.ts (+1 -1)

📄 Description

Problem

When multiple subagents run in parallel and complete in the same LangGraph step,
both try to update the parent's files channel simultaneously, causing:

InvalidUpdateError: Invalid update for channel "files" with values [{},{}]:
LastValue can only receive one value per step.

Root Cause

EXCLUDED_STATE_KEYS filters state when subagents return results to the parent
via returnCommandWithStateUpdate(). Currently it excludes messages, todos,
and jumpTo, but NOT files.

When using external backends (like Azure Blob, NFS, or even StoreBackend), files
are already persisted externally. Passing the files state back to the parent
is unnecessary and causes concurrent update errors when subagents run in parallel.

Solution

Add "files" to EXCLUDED_STATE_KEYS. This is consistent with how messages
and todos are handled - they have their own reducers and don't need to be
passed through subagent state updates.


🔄 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/67 **Author:** [@antonnak](https://github.com/antonnak) **Created:** 11/25/2025 **Status:** ❌ Closed **Base:** `main` ← **Head:** `fix/exclude-files-from-subagent-state` --- ### 📝 Commits (1) - [`57e3efb`](https://github.com/langchain-ai/deepagentsjs/commit/57e3efb0ac3eae816abd305b237474557e8bad98) fix: exclude files from subagent state updates ### 📊 Changes **1 file changed** (+1 additions, -1 deletions) <details> <summary>View changed files</summary> 📝 `src/middleware/subagents.ts` (+1 -1) </details> ### 📄 Description ## Problem When multiple subagents run in parallel and complete in the same LangGraph step, both try to update the parent's `files` channel simultaneously, causing: InvalidUpdateError: Invalid update for channel "files" with values [{},{}]: LastValue can only receive one value per step. ## Root Cause `EXCLUDED_STATE_KEYS` filters state when subagents return results to the parent via `returnCommandWithStateUpdate()`. Currently it excludes `messages`, `todos`, and `jumpTo`, but NOT `files`. When using external backends (like Azure Blob, NFS, or even StoreBackend), files are already persisted externally. Passing the `files` state back to the parent is unnecessary and causes concurrent update errors when subagents run in parallel. ## Solution Add `"files"` to `EXCLUDED_STATE_KEYS`. This is consistent with how `messages` and `todos` are handled - they have their own reducers and don't need to be passed through subagent state updates. --- <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-02-16 06:17:09 -05:00
yindo closed this issue 2026-02-16 06:17:09 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: langchain-ai/deepagentsjs#96