[PR #187] [MERGED] feat(deepagents): support skills in subagents #191

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

📋 Pull Request Information

Original PR: https://github.com/langchain-ai/deepagentsjs/pull/187
Author: @christian-bromann
Created: 2/4/2026
Status: Merged
Merged: 2/4/2026
Merged by: @christian-bromann

Base: mainHead: cb/subagent-skills


📝 Commits (4)

📊 Changes

12 files changed (+813 additions, -190 deletions)

View changed files

📝 libs/deepagents/README.md (+32 -0)
📝 libs/deepagents/src/agent.ts (+72 -33)
📝 libs/deepagents/src/index.ts (+5 -0)
📝 libs/deepagents/src/middleware/index.ts (+5 -0)
📝 libs/deepagents/src/middleware/memory.test.ts (+33 -40)
📝 libs/deepagents/src/middleware/skills.test.ts (+8 -52)
libs/deepagents/src/middleware/subagent.test.ts (+275 -0)
📝 libs/deepagents/src/middleware/subagents.int.test.ts (+136 -0)
📝 libs/deepagents/src/middleware/subagents.ts (+164 -18)
📝 libs/deepagents/src/middleware/summarization.test.ts (+1 -46)
libs/deepagents/src/middleware/test.ts (+77 -0)
📝 libs/deepagents/vitest.config.ts (+5 -1)

📄 Description

Summary

  • Add skills parameter to the SubAgent interface, allowing subagents to have their own skill sets
  • Export GENERAL_PURPOSE_SUBAGENT constant for custom subagent configurations
  • Export documentation constants (DEFAULT_SUBAGENT_PROMPT, DEFAULT_GENERAL_PURPOSE_DESCRIPTION, TASK_SYSTEM_PROMPT) for extensibility
  • Prevent state leakage by adding skillsMetadata and memoryContents to EXCLUDED_STATE_KEYS
  • Fix middleware ordering: SkillsMiddleware is now inserted before user middleware (matching Python SDK behavior)
  • Fix .env loading in vitest.config.ts for integration tests

Details

This PR ports the subagent skills feature from Python SDK PR #1041 to the JavaScript SDK.

Subagent Skills

Custom subagents can now specify their own skill sources:

const agent = createDeepAgent({
  subagents: [
    {
      name: "researcher",
      description: "Research assistant",
      systemPrompt: "You are a researcher.",
      skills: ["/skills/research/"],  // Subagent-specific skills
    },
  ],
});

When a subagent has skills configured, createDeepAgent automatically creates a SkillsMiddleware instance for that subagent. The middleware ordering follows Python's pattern: base middleware → skills → user's 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/187 **Author:** [@christian-bromann](https://github.com/christian-bromann) **Created:** 2/4/2026 **Status:** ✅ Merged **Merged:** 2/4/2026 **Merged by:** [@christian-bromann](https://github.com/christian-bromann) **Base:** `main` ← **Head:** `cb/subagent-skills` --- ### 📝 Commits (4) - [`2e5ae1e`](https://github.com/langchain-ai/deepagentsjs/commit/2e5ae1ee877c3a4b744a6b2498d596d4b9a0ad16) feat(deepagents): support skills in subagents - [`c1086c0`](https://github.com/langchain-ai/deepagentsjs/commit/c1086c09633f12b15eccd8a1e3bd90eb257aa58e) better check for runnable - [`9e855d5`](https://github.com/langchain-ai/deepagentsjs/commit/9e855d56d6974c349f245c13d162a33ecdf19b24) improve testing - [`4505425`](https://github.com/langchain-ai/deepagentsjs/commit/4505425be9cf7e48c099ba73c4c04d6efc714045) format ### 📊 Changes **12 files changed** (+813 additions, -190 deletions) <details> <summary>View changed files</summary> 📝 `libs/deepagents/README.md` (+32 -0) 📝 `libs/deepagents/src/agent.ts` (+72 -33) 📝 `libs/deepagents/src/index.ts` (+5 -0) 📝 `libs/deepagents/src/middleware/index.ts` (+5 -0) 📝 `libs/deepagents/src/middleware/memory.test.ts` (+33 -40) 📝 `libs/deepagents/src/middleware/skills.test.ts` (+8 -52) ➕ `libs/deepagents/src/middleware/subagent.test.ts` (+275 -0) 📝 `libs/deepagents/src/middleware/subagents.int.test.ts` (+136 -0) 📝 `libs/deepagents/src/middleware/subagents.ts` (+164 -18) 📝 `libs/deepagents/src/middleware/summarization.test.ts` (+1 -46) ➕ `libs/deepagents/src/middleware/test.ts` (+77 -0) 📝 `libs/deepagents/vitest.config.ts` (+5 -1) </details> ### 📄 Description ## Summary - Add `skills` parameter to the `SubAgent` interface, allowing subagents to have their own skill sets - Export `GENERAL_PURPOSE_SUBAGENT` constant for custom subagent configurations - Export documentation constants (`DEFAULT_SUBAGENT_PROMPT`, `DEFAULT_GENERAL_PURPOSE_DESCRIPTION`, `TASK_SYSTEM_PROMPT`) for extensibility - Prevent state leakage by adding `skillsMetadata` and `memoryContents` to `EXCLUDED_STATE_KEYS` - Fix middleware ordering: SkillsMiddleware is now inserted before user middleware (matching Python SDK behavior) - Fix `.env` loading in `vitest.config.ts` for integration tests ## Details This PR ports the subagent skills feature from Python SDK PR #1041 to the JavaScript SDK. ### Subagent Skills Custom subagents can now specify their own skill sources: ```typescript const agent = createDeepAgent({ subagents: [ { name: "researcher", description: "Research assistant", systemPrompt: "You are a researcher.", skills: ["/skills/research/"], // Subagent-specific skills }, ], }); ``` When a subagent has `skills` configured, `createDeepAgent` automatically creates a `SkillsMiddleware` instance for that subagent. The middleware ordering follows Python's pattern: `base middleware → skills → user's 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:24 -05:00
yindo closed this issue 2026-02-16 06:17:24 -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#191