Repository navigation
chat: require Agent Host for managed sandbox and permission rules - #340529
Merged
Ross Wollman (rwoll) merged 7 commits intoOct 8, 2026
Merged
Ross Wollman (rwoll) merged 7 commits into
Ross Wollman (rwoll) merged 7 commits into
Conversation
Keep existing Local conversations read-only under enforced policy. Offer a transcript-preserving move to Copilot without sending, and archive the source only after the destination opens successfully. Validated policy routing and recovery with targeted tests, client build, type-check, and lint. Local PR and TPI drafts are intentionally excluded. 🤖 Authored with GitHub Copilot on behalf of @rwoll. Co-authored-by: Copilot <[email protected]>
Distinguish migration from new-chat recovery and panel from editor. Count coalesced attempts once and record success only after opening and source archival. Record bounded outcomes without policy payloads, chat contents, identifiers, or raw errors. Validation: 95 targeted tests passed, 4 pending; client build, type-check, and targeted lint passed. 🤖 Authored with GitHub Copilot on behalf of @rwoll. Co-authored-by: Copilot <[email protected]>
Keep migration preparation in the recovery action and reuse the existing top read-only banner. Preserve ordinary archived Local behavior when policy is removed and avoid waiting for policy when restoring populated history. Release imported sessions from temporary-draft ownership after successful opening so navigating away before sending does not delete them. Keep policy checks before MCP startup and agent invocation, with lifecycle and race regression coverage. Validation: client build, type-check, targeted lint, recovery/service/widget/editor tests, and 122 migration/lifecycle tests passed. User verified the flow end to end. 🤖 Authored with GitHub Copilot on behalf of @rwoll. Co-authored-by: Copilot <[email protected]>
Bring the draft branch current while preserving the reviewed recovery and telemetry checkpoints. 🤖 Authored with GitHub Copilot on behalf of @rwoll. Co-authored-by: Copilot <[email protected]>
This comment was marked as outdated.
This comment was marked as outdated.
Bind the chat editor to the resolved session's agent after policy redirects or provider fallback. Keep the agreed editor-inline read/edit exception without exempting panel or terminal Local sessions. Fix CI by initializing the managed policy observable in the constructor and completing the inline-chat fixture mock. No screenshot baselines changed. Split/copy routing and other migration edge cases remain deferred. Validation: initialization-order check, targeted lint and hygiene passed; focused policy/widget suites passed; final editor suite 24 passing. Both inline fixture variants render in Light and Dark without errors. 🤖 Authored with GitHub Copilot on behalf of @rwoll. Co-authored-by: Copilot <[email protected]>
Apply the repository TypeScript formatter to the recovery tests. Hygiene passes across all 31 changed TypeScript files in the PR; no behavior or screenshot baselines changed. 🤖 Authored with GitHub Copilot on behalf of @rwoll. Co-authored-by: Copilot <[email protected]>
Ross Wollman (rwoll)
marked this pull request as ready for review
October 8, 2026 17:56
roblourens
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.
Reviewed the full diff and relevant repository context at 5778ffe. No additional actionable P1/P2 defects found beyond the explicitly accepted/deferred limitations already discussed in the review threads. Static review only; no validation run or checkout changes.
Ross Wollman (rwoll)
enabled auto-merge (squash)
October 8, 2026 18:23
Ross Wollman (rwoll)
deleted the
rwoll/managed-permission-rules-require-agent-host
branch
October 8, 2026 18:39
Ross Wollman (rwoll)
added a commit
that referenced
this pull request
Oct 8, 2026
Followup to #340529 based on user feedback. When an organization requires Agent Host for managed sandboxing or permission rules, opening an existing Local chat now automatically moves it to Copilot instead of requiring the user to click **Move to Copilot**. 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.
Local, Claude, and Codex harnesses cannot enforce certain Enterprise Managed Settings (e.g. non-empty
permissions.ask,permissions.allow, orpermissions.denylists, orsandbox.enabled: true)while Copilot Agent Host can.
When an organization has incompatible settings enabled, we need to deal with older chats
that were started in an unsupported harness:
Local:
A banner at the top reads:
If the user clicks the migration button in the banner, VS Code automatically:
shows the normal read-only banner while the policy requirement remains, without another migration button.
We do not migrate the model choice or permission settings. Instead, the new chat uses its normal defaults
under current organization policy, and the user can change them in the pickers where permitted.
Claude and Codex: completely disabled and filtered out from the sidebar/Sessions list. Based on offline
discussion we've chosen to preserve this existing behavior. Making their transcripts available without
re-enabling execution needs separate read-only support that is out of scope here. It's not 100% ideal,
but is a tradeoff.
Inline Chat: still available since it's a widely used feature and only uses limited tools.
Terminal Chat: disabled.
Demos
Migration banner:
Post-Migration: new and archived chat:
End to End Video:
ems-demo-migration.mov
Editor inline chat's limited read/edit flow remains available as an explicit exception. This gate does not enforce runtime permission rules on inline edits; Local-backed terminal chat remains subject to the requirement.
Resolves #338932.
Resolves https://github.com/microsoft/vscode-internalbacklog/issues/9987.
Manual Testing
Launch VS Code (without any Enterprise Managed Settings), and start a few chats with Local and any enabled Claude/Codex
harnesses. The following settings restore the Local choice (though they won't work if enterprise policy forcibly disables it):
{ "chat.editor.localAgent.enabled": true, "chat.editor.preferCopilotHarness": false, "chat.defaultToCopilotHarness": false }Apply an Enterprise Managed Policy with at least something like:
{ "permissions": { "ask": ["Shell"] } }Run Developer: Sync Account Policy and confirm the effective policy in Developer: Policy Diagnostics.
Local chats should show the migration banner; Claude/Codex sessions remain hidden while disabled.
Before starting the destination chat, run Developer: Restart Local Agent Host so its runtime picks up the changed policy.
Click Move to Copilot. Confirm the transcript and draft arrive without sending, the original is archived,
and the new conversation stays in history when switching back to the original before sending.
The migration and navigation flow was manually verified. After the CI/review fixes:
npm run build-fast -- --client-only: passed.npm run define-class-fields-check: passed.npm run eslint -- ...and staged-filenode build/hygiene.ts: passed../node_modules/.bin/component-explorer render --project ./test/componentFixtures/component-explorer.json --fixture-id-regex '^editor/inlineChatZoneWidget/InlineChatZoneWidget(Terminated)?/(Light|Dark)$': all four fixtures rendered without errors. No baseline hashes or PNGs were committed.🤖 Authored with GitHub Copilot on behalf of Ross Wollman (@rwoll).