[PR #290] [MERGED] feat: Add static structured output to subagent response #331

Closed
opened 2026-06-05 17:22:42 -04:00 by yindo · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/langchain-ai/deepagentsjs/pull/290
Author: @maahir30
Created: 3/9/2026
Status: Merged
Merged: 3/13/2026
Merged by: @hntrl

Base: mainHead: static-subagent-structured-response


📝 Commits (3)

📊 Changes

3 files changed (+199 additions, -11 deletions)

View changed files

.changeset/curvy-planes-sparkle.md (+5 -0)
📝 libs/deepagents/src/middleware/subagent.test.ts (+143 -0)
📝 libs/deepagents/src/middleware/subagents.ts (+51 -11)

📄 Description

Summary

  • Add responseFormat support to subagents, allowing structured output schemas (Zod, toolStrategy, providerStrategy, etc.) to be passed through to createAgent
  • When a subagent produces a structuredResponse, JSON-serialize it as the ToolMessage content instead of extracting the last message text, giving the parent agent predictable, parseable data
  • Add tests for both the structured response path and the fallback to last-message extraction

🔄 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/290 **Author:** [@maahir30](https://github.com/maahir30) **Created:** 3/9/2026 **Status:** ✅ Merged **Merged:** 3/13/2026 **Merged by:** [@hntrl](https://github.com/hntrl) **Base:** `main` ← **Head:** `static-subagent-structured-response` --- ### 📝 Commits (3) - [`64d47d5`](https://github.com/langchain-ai/deepagentsjs/commit/64d47d5b4cb4061a886df87a1eca3970ddee14f8) just static structured output - [`0aaa999`](https://github.com/langchain-ai/deepagentsjs/commit/0aaa999c39c476f2a6a711eca1581580a72607e6) fix - [`db5f08b`](https://github.com/langchain-ai/deepagentsjs/commit/db5f08b80576aaffc30d7ae456dbd362b8e6ecb0) Create curvy-planes-sparkle.md ### 📊 Changes **3 files changed** (+199 additions, -11 deletions) <details> <summary>View changed files</summary> ➕ `.changeset/curvy-planes-sparkle.md` (+5 -0) 📝 `libs/deepagents/src/middleware/subagent.test.ts` (+143 -0) 📝 `libs/deepagents/src/middleware/subagents.ts` (+51 -11) </details> ### 📄 Description ## Summary - Add `responseFormat` support to subagents, allowing structured output schemas (Zod, `toolStrategy`, `providerStrategy`, etc.) to be passed through to `createAgent` - When a subagent produces a `structuredResponse`, JSON-serialize it as the ToolMessage content instead of extracting the last message text, giving the parent agent predictable, parseable data - Add tests for both the structured response path and the fallback to last-message extraction --- <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-06-05 17:22:42 -04:00
yindo closed this issue 2026-06-05 17:22:42 -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#331