Skip to content

chore(sdk): unify sync subagents and async subagents into a single property#326

Merged
Colin Francis (colifran) merged 27 commits intomainfrom
colifran/async-subagent-ux
Mar 20, 2026
Merged

chore(sdk): unify sync subagents and async subagents into a single property#326
Colin Francis (colifran) merged 27 commits intomainfrom
colifran/async-subagent-ux

Conversation

@colifran
Copy link
Copy Markdown
Contributor

@colifran Colin Francis (colifran) commented Mar 19, 2026

Summary

Unifies the subagents and asyncSubAgents params on createDeepAgent into a single subagents array. Previously, sync and async subagents had to be passed separately. Now both go in the same array and are split at runtime using the isAsyncSubAgent type guard, which checks for the presence of graphId. The standalone middleware functions (createSubAgentMiddleware, createAsyncSubAgentMiddleware) are unchanged. This only affects the createDeepAgent convenience API.

Changes

  • Add AnySubAgent type alias (SubAgent | CompiledSubAgent | AsyncSubAgent) and isAsyncSubAgent type guard
  • Widen TSubagents generic bound to readonly AnySubAgent[]
  • Remove asyncSubAgents param from CreateDeepAgentParams
  • Split the unified array at runtime in createDeepAgent, passing sync subagents to createSubAgentMiddleware and async subagents to createAsyncSubAgentMiddleware
  • Export AnySubAgent and isAsyncSubAgent from package index

Example

// Before
createDeepAgent({
  subagents: [syncAgent],
  asyncSubAgents: [asyncAgent],
})

// After
createDeepAgent({
  subagents: [syncAgent, asyncAgent],
})

@changeset-bot
Copy link
Copy Markdown

changeset-bot bot commented Mar 19, 2026

🦋 Changeset detected

Latest commit: 6992539

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 3 packages
Name Type
deepagents Patch
deepagents-acp Patch
@deepagents/evals Patch

Not sure what this means? Click here to learn what changesets are.

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

@pkg-pr-new
Copy link
Copy Markdown

pkg-pr-new bot commented Mar 19, 2026

Open in StackBlitz

npm i https://pkg.pr.new/deepagents-acp@326
npm i https://pkg.pr.new/deepagents@326
npm i https://pkg.pr.new/@langchain/sandbox-standard-tests@326

commit: 6992539

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Nice 👌

Base automatically changed from colifran/async-subagents to main March 20, 2026 21:31
@colifran Colin Francis (colifran) merged commit ab85866 into main Mar 20, 2026
15 checks passed
@colifran Colin Francis (colifran) deleted the colifran/async-subagent-ux branch March 20, 2026 21:45
@github-actions github-actions bot mentioned this pull request Mar 20, 2026
Colin Francis (colifran) added a commit that referenced this pull request Mar 24, 2026
…operty (#326)

* launch tool, check tool

* update tool and cancel tool

* update and cancel tool tests

* list async subagent jobs tool

* list subagent jobs tool and create middleware

* wire in async subagents

* create and use state schema, update message to messages

* tests

* AsyncSubagent -> AsyncSubAgent

* fix import

* bug fixes

* fix exports

* refactor for sync and async subagents as a single entry point

* fix tool names

* restore processed subagent var name

* fix bug

* adjust tool names and tests

* add createdAt, updatedAt, and checkAt fields

* add a changeset

* job->task

* SubAgent->subagent in docstrings

* update tool names

* use tool runtime

* update naming to match async task naming convention

* remove extra custom middleware added during merge conflicts

* launch_async_task->start_async_task

* buildLaunchTool->buildStartTool
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.

3 participants