[PR #943] feat(sdk): add MiddlewareConfig for disabling/replacing built-in middleware #1003

Open
opened 2026-02-16 09:17:53 -05:00 by yindo · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/langchain-ai/deepagents/pull/943
Author: @joshb1050
Created: 1/28/2026
Status: 🔄 Open

Base: mainHead: feature/middleware-config


📝 Commits (2)

  • 5370a96 feat(deepagents): add MiddlewareConfig for disabling/replacing built-in middleware
  • d69fff1 Merge branch 'master' into feature/middleware-config

📊 Changes

6 files changed (+323 additions, -49 deletions)

View changed files

📝 libs/deepagents/deepagents/__init__.py (+2 -0)
📝 libs/deepagents/deepagents/graph.py (+104 -49)
📝 libs/deepagents/deepagents/middleware/__init__.py (+2 -0)
libs/deepagents/deepagents/middleware/config.py (+123 -0)
📝 libs/deepagents/pyproject.toml (+3 -0)
libs/deepagents/tests/unit_tests/middleware/test_middleware_config.py (+89 -0)

📄 Description

Adds a new middleware_config parameter to create_deep_agent() that allows users to disable or replace built-in middleware. Each middleware can be set to:

  • True (default): use the built-in middleware
  • False: disable the middleware entirely
  • AgentMiddleware instance: replace with a custom implementation

This addresses the limitation where users could only add middleware but not remove or suppress the built-in ones.


🔄 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/deepagents/pull/943 **Author:** [@joshb1050](https://github.com/joshb1050) **Created:** 1/28/2026 **Status:** 🔄 Open **Base:** `main` ← **Head:** `feature/middleware-config` --- ### 📝 Commits (2) - [`5370a96`](https://github.com/langchain-ai/deepagents/commit/5370a96d09fccd43b4f5be117e5ebb2a07926184) feat(deepagents): add MiddlewareConfig for disabling/replacing built-in middleware - [`d69fff1`](https://github.com/langchain-ai/deepagents/commit/d69fff11583a98cad6e7bcad3404b64102f74581) Merge branch 'master' into feature/middleware-config ### 📊 Changes **6 files changed** (+323 additions, -49 deletions) <details> <summary>View changed files</summary> 📝 `libs/deepagents/deepagents/__init__.py` (+2 -0) 📝 `libs/deepagents/deepagents/graph.py` (+104 -49) 📝 `libs/deepagents/deepagents/middleware/__init__.py` (+2 -0) ➕ `libs/deepagents/deepagents/middleware/config.py` (+123 -0) 📝 `libs/deepagents/pyproject.toml` (+3 -0) ➕ `libs/deepagents/tests/unit_tests/middleware/test_middleware_config.py` (+89 -0) </details> ### 📄 Description Adds a new `middleware_config` parameter to `create_deep_agent()` that allows users to disable or replace built-in middleware. Each middleware can be set to: - `True` (default): use the built-in middleware - `False`: disable the middleware entirely - `AgentMiddleware` instance: replace with a custom implementation This addresses the limitation where users could only add middleware but not remove or suppress the built-in ones. --- <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 09:17:53 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: langchain-ai/deepagents#1003