Skip to content

chat: add "Don't show again" to Autopilot and Bypass Approvals warning dialogs#311262

Merged
ulugbekna merged 4 commits intomainfrom
ulugbekna/agents/autopilot-dialog-dont-show-again
Apr 20, 2026
Merged

chat: add "Don't show again" to Autopilot and Bypass Approvals warning dialogs#311262
ulugbekna merged 4 commits intomainfrom
ulugbekna/agents/autopilot-dialog-dont-show-again

Conversation

@ulugbekna
Copy link
Copy Markdown
Contributor

@ulugbekna ulugbekna commented Apr 19, 2026

Summary

Adds a "Don't show again" checkbox to the confirmation dialogs shown when the user enables Autopilot or Bypass Approvals in the chat permissions picker.

When the checkbox is checked and the user clicks Enable, the choice is persisted to profile storage (StorageScope.PROFILE) so the warning is not shown again across sessions. Each permission level (Autopilot and Bypass Approvals) is tracked independently — suppressing one does not suppress the other.

Changes

permissionPickerActionItem.ts

  • Added IStorageService injection to PermissionPickerActionItem.
  • Exported two storage keys (AUTOPILOT_DONT_SHOW_AGAIN_KEY, AUTO_APPROVE_DONT_SHOW_AGAIN_KEY) for use by the reset command.
  • Extended hasShownElevatedWarning() to check persisted storage in addition to the existing in-session shownWarnings Set.
  • Added checkbox: { label: "Don't show again", checked: false } to both dialog prompt() calls.
  • On confirm + checkbox checked, stores true via storageService.store(..., StorageScope.PROFILE, StorageTarget.USER).
  • Removed the implicit "Autopilot implies AutoApprove" cross-level implication so each warning shows independently.

chatDeveloperActions.ts

  • Added ResetChatPermissionWarningDialogsAction (Developer category, command workbench.action.chat.resetPermissionWarningDialogs, title "Reset Permission Warning Dialogs (Autopilot, Bypass Approvals)").
  • The command removes both storage keys from PROFILE scope, allowing the warnings to appear again.

ulugbekna and others added 3 commits April 17, 2026 15:25
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot AI review requested due to automatic review settings April 19, 2026 19:44
@ulugbekna ulugbekna requested a review from justschen April 19, 2026 19:46
justschen
justschen previously approved these changes Apr 19, 2026
Copy link
Copy Markdown
Collaborator

@justschen justschen left a comment

Choose a reason for hiding this comment

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

Oh this is big and very much helpful - thanks for giving this a look!

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Apr 19, 2026

Screenshot Changes

Base: 334c5b7f Current: e7a43523

Changed (2)

chat/aiCustomizations/aiCustomizationManagementEditor/McpBrowseMode/Light
Before After
before after
editor/inlineCompletions/other/JumpToHint/Dark
Before After
before after

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Adds persistence-backed “Don’t show again” support to the elevated-permissions warning dialogs in the chat permission picker, plus a developer command to reset the suppressed-warning state.

Changes:

  • Persist “Don’t show again” choices for Autopilot and Bypass Approvals warnings in PROFILE storage and honor them when deciding to show dialogs.
  • Add a Developer command to reset the persisted suppression for both warnings.
  • Remove the previous cross-level implication so Autopilot and Bypass Approvals warnings are tracked independently.
Show a summary per file
File Description
src/vs/workbench/contrib/chat/browser/widget/input/permissionPickerActionItem.ts Adds checkbox UI + persisted storage keys/logic to suppress warnings across sessions.
src/vs/workbench/contrib/chat/browser/actions/chatDeveloperActions.ts Adds a developer action to clear the stored “don’t show again” flags.

Copilot's findings

  • Files reviewed: 2/2 changed files
  • Comments generated: 2

Comment on lines 21 to 22
import { AUTOPILOT_DONT_SHOW_AGAIN_KEY, AUTO_APPROVE_DONT_SHOW_AGAIN_KEY } from '../widget/input/permissionPickerActionItem.js';

Copy link

Copilot AI Apr 19, 2026

Choose a reason for hiding this comment

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

chatDeveloperActions.ts imports permissionPickerActionItem just to reuse the two storage-key constants. That module pulls in a lot of widget/UI dependencies, so this makes the developer actions bundle load more code at startup (since registerChatDeveloperActions() is called from chat.contribution.ts). Suggestion: move these storage keys into a small shared constants module (e.g. under .../chat/common/), and have both the widget and the developer reset action import from there (or duplicate the string literals locally to avoid a heavy dependency).

Suggested change
import { AUTOPILOT_DONT_SHOW_AGAIN_KEY, AUTO_APPROVE_DONT_SHOW_AGAIN_KEY } from '../widget/input/permissionPickerActionItem.js';
const AUTOPILOT_DONT_SHOW_AGAIN_KEY = 'chat.autopilot.permissionPicker.dontShowAgain';
const AUTO_APPROVE_DONT_SHOW_AGAIN_KEY = 'chat.autoApprove.permissionPicker.dontShowAgain';

Copilot uses AI. Check for mistakes.
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

@copilot implement your suggestion

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.

Implemented in e1b752c. I moved the warning-storage keys into a lightweight shared module at src/vs/workbench/contrib/chat/common/chatPermissionStorageKeys.ts and updated both chatDeveloperActions.ts and permissionPickerActionItem.ts to import from it, removing the heavy widget dependency from developer actions. UI is unchanged by this refactor, so there is no new UI screenshot to share.

Move AUTOPILOT_DONT_SHOW_AGAIN_KEY and AUTO_APPROVE_DONT_SHOW_AGAIN_KEY
to chat/common/chatPermissionStorageKeys.ts so both chatDeveloperActions
and permissionPickerActionItem import from a lightweight shared module.
This avoids chatDeveloperActions pulling in heavy widget/UI dependencies
at startup via the permissionPickerActionItem import.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@ulugbekna ulugbekna merged commit 2212cb2 into main Apr 20, 2026
26 checks passed
@ulugbekna ulugbekna deleted the ulugbekna/agents/autopilot-dialog-dont-show-again branch April 20, 2026 15:13
@vs-code-engineering vs-code-engineering Bot added this to the 1.118.0 milestone Apr 20, 2026
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.

5 participants