[PR #142] [CLOSED] fix(deepagents): exclude skillsMetadata from subagent state updates #154

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

📋 Pull Request Information

Original PR: https://github.com/langchain-ai/deepagentsjs/pull/142
Author: @tverghonooks
Created: 1/25/2026
Status: Closed

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


📝 Commits (1)

  • c875208 fix(deepagents): exclude skillsMetadata from subagent state updates

📊 Changes

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

View changed files

📝 libs/deepagents/src/middleware/subagents.ts (+4 -0)

📄 Description

Summary

Adds skillsMetadata to EXCLUDED_STATE_KEYS to prevent concurrent update errors when multiple subagents complete in parallel with skills middleware enabled.

Problem

When skills middleware is enabled and multiple subagents run in parallel, each subagent returns skillsMetadata in their state update. Since skillsMetadata uses implicit LastValue (no custom reducer), LangGraph fails with:

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

Solution

Add "skillsMetadata" to EXCLUDED_STATE_KEYS (matching the existing handling for files):

const EXCLUDED_STATE_KEYS = [
  "messages",
  "todos",
  "structuredResponse",
  "files",
  "skillsMetadata",  // Added
] as const;

Changes

  • libs/deepagents/src/middleware/subagents.ts: Add skillsMetadata to excluded keys with explanatory comment

Test Plan

  • All existing unit tests pass (277 tests)
  • Manually verified fix resolves the concurrent update error

🔄 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/142 **Author:** [@tverghonooks](https://github.com/tverghonooks) **Created:** 1/25/2026 **Status:** ❌ Closed **Base:** `main` ← **Head:** `fix/exclude-skillsmetadata-from-subagent-state` --- ### 📝 Commits (1) - [`c875208`](https://github.com/langchain-ai/deepagentsjs/commit/c8752082d08ef3657e013b5265adcd1bdf3ee1f8) fix(deepagents): exclude skillsMetadata from subagent state updates ### 📊 Changes **1 file changed** (+4 additions, -0 deletions) <details> <summary>View changed files</summary> 📝 `libs/deepagents/src/middleware/subagents.ts` (+4 -0) </details> ### 📄 Description ## Summary Adds `skillsMetadata` to `EXCLUDED_STATE_KEYS` to prevent concurrent update errors when multiple subagents complete in parallel with skills middleware enabled. ## Problem When skills middleware is enabled and multiple subagents run in parallel, each subagent returns `skillsMetadata` in their state update. Since `skillsMetadata` uses implicit `LastValue` (no custom reducer), LangGraph fails with: ``` Invalid update for channel "skillsMetadata" with values [[...],[...],[...]]: LastValue can only receive one value per step. ``` ## Solution Add `"skillsMetadata"` to `EXCLUDED_STATE_KEYS` (matching the existing handling for `files`): ```typescript const EXCLUDED_STATE_KEYS = [ "messages", "todos", "structuredResponse", "files", "skillsMetadata", // Added ] as const; ``` ## Changes - `libs/deepagents/src/middleware/subagents.ts`: Add `skillsMetadata` to excluded keys with explanatory comment ## Test Plan - [x] All existing unit tests pass (277 tests) - [x] Manually verified fix resolves the concurrent update error --- <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:18 -05:00
yindo closed this issue 2026-02-16 06:17:18 -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#154