Skip to content

feat: Terminal auto-approve with confirmation dialog enhancement (Auto-approve Part 2)#171

Open
xinyi-gong wants to merge 8 commits into
feature/auto-approvefrom
tori/auto-approve-terminal
Open

feat: Terminal auto-approve with confirmation dialog enhancement (Auto-approve Part 2)#171
xinyi-gong wants to merge 8 commits into
feature/auto-approvefrom
tori/auto-approve-terminal

Conversation

@xinyi-gong
Copy link
Copy Markdown
Member

@xinyi-gong xinyi-gong commented May 11, 2026

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
image

Add terminal rule
image

Reset to defaults
image
Dialog action list
image

Dialog action list ( only terminal name)
image

@xinyi-gong xinyi-gong marked this pull request as ready for review May 11, 2026 08:31
@xinyi-gong xinyi-gong requested review from Copilot May 11, 2026 08:34
Copy link
Copy Markdown

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 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/ConfirmationAction and 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.

Comment thread com.microsoft.copilot.eclipse.ui/plugin.xml
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.

3 participants