Skip to content

feat(deepagents): implement default middleware systemprompt override#587

Open
Oscar-Umana wants to merge 1 commit into
langchain-ai:mainfrom
Oscar-Umana:feature/default-middleware-prompt-overrides
Open

feat(deepagents): implement default middleware systemprompt override#587
Oscar-Umana wants to merge 1 commit into
langchain-ai:mainfrom
Oscar-Umana:feature/default-middleware-prompt-overrides

Conversation

@Oscar-Umana

Copy link
Copy Markdown

Summary

Adds a middlewareSystemPrompts option to createDeepAgent so callers can override system prompts injected by the built-in middleware stack.

Supported overrides:

  • todoList
  • filesystem
  • subagent
  • asyncSubagent

The new DeepAgentMiddlewareSystemPrompts interface is exported from the package entrypoint for consumers who want to type config objects directly.

Changes

  • Adds middlewareSystemPrompts?: DeepAgentMiddlewareSystemPrompts to CreateDeepAgentParams.
  • Wires prompt overrides into the built-in root middleware stack.
  • Applies the same todo/filesystem prompt overrides to normalized subagent middleware.
  • Supports disabling the subagent task prompt with subagent: null, matching existing createSubAgentMiddleware behavior.
  • Adds runtime coverage that verifies custom middleware prompts replace the defaults.
  • Adds a type test confirming the new param is accepted by createDeepAgent.

Validation

  • pnpm --dir libs/deepagents exec vitest run src/agent.test.ts --config vitest.config.ts --typecheck.enabled=false
  • Editor diagnostics pass for the edited files.

@pkg-pr-new

pkg-pr-new Bot commented Jun 9, 2026

Copy link
Copy Markdown

Open in StackBlitz

deepagents-acp

npm i https://pkg.pr.new/deepagents-acp@587

deepagents

npm i https://pkg.pr.new/deepagents@587

@langchain/sandbox-standard-tests

npm i https://pkg.pr.new/@langchain/sandbox-standard-tests@587

@langchain/daytona

npm i https://pkg.pr.new/@langchain/daytona@587

@langchain/deno

npm i https://pkg.pr.new/@langchain/deno@587

@langchain/modal

npm i https://pkg.pr.new/@langchain/modal@587

@langchain/node-vfs

npm i https://pkg.pr.new/@langchain/node-vfs@587

@langchain/quickjs

npm i https://pkg.pr.new/@langchain/quickjs@587

commit: 45ed871

@Oscar-Umana Oscar-Umana changed the title implement default middleware systemprompt override feat(deepagents): implement default middleware systemprompt override Jun 9, 2026
@changeset-bot

changeset-bot Bot commented Jun 9, 2026

Copy link
Copy Markdown

⚠️ No Changeset found

Latest commit: 45ed871

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@Oscar-Umana

Copy link
Copy Markdown
Author

Hi Christian Bromann (@christian-bromann) what would be the process to get some reviews on this PR?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant