[GH-ISSUE #4200] [deepagents]: Subagents page incorrectly states general-purpose subagent has "the same system prompt as the main agent" #2789

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

Originally created by @AdemBoukhris457 on GitHub (May 29, 2026).
Original GitHub issue: https://github.com/langchain-ai/docs/issues/4200

Type of issue

issue / bug

Language

Python

Description

Issue

The Subagents page states:

  • Has the same system prompt as the main agent

This is incorrect. In libs/deepagents/deepagents/middleware/subagents.py, the general-purpose subagent uses DEFAULT_SUBAGENT_PROMPT:

DEFAULT_SUBAGENT_PROMPT = """In order to complete the objective that the user asks of you, you have access to a number of standard tools.

The calling agent only sees your final assistant message, not your intermediate work, tool results, or status tracking. Ensure your final
response contains the complete answer."""

And in libs/deepagents/deepagents/graph.py, the GP subagent's system prompt is assembled as:

general_purpose_spec["system_prompt"] = _apply_profile_prompt(
    _profile, GENERAL_PURPOSE_SUBAGENT["system_prompt"]
)

The user-supplied system_prompt= argument to create_deep_agent is not inherited by the general-purpose subagent. The GP subagent gets its own default prompt (DEFAULT_SUBAGENT_PROMPT) with profile overlays applied, which is different from the main agent's prompt assembly (USER + BASE or CUSTOM + SUFFIX).

The Customization page's "General-purpose subagent prompt" accordion explains this correctly—the subagents page should be updated to align with it.

Originally created by @AdemBoukhris457 on GitHub (May 29, 2026). Original GitHub issue: https://github.com/langchain-ai/docs/issues/4200 ### Type of issue issue / bug ### Language Python ### Description ## Issue The [Subagents page](https://docs.langchain.com/oss/python/deepagents/subagents#the-general-purpose-subagent) states: > * Has the same system prompt as the main agent This is incorrect. In `libs/deepagents/deepagents/middleware/subagents.py`, the general-purpose subagent uses `DEFAULT_SUBAGENT_PROMPT`: ```python DEFAULT_SUBAGENT_PROMPT = """In order to complete the objective that the user asks of you, you have access to a number of standard tools. The calling agent only sees your final assistant message, not your intermediate work, tool results, or status tracking. Ensure your final response contains the complete answer.""" ``` And in `libs/deepagents/deepagents/graph.py`, the GP subagent's system prompt is assembled as: ```python general_purpose_spec["system_prompt"] = _apply_profile_prompt( _profile, GENERAL_PURPOSE_SUBAGENT["system_prompt"] ) ``` The user-supplied `system_prompt=` argument to `create_deep_agent` is **not** inherited by the general-purpose subagent. The GP subagent gets its own default prompt (`DEFAULT_SUBAGENT_PROMPT`) with profile overlays applied, which is different from the main agent's prompt assembly (`USER` + `BASE` or `CUSTOM` + `SUFFIX`). The [Customization page's "General-purpose subagent prompt" accordion](https://docs.langchain.com/oss/python/deepagents/customization#prompt-assembly) explains this correctly—the subagents page should be updated to align with it.
yindo added the externaldeepagents labels 2026-06-05 17:26:47 -04:00
yindo closed this issue 2026-06-05 17:26:47 -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#2789