feat(cli): support background subagents#9612
Draft
Githubguy132010 wants to merge 18 commits intoKilo-Org:mainfrom
Draft
feat(cli): support background subagents#9612Githubguy132010 wants to merge 18 commits intoKilo-Org:mainfrom
Githubguy132010 wants to merge 18 commits intoKilo-Org:mainfrom
Conversation
Refactor the `BackgroundSubagentClose` event definition to use `Schema.Struct` and `CloseReasonSchema` for better consistency. Update the SDK type definitions to include `EventSessionBackgroundSubagentClose` and reorganize `EventIndexingStatus` within the `GlobalEvent` and `Event` unions. Update tests to include the `background` property in session metadata and provide a mock implementation for the `background` method in `TaskPromptOps`.
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.
Context
Enable interactive CLI agents to delegate independent work to background subagents so the main agent can continue while child sessions run. This implements the v1 scope from #9611: model-initiated backgrounding, user notification, and parent-agent notification when the subagent finishes.
Implementation
tasktool withbackground?: booleanwhile preserving existing foreground behavior by default.metadata.backgroundalongsidemetadata.sessionId.Screenshots
How to Test
bun test test/tool/task.test.ts test/kilocode/tool-task-model.test.tsfrompackages/opencode/.bun run typecheckfrompackages/opencode/.task_id, the child session continues running, and a toast plus synthetic parent-session update appear when it finishes.Get in Touch
Open to feedback directly on this PR.
Fixes #9611