[PR #3729] [MERGED] docs(deepagents): fix default middleware ordering in customization #3759

Closed
opened 2026-06-05 18:53:03 -04:00 by yindo · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/langchain-ai/docs/pull/3729
Author: @AdemBoukhris457
Created: 4/25/2026
Status: Merged
Merged: 5/29/2026
Merged by: @npentrel

Base: mainHead: docs/deepagents-middleware-ordering


📝 Commits (7)

  • 71f4978 docs(deepagents): align customization middleware order with create_deep_agent
  • 2ef372c Merge upstream/main and address PR review comments
  • aa626fd Apply suggestion from @npentrel
  • fdeba70 Apply suggestion from @npentrel
  • 84d060a Fix merge conflict issue
  • 7942ec5 Apply suggestion from @npentrel
  • 52aae13 Apply suggestion from @npentrel

📊 Changes

1 file changed (+81 additions, -125 deletions)

View changed files

📝 src/oss/deepagents/customization.mdx (+81 -125)

📄 Description

Overview

The Middleware section in src/oss/deepagents/customization.mdx described the default Deep Agents stack in the wrong order (for example Anthropic prompt caching before Patch, and skills grouped with memory/HITL). This PR rewrites that section so it matches create_deep_agent / createDeepAgent in libs/deepagents/deepagents/graph.py: main-agent stack as an ordered list, correct placement of Skills, Patch, Anthropic caching, caller middleware, profile tail, Memory, HITL, and permissions last. It adds a subsection contrasting synchronous subagent stacks (including Skills after Patch on inner agents) with the main agent, and a short Note on why Memory follows Anthropic prompt caching.

Type of change

Type: Update existing documentation

Related issues/PRs

  • GitHub issue: closes #3728

  • Feature PR:

  • Linear issue:

  • Slack thread:

Checklist

  • I have read the contributing guidelines, including the language policy
  • I have tested my changes locally using docs dev
  • All code examples have been tested and work correctly
  • I have used root relative paths for internal links
  • I have updated navigation in src/docs.json if needed

🔄 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/docs/pull/3729 **Author:** [@AdemBoukhris457](https://github.com/AdemBoukhris457) **Created:** 4/25/2026 **Status:** ✅ Merged **Merged:** 5/29/2026 **Merged by:** [@npentrel](https://github.com/npentrel) **Base:** `main` ← **Head:** `docs/deepagents-middleware-ordering` --- ### 📝 Commits (7) - [`71f4978`](https://github.com/langchain-ai/docs/commit/71f4978874cc0b54c2cfb10860f01ce860bc2514) docs(deepagents): align customization middleware order with create_deep_agent - [`2ef372c`](https://github.com/langchain-ai/docs/commit/2ef372cbe66e95e77dea4726b0e00cf53bbc5e9a) Merge upstream/main and address PR review comments - [`aa626fd`](https://github.com/langchain-ai/docs/commit/aa626fd9417a642b9eaba5aa12d05c9437dc90be) Apply suggestion from @npentrel - [`fdeba70`](https://github.com/langchain-ai/docs/commit/fdeba70b16abd4451363566aad2ae37a0eb32f90) Apply suggestion from @npentrel - [`84d060a`](https://github.com/langchain-ai/docs/commit/84d060ac1d8b7d5d05e07c47de6317b469051bc4) Fix merge conflict issue - [`7942ec5`](https://github.com/langchain-ai/docs/commit/7942ec59bf140097a0f7062152e1b751d002a4df) Apply suggestion from @npentrel - [`52aae13`](https://github.com/langchain-ai/docs/commit/52aae1340ff095b2a6bfbbb306b57b5eaaf167e9) Apply suggestion from @npentrel ### 📊 Changes **1 file changed** (+81 additions, -125 deletions) <details> <summary>View changed files</summary> 📝 `src/oss/deepagents/customization.mdx` (+81 -125) </details> ### 📄 Description ## Overview The **Middleware** section in `src/oss/deepagents/customization.mdx` described the default Deep Agents stack in the wrong order (for example Anthropic prompt caching before Patch, and skills grouped with memory/HITL). This PR rewrites that section so it matches `create_deep_agent` / `createDeepAgent` in `libs/deepagents/deepagents/graph.py`: main-agent stack as an ordered list, correct placement of Skills, Patch, Anthropic caching, caller `middleware`, profile tail, Memory, HITL, and permissions last. It adds a subsection contrasting synchronous subagent stacks (including Skills after Patch on inner agents) with the main agent, and a short Note on why Memory follows Anthropic prompt caching. ## Type of change **Type:** Update existing documentation ## Related issues/PRs - GitHub issue: closes #3728 - Feature PR: - Linear issue: - Slack thread: ## Checklist - [x] I have read the [contributing guidelines](README.md), including the [language policy](https://docs.langchain.com/oss/python/contributing/overview#language-policy) - [x] I have tested my changes locally using `docs dev` - [x] All code examples have been tested and work correctly - [x] I have used **root relative** paths for internal links - [x] I have updated navigation in `src/docs.json` if needed --- <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 18:53:03 -04:00
yindo closed this issue 2026-06-05 18:53:03 -04:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: langchain-ai/docs#3759