Repository navigation
Agents: allow nesting a session whose default chat ran subagents - #343216
Merged
Sandeep Somavarapu (sandy081) merged 1 commit intoOct 21, 2026
Merged
Conversation
canMoveSessionUnder counted subagent (tool-origin) chats, so a session with only its default chat plus that chat's subagents was not offered as a nest drop and moveSessionUnder refused it locally. The host already moves the default chat's subtree and excludes tool chats from the single-chat check, so count only non-tool chats. Addresses the review comment on #342546. Co-authored-by: Copilot <[email protected]>
Contributor
There was a problem hiding this comment.
Warning
Copilot couldn't run its full agentic review because it didn't start before the timeout. Make sure your repository has a runner available, or add a copilot-code-review.yml file specifying one with the runs-on attribute. See the docs for more details.
Copilot review overview
1 open issue
What changed in this PR
Adjusts session nest-drop eligibility so sessions remain nestable even when their default chat spawned subagent/tool chats, matching host behavior.
Changes:
- Update
canMoveSessionUnderto ignore tool-origin chats when determining “single-chat” sessions. - Extend the existing nest-eligibility test to cover a session with a default chat plus a subagent/tool chat.
| File | Description |
|---|---|
| src/vs/sessions/contrib/providers/agentHost/test/browser/localAgentHostSessionsProvider.test.ts | Adds a test case to ensure sessions with subagent/tool chats are still eligible for nesting. |
| src/vs/sessions/contrib/providers/agentHost/browser/baseAgentHostSessionsProvider.ts | Changes eligibility logic to count only non-tool chats as “chats” for nesting. |
Review effort: Lite
| // Subagent chats don't count: the host moves them with the default chat that started them. | ||
| return !!cached && !!connection && supportsAgentHostSessionMove(connection.initializeResult.get()) | ||
| && !cached.isArchived.get() && cached.chats.get().length === 1; | ||
| && !cached.isArchived.get() && cached.chats.get().filter(chat => chat.origin?.kind !== ChatOriginKind.Tool).length === 1; |
Benjamin Christopher Simmonds (benibenj)
approved these changes
Oct 21, 2026
Sandeep Somavarapu (sandy081)
deleted the
agents/nest-session-with-subagents
branch
October 21, 2026 13:26
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.

Addresses the unaddressed Copilot review comment on #342546.
canMoveSessionUnderrequiredchats.length === 1, but a session's chat list also holds the subagent (tool-origin) chats its default chat started. So a session that had run a subagent was not offered as a nest drop in the Agents window, andmoveSessionUnderrefused it locally. The host already allows this: it moves the default chat's whole subtree and leaves tool chats out of the single-chat check. The client now counts only non-tool chats.Test: the existing nest-eligibility test now includes a session with a default chat plus a subagent chat. It is eligible once the host can move sessions. With the old code, the test fails.
Validation
./scripts/test.sh --run …/localAgentHostSessionsProvider.test.ts --run …/sessionsList.test.ts: 815 passing, 0 failingnpm run eslinton the changed files: clean; hygiene (pre-commit): passed