Agents web: auto-detect OS color scheme by default#314878
Merged
Merged
Conversation
Default `window.autoDetectColorScheme` to `true` for the agents window on web only, so vscode.dev/agents picks the user's preferred dark/light theme via `prefers-color-scheme` instead of always loading Light 2026. Scoped via `isWeb` so the desktop agents window and regular VS Code remain unchanged. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
dmitrivMS
approved these changes
May 7, 2026
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.
What
For the agents window on web (vscode.dev/agents) only, default
window.autoDetectColorSchemetotrueso the workbench picks Dark 2026 / Light 2026 based on the user'sprefers-color-schememedia query instead of always loading Light 2026.Why
After #314551 removed the welcome theme picker, vscode.dev/agents had no path to set a theme during onboarding, so users always landed on the web default theme (
Light 2026— seethemeConfiguration.tsline 37).BrowserHostColorSchemeServiceis already registered insessions.web.main.tsand the auto-detect machinery already exists, so flipping the default for the agents web target is the minimal change to get OS-aware theming back.How
agentsWindow.defaultoverrides are only consumed by the sessionsConfigurationService(SessionsDefaultConfiguration.getDefaultValueinsrc/vs/sessions/services/configuration/browser/configurationService.ts), so this affects only the agents window. The override is gated onisWebso the desktop agents window and regular VS Code keep their existing defaults.window.autoDetectColorSchemedefaultfalse(unchanged)false(unchanged)true(auto-detects)Users can still override via settings; this only changes the default, not
readOnly.Test plan
false(no auto-switching unless user opts in)false