Skip to content

Add MultiAgentV2 root and subagent context hints#19805

Open
jif-oai wants to merge 1 commit intomainfrom
jif/hint-ma-v2
Open

Add MultiAgentV2 root and subagent context hints#19805
jif-oai wants to merge 1 commit intomainfrom
jif/hint-ma-v2

Conversation

@jif-oai
Copy link
Copy Markdown
Collaborator

@jif-oai jif-oai commented Apr 27, 2026

Why

MultiAgentV2 sessions need startup guidance that matches the role of the thread that is actually being created. Root agents and subagents have different responsibilities, and forked subagents can inherit parent rollout history. If the parent hint is carried into the child context, the child can see stale or conflicting developer guidance before its own session-specific context is added.

What changed

  • Added features.multi_agent_v2.root_agent_usage_hint_text and features.multi_agent_v2.subagent_usage_hint_text config fields, including schema/config parsing support.
  • Injected the matching root or subagent hint into the initial context as its own developer message when multi_agent_v2 is enabled.
  • Filtered configured MultiAgentV2 usage-hint developer messages out of forked parent history so a child thread receives fresh guidance for its own session source/config.
  • Added targeted coverage for config parsing, initial-context rendering, feature-config deserialization, and forked-history filtering.

Context examples

With this config:

[features.multi_agent_v2]
enabled = true
root_agent_usage_hint_text = "Root guidance."
subagent_usage_hint_text = "Subagent guidance."

A root thread initial context renders the root hint as a standalone developer message:

[developer]
<existing developer context, when present>

[developer]
Root guidance.

A subagent thread initial context renders the subagent hint instead:

[developer]
<existing developer context, when present>

[developer]
Subagent guidance.

When a subagent forks parent history, any parent developer message whose text exactly matches the configured MultiAgentV2 root or subagent hint is omitted from the forked history before the child receives its fresh subagent hint.

@jif-oai jif-oai requested a review from a team as a code owner April 27, 2026 11:40
@jif-oai jif-oai changed the title feat: usage hint on multi-agents v2 Add MultiAgentV2 root and subagent context hints Apr 27, 2026
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