Repository navigation
chat: clean up canceled automatic migrations - #340596
Merged
Ross Wollman (rwoll) merged 2 commits intoOct 8, 2026
Merged
Conversation
Delete the rebound destination and release its provisional ownership if the source is hidden or switched during materialization. Publish its alias and materialized state only after the final visibility check. Preserve the original chat and surface cleanup failures. *🤖 Authored with GitHub Copilot on behalf of @rwoll.* Co-authored-by: Copilot <[email protected]>
Contributor
There was a problem hiding this comment.
🟡 Changes recommended
Success-path tests do not verify the moved alias and publication calls.
1 open finding
What changed in this PR
Cleans up unopened Copilot sessions when automatic Local-chat migration is cancelled.
Changes:
- Deletes materialized destinations before cancellation.
- Delays alias publication and adds cancellation regression tests.
| File | Description |
|---|---|
chatContinueInAction.ts |
Cleans up cancelled migration destinations. |
chatContinueInCopilotAction.test.ts |
Tests cancellation during materialization and cleanup failures. |
🧠 Review effort: Balanced
💡 Configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Paul (pwang347)
previously approved these changes
Oct 8, 2026
Include alias registration and materialization notification in the success snapshot, with neither emitted for the empty-chat path. *🤖 Authored with GitHub Copilot on behalf of @rwoll.* Co-authored-by: Copilot <[email protected]>
Aaron Munger (amunger)
approved these changes
Oct 8, 2026
Connor Peet (connor4312)
approved these changes
Oct 8, 2026
Connor Peet (connor4312)
left a comment
Member
There was a problem hiding this comment.
No confirmed actionable P1/P2 security or correctness issues found in the reviewed changes.
Written by Connor's agent running GPT-6.1 Sol
Ross Wollman (rwoll)
enabled auto-merge
October 8, 2026 23:06
Ross Wollman (rwoll)
deleted the
rwoll/cleanup-cancelled-chat-migration
branch
October 8, 2026 23:29
Ross Wollman (rwoll)
added a commit
that referenced
this pull request
Oct 9, 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. --> Supersedes #340408. Builds on the automatic migration and cleanup in #340585 and #340596. Any nonempty managed `permissions` object now requires Copilot Agent Host, including defaults, explicit `false` / `"enable"`, and empty rule lists. This reuses the existing Local chat migration without sending anything automatically. Copilot's permission picker reflects runtime restrictions and defaults, allowing admins to block Allow All while keeping Assisted available. Explicit new mode restrictions replace the legacy blanket restriction; `defaultMode` alone does not. Empty `permissions: {}` and legacy policy alone retain existing Local behavior. Editor Inline Chat keeps its limited read/edit exception. Sandboxing remains independent. ## Policy behavior **Legacy `ChatToolsAutoApprove: false` with no managed permissions still blocks both Allow All and Assisted in Copilot Agent Host.** It does not force users off Local. A nonempty `permissions` object determines harness eligibility; only an explicit new mode restriction replaces the legacy blanket mode restriction. The table shows selectable modes, not the starting selection. It assumes all modes are supported and no additional restrictions. Legacy JSON represents policy values, not OS-specific deployment syntax. Local does not support Assisted. | # | Legacy policy JSON | Managed-settings JSON | Full Local chat | AH: Allow All | AH: Assisted | AH: Manual | |---|---|---|---|:---:|:---:|:---:| | 1 | `{}` | `{}` | Available | ✅ | ✅ | ✅ | | 2 | `{"ChatToolsAutoApprove":false}` | `{}` | Available, legacy restrictions | ❌ | ❌ | ✅ | | 3 | `{}` | `{"permissions":{"disableBypassPermissionsMode":"disable"}}` | Migrate to Copilot | ❌ | ✅ | ✅ | | 4 | `{"ChatToolsAutoApprove":false}` | `{"permissions":{"disableBypassPermissionsMode":"disable"}}` | Migrate to Copilot | ❌ | ✅ | ✅ | | 5 | `{}` | `{"permissions":{"disableAssistedPermissionsMode":true}}` | Migrate to Copilot | ✅ | ❌ | ✅ | | 6 | `{"ChatToolsAutoApprove":false}` | `{"permissions":{"disableAssistedPermissionsMode":true}}` | Migrate to Copilot | ✅ | ❌ | ✅ | | 7 | `{"ChatToolsAutoApprove":false}` | `{"permissions":{"disableBypassPermissionsMode":"disable","disableAssistedPermissionsMode":true}}` | Migrate to Copilot | ❌ | ❌ | ✅ | | 8 | `{"ChatToolsAutoApprove":false}` | `{"permissions":{"disableBypassPermissionsMode":"enable"}}` | Migrate to Copilot | ✅ | ✅ | ✅ | | 9 | `{"ChatToolsAutoApprove":false}` | `{"permissions":{"disableAssistedPermissionsMode":false}}` | Migrate to Copilot | ✅ | ✅ | ✅ | | 10 | `{}` | `{"permissions":{"defaultMode":"assisted"}}` | Migrate to Copilot | ✅ | ✅ | ✅ | | 11 | `{"ChatToolsAutoApprove":false}` | `{"permissions":{"defaultMode":"assisted"}}` | Migrate to Copilot | ❌ | ❌ | ✅ | | 12 | `{"ChatToolsAutoApprove":false}` | `{"permissions":{"ask":[]}}` | Migrate to Copilot | ❌ | ❌ | ✅ | `permissions: {}` behaves like no permissions object. Rows 6, 8, and 9 intentionally replace the legacy restriction with the explicitly configured new mode controls. Rows 11 and 12 require Agent Host but retain the legacy mode restriction. In row 10, Assisted is the starting default unless an explicit or remembered choice takes precedence; in row 11 it is unavailable, so the default falls back to Manual. “Migrate to Copilot” means full Local execution is unavailable: new chats use Copilot and existing Local chats migrate when displayed. The editor-inline exception above remains. Managed `sandbox.enabled: true` independently requires Agent Host even when permissions are absent. ## Testing Test with only `permissions.disableBypassPermissionsMode: "disable"`: full Local chats should move to Copilot, Allow All should be unavailable, and Assisted should remain selectable. Also test policy removal and an empty permissions object. Relates #338932. Relates microsoft/vscode-internalbacklog#9987. *🤖 Authored with GitHub Copilot on behalf of @rwoll.*
2 tasks done
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.

Followup to #340585 addressing review feedback.
If the user switches away while an automatic migration is creating the Copilot
session, delete that unopened destination before cancelling. Keep the original
Local chat untouched and avoid publishing the cancelled destination.
Relates #338932.
Relates https://github.com/microsoft/vscode-internalbacklog/issues/9987.
🤖 Authored with GitHub Copilot on behalf of Ross Wollman (@rwoll).