[PR #465] [MERGED] fix(deepagents): align summarization with active request model #487

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

📋 Pull Request Information

Original PR: https://github.com/langchain-ai/deepagentsjs/pull/465
Author: @hntrl
Created: 4/14/2026
Status: Merged
Merged: 4/14/2026
Merged by: @hntrl

Base: mainHead: hunter/summarization-request-model-routing


📝 Commits (3)

  • 3740c50 fix(deepagents): align summarization with active request model
  • 522d108 chore: add changeset for summarization routing fix
  • 71764e6 Merge branch 'main' into hunter/summarization-request-model-routing

📊 Changes

4 files changed (+71 additions, -5 deletions)

View changed files

.changeset/mean-rats-shake.md (+5 -0)
📝 libs/deepagents/src/agent.ts (+2 -2)
📝 libs/deepagents/src/middleware/summarization.test.ts (+53 -1)
📝 libs/deepagents/src/middleware/summarization.ts (+11 -2)

📄 Description

Summary

Fixes #398

Align deepagents summarization with the active request-time model path instead of relying on a separate middleware-specific model resolution path. This keeps summarization behavior consistent with the main agent model selection flow and avoids divergence in provider/model handling during middleware execution. The update also simplifies runtime behavior by removing unnecessary explicit config threading for summary calls.

Changes

deepagents middleware/model routing

  • Updated summarization middleware to prefer request.model as the resolved model used for profile-derived limits and summary generation.
  • Kept fallback model resolution support for cases where a request model is not present.
  • Removed explicit runtime config plumb-through in summary invocation, relying on LangChain runnable context propagation.

deepagents agent wiring

  • Updated createDeepAgent built-in and subagent middleware wiring to construct summarization middleware without explicitly passing a separate model option, so summarization follows the active request model path.

deepagents tests

  • Added/updated summarization tests to cover request-model-based summarization behavior and ensure middleware behavior remains stable with the new routing path.
  • Simplified test request construction to keep request-model assumptions explicit.

🔄 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/465 **Author:** [@hntrl](https://github.com/hntrl) **Created:** 4/14/2026 **Status:** ✅ Merged **Merged:** 4/14/2026 **Merged by:** [@hntrl](https://github.com/hntrl) **Base:** `main` ← **Head:** `hunter/summarization-request-model-routing` --- ### 📝 Commits (3) - [`3740c50`](https://github.com/langchain-ai/deepagentsjs/commit/3740c50c28c6ba7f67f546ccc7c7130db895269b) fix(deepagents): align summarization with active request model - [`522d108`](https://github.com/langchain-ai/deepagentsjs/commit/522d108cb9c8ad11c1fdeff701a91eba4275cb51) chore: add changeset for summarization routing fix - [`71764e6`](https://github.com/langchain-ai/deepagentsjs/commit/71764e60f7f5de93cf36091e19484803e6cb2500) Merge branch 'main' into hunter/summarization-request-model-routing ### 📊 Changes **4 files changed** (+71 additions, -5 deletions) <details> <summary>View changed files</summary> ➕ `.changeset/mean-rats-shake.md` (+5 -0) 📝 `libs/deepagents/src/agent.ts` (+2 -2) 📝 `libs/deepagents/src/middleware/summarization.test.ts` (+53 -1) 📝 `libs/deepagents/src/middleware/summarization.ts` (+11 -2) </details> ### 📄 Description ## Summary Fixes #398 Align deepagents summarization with the active request-time model path instead of relying on a separate middleware-specific model resolution path. This keeps summarization behavior consistent with the main agent model selection flow and avoids divergence in provider/model handling during middleware execution. The update also simplifies runtime behavior by removing unnecessary explicit config threading for summary calls. ## Changes ### `deepagents` middleware/model routing - Updated summarization middleware to prefer `request.model` as the resolved model used for profile-derived limits and summary generation. - Kept fallback model resolution support for cases where a request model is not present. - Removed explicit runtime config plumb-through in summary invocation, relying on LangChain runnable context propagation. ### `deepagents` agent wiring - Updated `createDeepAgent` built-in and subagent middleware wiring to construct summarization middleware without explicitly passing a separate model option, so summarization follows the active request model path. ### `deepagents` tests - Added/updated summarization tests to cover request-model-based summarization behavior and ensure middleware behavior remains stable with the new routing path. - Simplified test request construction to keep request-model assumptions explicit. --- <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:23:22 -04:00
yindo closed this issue 2026-06-05 17:23:22 -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#487