Repository navigation
agentHost: move never-run nested sessions and sessions not yet loaded - #342546
Merged
Sandeep Somavarapu (sandy081) merged 4 commits intoOct 19, 2026
Merged
Conversation
A legacy peer row that never recorded a read state has a NULL is_read, which means read. The catalog normalizer compared it strictly to the verified per-chat source (isRead: true for a new chat) and refused the move with sessionNotReady. Treat NULL as read. Co-authored-by: Copilot <[email protected]>
moveSession restores an unloaded source (and destination) before its checks, reusing the restore moveChat uses, so a refusal reaches the user as the usual warning. The client offers the nest drop for any unarchived single-chat session from list data alone instead of relying on vscode.movable, which the host publishes only for loaded sessions. Co-authored-by: Copilot <[email protected]>
…e provider doc Co-authored-by: Copilot <[email protected]>
…rom an unread aggregate Co-authored-by: Copilot <[email protected]>
Federico Brancasi (federicobrancasi)
approved these changes
Oct 19, 2026
Contributor
There was a problem hiding this comment.
🟡 Changes recommended
Subagent eligibility and source residency protection need correction before approval.
2 open issues
What changed in this PR
Fixes Move Chats for never-run nested chats and sessions not yet loaded by the Agent Host.
Changes:
- Treats missing legacy read state as read during catalog normalization.
- Restores unloaded sessions at move time and derives client eligibility from cached list data.
- Adds regression tests and updates provider documentation.
| File | Description |
|---|---|
| src/vs/sessions/contrib/providers/agentHost/test/browser/localAgentHostSessionsProvider.test.ts | Tests list-based move eligibility. |
| src/vs/sessions/contrib/providers/agentHost/browser/baseAgentHostSessionsProvider.ts | Updates session move eligibility. |
| src/vs/sessions/contrib/providers/agentHost/AGENT_HOST_SESSIONS_PROVIDER.md | Documents load-at-move behavior. |
| src/vs/sessions/common/agentHostSessionsProvider.ts | Updates eligibility contract documentation. |
| src/vs/platform/agentHost/test/node/agentService.test.ts | Tests unloaded-source moves and refusals. |
| src/vs/platform/agentHost/test/node/agentHostDatabase.test.ts | Tests missing legacy read-state handling. |
| src/vs/platform/agentHost/node/agentService.ts | Restores sessions before move validation. |
| src/vs/platform/agentHost/node/agentHostDatabase.ts | Normalizes missing legacy read state. |
Review effort: Balanced
Sandeep Somavarapu (sandy081)
deleted the
agents/fix-bug-f4-move-chats-feature
branch
October 19, 2026 14:12
This was referenced Oct 19, 2026
Sandeep Somavarapu (sandy081)
added a commit
that referenced
this pull request
Oct 21, 2026
…3216) 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]>
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.

Fixes two ways a nested session could not be moved with the Move Chats feature (behind
chat.agentHost.moveChats.enabled, default off).F4: a never-run peer chat could not be moved. A peer chat created by "New Nested Session" that never ran a turn has a legacy
session_chats.is_readof NULL (peer creation writes no read state), while the verified per-chat aggregate saysisRead: true(new chats are created idle and read). The catalog normalizer compared them strictly and refused the move withsessionNotReady("Legacy peer state differs from verified per-chat source"). A NULL legacyis_readnow reads as read; a real divergence (aggregate says unread) is still refused.Sessions the host has not loaded could not be nested. The host publishes
vscode.movableonly for sessions it has loaded, so after a restart a single-chat session reportedcanMoveSessionUnder=falseuntil opened, andmoveSessiondid not restore its source (onlymoveChatrestored its target). Design is "load at move time":canMoveSessionUnder): offers the nest for any unarchived single-chat session when the host supportsvscode.sessionMove, from list data alone. It no longer readsvscode.movable(which can only betrueor absent, so it cannot say "not movable"); no loading, no per-row subscriptions.moveSession(and the AHPmoveChatsource) restores an unloaded session inside the move sequencer via the existingrestoreSession, then runs the normal checks, so the usualAgentChatMoveRefusedErrorreaches the user. A session that can't be restored is refused (notMovable/sessionNotReady) with nothing changed. Host publishing ofvscode.movableis unchanged.How to test
Unit tests (all passing together, 1820 tests):
scripts/test.sh --run src/vs/platform/agentHost/test/node/agentService.test.ts --run src/vs/platform/agentHost/test/node/agentHostDatabase.test.ts --run src/vs/sessions/contrib/providers/agentHost/test/browser/localAgentHostSessionsProvider.test.ts→ 1820 passingnpm run eslint -- <changed .ts files>→ cleannpm run typecheck-client→ clean (no errors)Not run: Azure pipeline 111 e2e at the time of writing (queued after PR creation).