Skip to content

Implement experimental mode and permissions picker integration - #334972

Draft
Justin Chen (justschen) wants to merge 5 commits into
mainfrom
agents/experimental-mode-permissions-picker
Draft

Implement experimental mode and permissions picker integration#334972
Justin Chen (justschen) wants to merge 5 commits into
mainfrom
agents/experimental-mode-permissions-picker

Conversation

@justschen

Copy link
Copy Markdown
Collaborator

This pull request implements a new experimental mode and permissions picker for the agent host, inspired by the recent model picker design. Key changes include:

  • Picker Structure: The permissions picker is now integrated below the mode picker, with a flyout that opens directly above the selected label.
  • Visual Design: The mode label is the primary focus, with quieter, colored permission text. The permissions flyout is styled to match the main picker.
  • Iconography: A compact icon is used for the mode picker, and a gear icon has been added to access permission settings.
  • Hover Behavior: Individual hover affordances have been removed for a cleaner look, with a shared hover treatment for the entire control.
  • Accessibility: Keyboard navigation and focus behaviors have been refined to ensure smooth transitions between the mode and permissions menus.

The changes are gated behind the chat.experimentalModePermissionsPicker setting and are currently limited to the Copilot agent host. All modifications have been verified with extensive testing, ensuring functionality across different themes and environments.

Copilot AI balanced review requested due to automatic review settings September 7, 2026 21:11

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot review overview

🟡 Changes recommended

The combined picker has unresolved keyboard-focus, ARIA-state, and duplicate focus-restoration issues.

Once you've addressed the issues Copilot identified, you can request another Copilot review.

Review tier: Balanced
Findings: 3 Medium severity

New issues introduced by this change (3)
Severity Finding
Medium severity src/​vs/​sessions/​contrib/​providers/​agentHost/​browser/​agentHostModePicker.ts — In the Agents window, PickerActionViewItem.focus() always focuses the element returned by…
Medium severity src/​vs/​sessions/​contrib/​providers/​copilotChatSessions/​browser/​permissionPicker.ts — These rich-submenu actions call _selectItem, which hides the action widget before returning. The…
Medium severity src/​vs/​workbench/​contrib/​chat/​browser/​agentSessions/​agentHost/​agentHostChatInputPicker.ts — The submenu action calls _selectItem, whose first step hides the action widget.…
What changed in this PR

Adds an experimental combined mode and permissions picker for Copilot Agent Host sessions.

Changes:

  • Combines mode and permission controls with a permissions flyout and settings action.
  • Extends Action Widget with rich submenu support.
  • Adds accessibility guidance, styling, fixtures, and tests.
File Description
permissionPickerList.fixture.ts Updates sandbox icon fixture.
terminalContribExports.ts Exports additional permission settings.
agentHostChatInputPicker.test.ts Tests the combined editor picker.
constants.ts Defines the feature setting.
permissionPickerActionItem.ts Uses the shield sandbox icon.
chat.shared.contribution.ts Registers the experimental setting.
agentHostModePicker.css Styles the combined control and flyout.
agentHostModePickerPresentation.ts Adds shared presentation helpers.
agentHostChatInputPicker.ts Integrates the combined editor picker.
chatAccessibilityHelp.ts Documents picker keyboard usage.
permissionPicker.ts Exposes permission submenu items.
agentHostModePicker.test.ts Tests the Agents-window integration.
agentHostModePicker.fixture.ts Adds visual fixtures.
agentHostPermissionPickerDelegate.test.ts Updates test dependencies.
mobileAgentHostModePicker.ts Forwards new picker dependencies/options.
agentHostPermissionPickerDelegate.ts Adds combined-picker gating.
agentHostModePicker.ts Implements the combined Agents-window picker.
sessionsChatAccessibilityHelp.ts Adds combined-picker help.
actionList.test.ts Tests rich submenu behavior.
actionWidget.ts Supports dynamic submenu anchoring.
actionList.ts Implements rich action-list submenus.
Suppressed comments (1)

src/vs/sessions/contrib/providers/agentHost/browser/agentHostModePicker.ts:374

  • When the experimental setting or phone layout switches this existing trigger from combined back to the normal button, renderModePickerTrigger has already removed aria-expanded. This branch restores the role and popup type but not the collapsed state, leaving an unopened popup button without aria-expanded="false". Restore that attribute here as the base render path does.
			trigger.classList.remove('agent-host-mode-permissions-trigger');
			trigger.role = 'button';
			trigger.tabIndex = 0;
			trigger.ariaHasPopup = 'listbox';
			super._renderTriggerLabel(trigger, label, icon);

💡 Configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

@github-actions

github-actions Bot commented Sep 8, 2026

Copy link
Copy Markdown
Contributor

Screenshot Changes

Base: 9c99221b Current: edb9049c

Changed (132)

sessions/chat/input/chatInput/SessionsWindow/Dark
Before After
before after
sessions/chat/input/chatInput/SessionsWindow/Light
Before After
before after
sessions/chat/input/chatInput/SessionsWindowSelection/Dark
Before After
before after
sessions/chat/input/chatInput/SessionsWindowSelection/Light
Before After
before after
sessions/chat/input/chatInput/ResponsiveModelResizeCycleExpanded/Dark
Before After
before after
sessions/chat/input/chatInput/ResponsiveModelResizeCycleExpanded/Light
Before After
before after
sessions/chat/input/chatInput/ResponsiveModelResizeCycleEllipsized/Dark
Before After
before after
sessions/chat/input/chatInput/ResponsiveModelResizeCycleEllipsized/Light
Before After
before after
sessions/chat/input/chatInput/ResponsiveModelResizeCycleCompact/Dark
Before After
before after
sessions/chat/input/chatInput/ResponsiveModelResizeCycleCompact/Light
Before After
before after
sessions/chat/input/chatInput/ResponsiveModelResizeCycleMinimal/Dark
Before After
before after
sessions/chat/input/chatInput/ResponsiveModelResizeCycleMinimal/Light
Before After
before after
sessions/chat/newWidget/newChatWidget/NewSessionChatBackground/Dark
Before After
before after
sessions/chat/newWidget/newChatWidget/NewSessionChatBackground/Light
Before After
before after
sessions/chat/newWidget/newChatWidget/NewSessionBackgroundControls/Dark
Before After
before after
sessions/chat/newWidget/newChatWidget/NewSessionBackgroundControls/Light
Before After
before after
sessions/chat/newWidget/newChatWidget/NewSessionAutoModel/Dark
Before After
before after
sessions/chat/newWidget/newChatWidget/NewSessionAutoModel/Light
Before After
before after
sessions/chat/newWidget/newChatWidget/NewSessionCompactAutoModel/Dark
Before After
before after
sessions/chat/newWidget/newChatWidget/NewSessionCompactAutoModel/Light
Before After
before after
sessions/chat/newWidget/newChatWidget/NewSessionPhoneAttachedContext/Dark
Before After
before after
sessions/chat/newWidget/newChatWidget/NewSessionPhoneAttachedContext/Light
Before After
before after
sessions/permissionPickerList/SandboxToggleOff/Dark
Before After
before after
sessions/permissionPickerList/SandboxToggleOff/Light
Before After
before after
sessions/permissionPickerList/SandboxToggleOn/Dark
Before After
before after
sessions/permissionPickerList/SandboxToggleOn/Light
Before After
before after
sessions/permissionPickerList/SandboxToggleNarrow/Dark
Before After
before after
sessions/permissionPickerList/SandboxToggleNarrow/Light
Before After
before after
sessions/sessionChatInputToolbar/SessionChatView_ChangesPill/Dark
Before After
before after
sessions/sessionChatInputToolbar/SessionChatView_ChangesPill/Light
Before After
before after
sessions/sessionChatInputToolbar/SessionChatView_ChangesAndExternalPreview/Dark
Before After
before after
sessions/sessionChatInputToolbar/SessionChatView_ChangesAndExternalPreview/Light
Before After
before after
sessions/sessionChatInputToolbar/SessionChatView_ArtifactPillAndPermission/Dark
Before After
before after
sessions/sessionChatInputToolbar/SessionChatView_ArtifactPillAndPermission/Light
Before After
before after
sessions/sessionChatInputToolbar/SessionChatView_StackedInputSurfaces/Dark
Before After
before after
sessions/sessionChatInputToolbar/SessionChatView_StackedInputSurfaces/Light
Before After
before after
chat/input/chatInput/Default/Dark
Before After
before after
chat/input/chatInput/Default/Light
Before After
before after
chat/input/chatInput/WithSandboxing/Dark
Before After
before after
chat/input/chatInput/WithSandboxing/Light
Before After
before after
chat/input/chatInput/WithProviderIcon/Dark
Before After
before after
chat/input/chatInput/WithProviderIcon/Light
Before After
before after
chat/input/chatInput/CompactWithProviderIcon/Dark
Before After
before after
chat/input/chatInput/CompactWithProviderIcon/Light
Before After
before after
chat/input/chatInput/CopilotHarnessCompactPickers/Dark
Before After
before after
chat/input/chatInput/CopilotHarnessCompactPickers/Light
Before After
before after
chat/input/chatInput/WithArtifacts/Dark
Before After
before after
chat/input/chatInput/WithArtifacts/Light
Before After
before after
chat/input/chatInput/WithNotification/Dark
Before After
before after
chat/input/chatInput/WithNotification/Light
Before After
before after
chat/input/chatInput/WithNotificationAndTodos/Dark
Before After
before after
chat/input/chatInput/WithNotificationAndTodos/Light
Before After
before after
chat/input/chatInput/WithFileChanges/Dark
Before After
before after
chat/input/chatInput/WithFileChanges/Light
Before After
before after
chat/input/chatInput/WithTodos/Dark
Before After
before after
chat/input/chatInput/WithTodos/Light
Before After
before after
chat/input/chatInput/WithTodosAndFileChanges/Dark
Before After
before after
chat/input/chatInput/WithTodosAndFileChanges/Light
Before After
before after
chat/input/chatInput/WithArtifactsAndFileChanges/Dark
Before After
before after
chat/input/chatInput/WithArtifactsAndFileChanges/Light
Before After
before after
chat/input/chatInput/Full/Dark
Before After
before after
chat/input/chatInput/Full/Light
Before After
before after
chat/input/chatInput/VoiceDictationIdle/Dark
Before After
before after
chat/input/chatInput/VoiceDictationIdle/Light
Before After
before after
chat/input/chatInput/VoiceDictationRecording/Dark
Before After
before after
chat/input/chatInput/VoiceDictationRecording/Light
Before After
before after
chat/input/chatInput/VoiceDictationPreparing/Dark
Before After
before after
chat/input/chatInput/VoiceDictationPreparing/Light
Before After
before after
chat/input/chatInput/VoiceModeIdle/Dark
Before After
before after
chat/input/chatInput/VoiceModeIdle/Light
Before After
before after
chat/input/chatInput/VoiceModeConnecting/Dark
Before After
before after
chat/input/chatInput/VoiceModeConnecting/Light
Before After
before after
chat/input/chatInput/VoiceModeListening/Dark
Before After
before after
chat/input/chatInput/VoiceModeListening/Light
Before After
before after
chat/input/chatInput/VoiceModeSpeaking/Dark
Before After
before after
chat/input/chatInput/VoiceModeSpeaking/Light
Before After
before after
chat/input/chatInput/VoiceModeDisconnect/Dark
Before After
before after
chat/input/chatInput/VoiceModeDisconnect/Light
Before After
before after
chat/input/chatInput/WithPet/Dark
Before After
before after
chat/input/chatInput/WithPet/Light
Before After
before after
chat/input/chatInput/WithPetAndNotification/Dark
Before After
before after
chat/input/chatInput/WithPetAndNotification/Light
Before After
before after
chat/input/chatInput/WithPetAndNotificationAndTodos/Dark
Before After
before after
chat/input/chatInput/WithPetAndNotificationAndTodos/Light
Before After
before after
chat/input/permissionPickerList/CopilotSandboxToggleOff/Dark
Before After
before after
chat/input/permissionPickerList/CopilotSandboxToggleOff/Light
Before After
before after
chat/input/permissionPickerList/CopilotSandboxToggleOn/Dark
Before After
before after
chat/input/permissionPickerList/CopilotSandboxToggleOn/Light
Before After
before after
chat/chatSessionArchiveNudge/Folder/Dark
Before After
before after
chat/chatSessionArchiveNudge/Folder/Light
Before After
before after
chat/chatSessionArchiveNudge/Worktree/Dark
Before After
before after
chat/chatSessionArchiveNudge/Worktree/Light
Before After
before after
chat/chatSessionArchiveNudge/Narrow/Dark
Before After
before after
chat/chatSessionArchiveNudge/Narrow/Light
Before After
before after
chat/chatSessionArchiveNudge/WithSessionPills/Dark
Before After
before after
chat/chatSessionArchiveNudge/WithSessionPills/Light
Before After
before after
chat/chatSessionArchiveNudge/ExperimentalTitleAndIcon/Dark
Before After
before after
chat/chatSessionArchiveNudge/ExperimentalTitleAndIcon/Light
Before After
before after
chat/chatToolRiskBadge/GreenInContext/Dark
Before After
before after
chat/chatToolRiskBadge/GreenInContext/Light
Before After
before after
chat/chatToolRiskBadge/OrangeInContext/Dark
Before After
before after
chat/chatToolRiskBadge/OrangeInContext/Light
Before After
before after
chat/chatToolRiskBadge/RedInContext/Dark
Before After
before after
chat/chatToolRiskBadge/RedInContext/Light
Before After
before after
chat/chatToolRiskBadge/GreenElicitationInContext/Dark
Before After
before after
chat/chatToolRiskBadge/GreenElicitationInContext/Light
Before After
before after
chat/chatToolRiskBadge/OrangeElicitationInContext/Dark
Before After
before after
chat/chatToolRiskBadge/OrangeElicitationInContext/Light
Before After
before after
chat/chatToolRiskBadge/RedElicitationInContext/Dark
Before After
before after
chat/chatToolRiskBadge/RedElicitationInContext/Light
Before After
before after
chat/chatToolRiskBadge/BadgeOffInContext/Dark
Before After
before after
chat/chatToolRiskBadge/BadgeOffInContext/Light
Before After
before after
chat/chatToolRiskBadge/BadgeOffWithDisclaimerInContext/Dark
Before After
before after
chat/chatToolRiskBadge/BadgeOffWithDisclaimerInContext/Light
Before After
before after
chat/chatToolRiskBadge/BadgeOffUnsandboxedInContext/Dark
Before After
before after
chat/chatToolRiskBadge/BadgeOffUnsandboxedInContext/Light
Before After
before after
chat/chatToolRiskBadge/BadgeOffUnsandboxedWithDisclaimerInContext/Dark
Before After
before after
chat/chatToolRiskBadge/BadgeOffUnsandboxedWithDisclaimerInContext/Light
Before After
before after
chat/chatTurnPills/inChat/Changes/Dark
Before After
before after
chat/chatTurnPills/inChat/Changes/Light
Before After
before after
chat/chatTurnPills/inChat/ChangesWithExternalFileIgnored/Dark
Before After
before after
chat/chatTurnPills/inChat/ChangesWithExternalFileIgnored/Light
Before After
before after
chat/widget/chatWidget/SimpleQA/Dark
Before After
before after
chat/widget/chatWidget/SimpleQA/Light
Before After
before after
chat/widget/chatWidget/PendingToolApproval/Dark
Before After
before after
chat/widget/chatWidget/PendingToolApproval/Light
Before After
before after
chat/widget/chatWidget/CodeBlockInList/Dark
Before After
before after
chat/widget/chatWidget/CodeBlockInList/Light
Before After
before after
chat/widget/chatWidget/bugs/issue-309796-missing-backslash/Dark
Before After
before after
chat/widget/chatWidget/bugs/issue-309796-missing-backslash/Light
Before After
before after
chat/widget/chatWidget/MultiTurn/Dark
Before After
before after
chat/widget/chatWidget/MultiTurn/Light
Before After
before after

3 insignificant change(s) omitted (≤20 px, Δ≤2). See CI logs for details.

Added (24)

sessions/agentHostModePicker/Manual/Dark

current

sessions/agentHostModePicker/Manual/Light

current

sessions/agentHostModePicker/Assisted/Dark

current

sessions/agentHostModePicker/Assisted/Light

current

sessions/agentHostModePicker/AllowAll/Dark

current

sessions/agentHostModePicker/AllowAll/Light

current

sessions/agentHostModePicker/Sandboxed/Dark

current

sessions/agentHostModePicker/Sandboxed/Light

current

sessions/agentHostModePicker/Mode/Dark

current

sessions/agentHostModePicker/Mode/Light

current

sessions/agentHostModePicker/Permissions/Dark

current

sessions/agentHostModePicker/Permissions/Light

current

sessions/agentHostModePicker/AssistedPermissions/Dark

current

sessions/agentHostModePicker/AssistedPermissions/Light

current

sessions/agentHostModePicker/EditorMode/Dark

current

sessions/agentHostModePicker/EditorMode/Light

current

sessions/agentHostModePicker/EditorPermissions/Dark

current

sessions/agentHostModePicker/EditorPermissions/Light

current

sessions/agentHostModePicker/EditorAllowAllPermissions/Dark

current

sessions/agentHostModePicker/EditorAllowAllPermissions/Light

current

chat/input/chatInput/CopilotHarnessCombinedPickers/Dark

current

chat/input/chatInput/CopilotHarnessCombinedPickers/Light

current

chat/input/chatInput/CopilotHarnessCombinedCompactPickers/Dark

current

chat/input/chatInput/CopilotHarnessCombinedCompactPickers/Light

current

Replace the permissions flyout with inline expansion and independent
mode and permission highlights. Preserve keyboard focus, use the
available menu height, and align composer control sizing and spacing.

Enable the experiment by default in non-Stable builds while preserving
explicit user overrides.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Exercise pointer movement before hover assertions and inherit the shared
chat control height in compact-picker coverage after rebasing onto main.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@justschen
Justin Chen (justschen) force-pushed the agents/experimental-mode-permissions-picker branch from b1fa9b2 to 7ec2436 Compare September 9, 2026 04:23
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants