chore(sdk): unify sync subagents and async subagents into a single property#326
Merged
Colin Francis (colifran) merged 27 commits intomainfrom Mar 20, 2026
Merged
Conversation
🦋 Changeset detectedLatest commit: 6992539 The changes in this PR will be included in the next version bump. This PR includes changesets to release 3 packages
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 |
commit: |
Christian Bromann (christian-bromann)
approved these changes
Mar 19, 2026
Member
Christian Bromann (christian-bromann)
left a comment
There was a problem hiding this comment.
Nice 👌
Hunter Lovell (hntrl)
approved these changes
Mar 20, 2026
a807e1c to
6992539
Compare
Merged
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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Unifies the
subagentsandasyncSubAgentsparams oncreateDeepAgentinto a singlesubagentsarray. Previously, sync and async subagents had to be passed separately. Now both go in the same array and are split at runtime using theisAsyncSubAgenttype guard, which checks for the presence ofgraphId. The standalone middleware functions (createSubAgentMiddleware,createAsyncSubAgentMiddleware) are unchanged. This only affects thecreateDeepAgentconvenience API.Changes
AnySubAgenttype alias (SubAgent | CompiledSubAgent | AsyncSubAgent) andisAsyncSubAgenttype guardTSubagentsgeneric bound toreadonly AnySubAgent[]asyncSubAgentsparam fromCreateDeepAgentParamscreateDeepAgent, passing sync subagents tocreateSubAgentMiddlewareand async subagents tocreateAsyncSubAgentMiddlewareAnySubAgentandisAsyncSubAgentfrom package indexExample