feat: Terminal auto-approve with confirmation dialog enhancement (Auto-approve Part 2)#171
Open
xinyi-gong wants to merge 8 commits into
Open
feat: Terminal auto-approve with confirmation dialog enhancement (Auto-approve Part 2)#171xinyi-gong wants to merge 8 commits into
xinyi-gong wants to merge 8 commits into
Conversation
There was a problem hiding this comment.
Pull request overview
Adds terminal command auto-approval configuration and persistence, plus a richer tool-confirmation UI that supports session/global “allow” actions. This extends the agent tool confirmation pipeline to evaluate auto-approve rules, synchronize them to the Copilot language server settings, and render a split-dropdown confirmation dialog.
Changes:
- Introduces a new “Tool Auto Approve” preference page/section for managing terminal allow/deny rules and an “unmatched commands” toggle.
- Adds terminal confirmation evaluation + persistence (session/global) and wires preference changes into CLS settings sync.
- Refactors the confirmation dialog UI to use
ConfirmationContent/ConfirmationActionand a split-dropdown primary action.
Reviewed changes
Copilot reviewed 33 out of 33 changed files in this pull request and generated 10 comments.
Show a summary per file
| File | Description |
|---|---|
| com.microsoft.copilot.eclipse.ui/src/com/microsoft/copilot/eclipse/ui/utils/PreferencesUtils.java | Adds the new Auto Approve preference page ID to the preference ID list. |
| com.microsoft.copilot.eclipse.ui/src/com/microsoft/copilot/eclipse/ui/swt/SplitDropdownButton.java | Moves/renames the dropdown button widget and adds separator color support. |
| com.microsoft.copilot.eclipse.ui/src/com/microsoft/copilot/eclipse/ui/preferences/TerminalAutoApproveSection.java | New preference UI section for terminal auto-approve rules and unmatched toggle. |
| com.microsoft.copilot.eclipse.ui/src/com/microsoft/copilot/eclipse/ui/preferences/messages.properties | Adds NLS strings for terminal auto-approve preference UI. |
| com.microsoft.copilot.eclipse.ui/src/com/microsoft/copilot/eclipse/ui/preferences/Messages.java | Exposes new preference NLS keys as Java fields. |
| com.microsoft.copilot.eclipse.ui/src/com/microsoft/copilot/eclipse/ui/preferences/LanguageServerSettingManager.java | Syncs terminal auto-approve settings/rules from preferences into CLS settings. |
| com.microsoft.copilot.eclipse.ui/src/com/microsoft/copilot/eclipse/ui/preferences/CopilotPreferencesPage.java | Adds a link from the main Copilot preference page to “Tool Auto Approve”. |
| com.microsoft.copilot.eclipse.ui/src/com/microsoft/copilot/eclipse/ui/preferences/CopilotPreferenceInitializer.java | Initializes default auto-approve rules and unmatched toggle preferences. |
| com.microsoft.copilot.eclipse.ui/src/com/microsoft/copilot/eclipse/ui/preferences/AutoApprovePreferencePage.java | New preference page hosting the terminal auto-approve section. |
| com.microsoft.copilot.eclipse.ui/src/com/microsoft/copilot/eclipse/ui/preferences/AddTerminalRuleDialog.java | New dialog for adding terminal command/regex allow/deny rules. |
| com.microsoft.copilot.eclipse.ui/src/com/microsoft/copilot/eclipse/ui/dialogs/mcp/McpServerItem.java | Updates MCP UI to use SplitDropdownButton instead of the old dropdown class. |
| com.microsoft.copilot.eclipse.ui/src/com/microsoft/copilot/eclipse/ui/chat/services/AgentToolService.java | Wires confirmation evaluation + persistence into the tool confirmation flow (session-aware). |
| com.microsoft.copilot.eclipse.ui/src/com/microsoft/copilot/eclipse/ui/chat/messages.properties | Adds NLS labels for confirmation dialog action strings and titles. |
| com.microsoft.copilot.eclipse.ui/src/com/microsoft/copilot/eclipse/ui/chat/Messages.java | Exposes new chat/confirmation NLS keys as Java fields. |
| com.microsoft.copilot.eclipse.ui/src/com/microsoft/copilot/eclipse/ui/chat/InvokeToolConfirmationDialog.java | Refactors confirmation dialog rendering to be driven by ConfirmationContent and show a split-dropdown action. |
| com.microsoft.copilot.eclipse.ui/src/com/microsoft/copilot/eclipse/ui/chat/confirmation/TerminalConfirmationHandler.java | Implements terminal-specific rule evaluation, dialog content construction, and decision persistence. |
| com.microsoft.copilot.eclipse.ui/src/com/microsoft/copilot/eclipse/ui/chat/confirmation/ConfirmationService.java | Adds tool-category classification/dispatch for confirmation evaluation and persistence. |
| com.microsoft.copilot.eclipse.ui/src/com/microsoft/copilot/eclipse/ui/chat/confirmation/ConfirmationHandler.java | New UI-side handler interface for per-tool-category confirmation logic. |
| com.microsoft.copilot.eclipse.ui/src/com/microsoft/copilot/eclipse/ui/chat/BaseTurnWidget.java | Updates confirmation request API to accept ConfirmationContent and exposes dialog accessor. |
| com.microsoft.copilot.eclipse.ui/plugin.xml | Registers the new preference page and updates annotation type definitions. |
| com.microsoft.copilot.eclipse.ui/plugin.properties | Adds the preference page display name key. |
| com.microsoft.copilot.eclipse.ui/META-INF/MANIFEST.MF | Exports the new confirmation package for tests via x-friends. |
| com.microsoft.copilot.eclipse.ui/css/light.css | Adjusts selector for command panel background after dialog structure change. |
| com.microsoft.copilot.eclipse.ui/css/dark.css | Adjusts selector for command panel background after dialog structure change. |
| com.microsoft.copilot.eclipse.ui.test/src/com/microsoft/copilot/eclipse/ui/chat/confirmation/TerminalConfirmationHandlerTests.java | Adds unit tests for terminal rule matching, evaluation, and session/global persistence behavior. |
| com.microsoft.copilot.eclipse.swtbot.test/test-plans/terminal-auto-approve/terminal-auto-approve.md | Adds an end-to-end manual/SWTBot test plan for the feature. |
| com.microsoft.copilot.eclipse.core/src/com/microsoft/copilot/eclipse/core/lsp/protocol/CopilotAgentSettings.java | Extends agent settings model with terminal auto-approve and unmatched behavior settings. |
| com.microsoft.copilot.eclipse.core/src/com/microsoft/copilot/eclipse/core/Constants.java | Adds preference keys for terminal auto-approve rules and unmatched toggle. |
| com.microsoft.copilot.eclipse.core/src/com/microsoft/copilot/eclipse/core/chat/TerminalAutoApproveRule.java | Adds a shared model class for terminal auto-approve rules (Gson-friendly). |
| com.microsoft.copilot.eclipse.core/src/com/microsoft/copilot/eclipse/core/chat/ConfirmationResult.java | Changes confirmation evaluation result to a content-carrying class (vs enum). |
| com.microsoft.copilot.eclipse.core/src/com/microsoft/copilot/eclipse/core/chat/ConfirmationContent.java | Adds a model describing confirmation UI content + available actions. |
| com.microsoft.copilot.eclipse.core/src/com/microsoft/copilot/eclipse/core/chat/ConfirmationActionScope.java | Defines ONCE/SESSION/GLOBAL persistence scopes for confirmation actions. |
| com.microsoft.copilot.eclipse.core/src/com/microsoft/copilot/eclipse/core/chat/ConfirmationAction.java | Adds a model for dialog actions including metadata for persistence. |
jdneo
reviewed
May 12, 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.
Adds terminal command auto-approve rules with preference UI, session/global persistence, and a split-dropdown confirmation dialog for granular approval actions (allow command name, exact command, or all commands per session).
Preference Page

Add terminal rule

Reset to defaults


Dialog action list
Dialog action list ( only terminal name)
