[PR #180] [CLOSED] fix(skills): isolate skillsMetadata between parent agent and subagents #184

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

📋 Pull Request Information

Original PR: https://github.com/langchain-ai/deepagentsjs/pull/180
Author: @maahir30
Created: 2/3/2026
Status: Closed

Base: mainHead: isolate-agent-skills


📝 Commits (1)

  • 7963ee9 update agent middleware + tests

📊 Changes

3 files changed (+251 additions, -6 deletions)

View changed files

📝 libs/deepagents/src/agent.ts (+12 -4)
📝 libs/deepagents/src/middleware/skills.test.ts (+219 -0)
📝 libs/deepagents/src/middleware/subagents.ts (+20 -2)

📄 Description

This PR exclude skillsMetadata from subagent state updates to prevent concurrent update errors

1. Added skillsMetadata to EXCLUDED_STATE_KEYS

Skills are loaded per-agent by the skills middleware, so there's no need to propagate skillsMetadata between parent and child agents:

  • Subagents don't receive parent's skillsMetadata
  • Subagents don't return their skillsMetadata to parent

This prevents concurrent update conflicts when parallel subagents complete simultaneously.

2. Fixed skills middleware to only apply to general-purpose subagent

Skills middleware is now added via the generalPurposeMiddleware parameter instead of defaultMiddleware:

  • General-purpose subagent: Gets skills middleware (inherits from parent config)
  • Custom subagents: Do NOT get skills middleware (define their own middleware explicitly)

Added unit tests that verify:

  • Custom subagents do NOT inherit skills middleware
  • skillsMetadata does NOT bubble up from subagent to parent
  • General-purpose subagent DOES inherit skills middleware

🔄 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/180 **Author:** [@maahir30](https://github.com/maahir30) **Created:** 2/3/2026 **Status:** ❌ Closed **Base:** `main` ← **Head:** `isolate-agent-skills` --- ### 📝 Commits (1) - [`7963ee9`](https://github.com/langchain-ai/deepagentsjs/commit/7963ee9b4fea52eafea1e00a19896bfc38744336) update agent middleware + tests ### 📊 Changes **3 files changed** (+251 additions, -6 deletions) <details> <summary>View changed files</summary> 📝 `libs/deepagents/src/agent.ts` (+12 -4) 📝 `libs/deepagents/src/middleware/skills.test.ts` (+219 -0) 📝 `libs/deepagents/src/middleware/subagents.ts` (+20 -2) </details> ### 📄 Description This PR exclude skillsMetadata from subagent state updates to prevent concurrent update errors **1. Added `skillsMetadata` to `EXCLUDED_STATE_KEYS`** Skills are loaded per-agent by the skills middleware, so there's no need to propagate `skillsMetadata` between parent and child agents: - Subagents don't receive parent's `skillsMetadata` - Subagents don't return their `skillsMetadata` to parent This prevents concurrent update conflicts when parallel subagents complete simultaneously. **2. Fixed skills middleware to only apply to general-purpose subagent** Skills middleware is now added via the `generalPurposeMiddleware` parameter instead of `defaultMiddleware`: - General-purpose subagent: Gets skills middleware (inherits from parent config) - Custom subagents: Do NOT get skills middleware (define their own middleware explicitly) Added unit tests that verify: - Custom subagents do NOT inherit skills middleware - `skillsMetadata` does NOT bubble up from subagent to parent - General-purpose subagent DOES inherit skills middleware --- <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:23 -05:00
yindo closed this issue 2026-02-16 06:17:23 -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#184