Skip to content

fix(sdk): pass parent state to async subagent invoke - #5464

Open
Hunter Lovell (hntrl) wants to merge 2 commits into
mainfrom
hunter/async-subagent-state
Open

fix(sdk): pass parent state to async subagent invoke#5464
Hunter Lovell (hntrl) wants to merge 2 commits into
mainfrom
hunter/async-subagent-state

Conversation

@hntrl

Copy link
Copy Markdown
Member

fixes #2440

  • refactors the state propagation logic for sync subagents to a shared utility
  • makes it so async subagents pass that state + the additional message as input to the graph run through langgraph sdk

This is technically a behavior change, but we're patching this over as a correctness issue since this is how sync subagents are also propagating state.

Co-authored-by: Henry Bradlow <1472046+hbradlow@users.noreply.github.com>
@github-actions github-actions Bot added deepagents Related to the `deepagents` SDK / agent harness fix A bug fix (PATCH) internal User is a member of the `langchain-ai` GitHub organization size: S 50-199 LOC labels Aug 13, 2026

@open-swe open-swe Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Open SWE Review found 1 potential issue.

Open in WebView Open SWE trace

Comment thread libs/deepagents/deepagents/middleware/_state.py Outdated
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

deepagents Related to the `deepagents` SDK / agent harness fix A bug fix (PATCH) internal User is a member of the `langchain-ai` GitHub organization size: S 50-199 LOC

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Async subagents option to pass certain state vars from the parent

1 participant