Repository navigation
agentHost: don't allow moving a chat that hasn't sent a message - #344057
Merged
Sandeep Somavarapu (sandy081) merged 3 commits intoOct 26, 2026
Merged
Conversation
A nested chat whose first message was never sent (the New Nested Session composer) is no longer advertised as movable, and every host move path (move, reorder, move session, promote, move_session tool) refuses it with NotStarted. The client also blocks untitled chats. Fixes #343966 Co-authored-by: Copilot <[email protected]>
Contributor
📬 CODENOTIFYThe following users are being notified based on files changed in this PR: Ladislau Szomoru (@lszomoru)Matched files:
|
Contributor
There was a problem hiding this comment.
🟡 Changes recommended
Move eligibility can remain stale after remote activity, history changes, or lazy hydration, leaving client actions inconsistent with host validation.
3 open issues
What changed in this PR
Prevents unsent chats from being moved in the Agent Host and Agents Window, addressing the composer-switching behavior in #343966. Chats become movable once their first turn starts.
Changes:
- Adds host-side eligibility and validation checks for unsent chats.
- Blocks client move actions for untitled chats and generalizes refusal messages.
- Adds regression coverage and updates existing move tests to use started chats.
| File | Description |
|---|---|
src/vs/sessions/services/sessions/test/browser/sessionsManagementService.test.ts |
Tests the client guard for untitled chats. |
src/vs/sessions/services/sessions/browser/sessionsManagementService.ts |
Rejects move eligibility for untitled chats. |
src/vs/sessions/contrib/sessions/test/browser/sessionsListContextMenu.test.ts |
Updates expected move-refusal messages. |
src/vs/sessions/contrib/providers/agentHost/test/browser/agentHostChatMoveErrors.test.ts |
Updates refusal-message coverage. |
src/vs/sessions/contrib/providers/agentHost/browser/agentHostChatMoveErrors.ts |
Generalizes the localized unsent-chat refusal. |
src/vs/platform/agentHost/test/node/agentService.test.ts |
Tests unsent-chat refusals and adjusts move fixtures. |
src/vs/platform/agentHost/test/node/agentHostChatMovability.test.ts |
Tests eligibility before and during the first turn. |
src/vs/platform/agentHost/node/shared/sessionMoveTools.ts |
Generalizes the tool’s refusal message. |
src/vs/platform/agentHost/node/agentService.ts |
Validates that a chat has started before moving. |
src/vs/platform/agentHost/node/agentHostChatMovability.ts |
Computes unsent-chat eligibility and refreshes it on turn start. |
src/vs/platform/agentHost/common/agentHostChatMove.ts |
Adds notStarted to shared move eligibility. |
Review effort: Balanced
…te first messages Recompute movability on truncation, loaded turns and lazy hydration of restored chats, and stop presenting a peer chat as Untitled once the host reports a turn sent by another client. Co-authored-by: Copilot <[email protected]>
Ladislau Szomoru (lszomoru)
previously approved these changes
Oct 24, 2026
Sandeep Somavarapu (sandy081)
disabled auto-merge
October 24, 2026 15:48
A peer chat that never ran a turn is no longer movable, and the conformance tier cannot run a turn. Expect the unsent peer as not movable in the refusal scenario and drop the archive scenario, which the movability unit test covers. Co-authored-by: Copilot <[email protected]>
Ladislau Szomoru (lszomoru)
approved these changes
Oct 24, 2026
Sandeep Somavarapu (sandy081)
enabled auto-merge (squash)
October 26, 2026 10:46
auto-merge was automatically disabled
October 26, 2026 14:43
Pull request was closed
Sandeep Somavarapu (sandy081)
deleted the
agents/unsent-nested-not-movable
branch
October 26, 2026 15:32
Christof Marti (chrmarti)
added a commit
that referenced
this pull request
Oct 26, 2026
<!-- Thank you for submitting a Pull Request. Please: * Read our Pull Request guidelines: https://github.com/microsoft/vscode/wiki/How-to-Contribute#pull-requests * Associate an issue with the Pull Request. * Ensure that the code is up-to-date with the `main` branch. * Include a description of the proposed changes and how to test them. --> ## Summary - Rename **Manage...** in the Environment picker to **Manage Remote Environments...**. - Align the setting description and chat/Remotes accessibility help with the new label. - Preserve the command, visibility gates, selected environment, and per-host Manage submenus. Rebased onto `origin/release/1.144` at `62620115296` to avoid the unrelated chat-move test regression introduced on main by #344057 (`13832cc4487`). The diff remains the same six-file label-only change. Follow-up to the release backports #344266 and #344313; related to #344263. ## Validation - `npm run build-fast -- --client-only` - passed after rebasing onto release/1.144. - Focused picker and accessibility tests on release/1.144 - **79 passing**: ```powershell .\scripts\test.bat --run src\vs\sessions\contrib\chat\test\browser\sessionEnvironmentPicker.test.ts --run src\vs\sessions\contrib\chat\test\browser\sessionsChatAccessibilityHelp.test.ts --reporter dot ``` - Release-diff ESLint and hygiene - **6 files passed**; whitespace check passed: ```powershell $files = @(git diff --name-only origin/release/1.144...HEAD -- '*.ts') npm run eslint -- $files node build\hygiene.ts $files git diff --check origin/release/1.144...HEAD ``` This is a string-only change; full type-check and smoke/integration suites were not run. ## Manual check Open the Environment picker, select **Manage Remote Environments...**, and verify Remotes management opens without changing the selected environment.
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 #343966
A new nested session that was never sent (the New Nested Session composer) could be moved by drag and drop, Move Up/Down, Promote and the
move_sessiontool, which swapped its composer. Per the decision on #343966, a chat that hasn't sent its first message can't be moved by any path, and becomes movable once its first turn starts (a chat mid-first-turn is movable).Host (authoritative)
IChatMoveEligibility.notStarted: a chat with loaded state and no turns and no active turn isn't advertisedmovable; recomputed onChatTurnStarted._checkChatStartedrefuses move, reorder, move session and themove_sessionpre-check with the existingNotStartedrefusal; Promote keeps its own check. Reworded host/tool/client messages beyond "promotion".Client
sessionsManagementService.canMoveChatalso refuses an untitled chat, so hosts without this fix (remote/older) don't offer drag, Move Up/Down or Promote for it.Intended behavior change in existing tests (moving a never-run chat now needs a turn first; this is the #343966 decision):
agentService.test.ts: chat/session creations in the move tests now use started helpers (createStartedChat/createStartedSession);MovingAgentrestores one message; expectations adjusted in "a chat promotes only once its first turn started", the "deleting a chat that never moved" peer helper, "work deferred until a chat's turn ends", "checks a move as the host would refuse it", and the D4 confirmation test.agentHostChatMovability.test.ts:addStartedChathelper for existing tests.agentHostChatMoveErrors.test.ts,sessionsListContextMenu.test.ts: new message text.New tests: every move path refuses an unsent chat and allows it after the first turn (agentService); movable once the first turn started, including while running (movability); untitled chat not movable on the client (sessionsManagementService). Each fails without its fix (mutation-checked).
Validation (whole folders):
platform/agentHost/test/node13466 passing;sessions/contrib/sessions/test/browser1005;sessions/contrib/providers/agentHost/test/browser1065;sessions/services/sessions/test/browser657; eslint andtypecheck-clientclean. Live (isolated Code - OSS Agents window): an unsent New Nested Session row has no Promote to Session, Move Up/Down or other move entries, and dragging it onto another row moves nothing; after sending one message the row offers Promote to Session. Not covered live: the move_session refusal and nesting an unsent-only session (the agent cannot see the unsent draft; covered by unit tests). Base-build repro of the composer swap was not done.