Auto-approve terminal command execution in Copilot Agent Mode
Problem
Currently, when using GitHub Copilot Chat Agent Mode, users are prompted to manually approve the action by clicking the Continue button. It would be great to have a setting or toggle that allows trusted commands to be automatically executed without manual confirmation, especially for repetitive or non-destructive actions
Unverified for your environment
Select your OS to check compatibility.
2 Fixes
Implement Auto-Approval Toggle for Copilot Agent Commands
The current design of GitHub Copilot Chat Agent Mode requires user confirmation for executing terminal commands to prevent unintended actions. This is a safety feature to ensure that users are aware of potentially destructive commands. However, for repetitive or non-destructive commands, this can lead to inefficiencies and disrupt workflow.
Awaiting Verification
Be the first to verify this fix
- 1
Add Auto-Approval Setting in Configuration
Modify the Copilot settings to include a new boolean toggle for 'autoApproveCommands'. This setting will allow users to specify whether they want trusted commands to be executed automatically without manual confirmation.
typescriptconst settings = { autoApproveCommands: true }; - 2
Update Command Execution Logic
In the command execution module, check the value of 'autoApproveCommands'. If it is set to true and the command is deemed non-destructive, execute the command without prompting the user for confirmation.
typescriptif (settings.autoApproveCommands && isNonDestructive(command)) { executeCommand(command); } else { promptUserForApproval(command); } - 3
Create User Documentation
Update the user documentation to include information on the new auto-approval feature, how to enable it, and guidelines on what constitutes a trusted command.
- 4
Test Auto-Approval Functionality
Conduct thorough testing of the new feature to ensure that commands are executed as expected when auto-approval is enabled, and that the confirmation prompt appears for commands that are destructive or when auto-approval is disabled.
typescriptdescribe('Auto-Approval Feature', () => { it('should execute non-destructive commands automatically', () => { /* test logic */ }); });
Validation
To confirm the fix worked, enable the auto-approval toggle in the settings and run a series of non-destructive commands. Verify that these commands execute without prompting for confirmation. Additionally, ensure that destructive commands still require user approval.
Sign in to verify this fix
1 low-confidence fix
Implement Auto-Approve Toggle for Copilot Agent Commands
The current design of GitHub Copilot Chat Agent Mode requires manual approval for command execution to ensure user control and prevent unintended actions. This is particularly cumbersome for repetitive or non-destructive commands, leading to inefficiencies in workflows.
Awaiting Verification
Be the first to verify this fix
- 1
Add Configuration Option
Introduce a configuration setting in the user preferences that allows users to enable or disable auto-approval for trusted commands. This setting should be accessible via the settings UI in VSCode.
typescriptconst autoApproveCommands = true; // User preference setting - 2
Modify Command Execution Logic
Update the command execution logic in the Copilot Agent to check the auto-approve setting. If enabled, skip the manual confirmation step for commands marked as trusted.
typescriptif (autoApproveCommands && isTrustedCommand(command)) { executeCommand(command); } else { promptUserForApproval(command); } - 3
Define Trusted Commands
Create a mechanism to define which commands are considered trusted. This could be a predefined list or allow users to mark specific commands as trusted through the UI.
typescriptconst trustedCommands = ['git pull', 'git push']; // Example trusted commands - 4
Update Documentation
Ensure that the new feature is documented clearly in the user guide, including how to enable the auto-approve setting and how to manage trusted commands.
- 5
Conduct User Testing
Perform user testing with a group of developers to gather feedback on the new feature and make adjustments based on their experiences.
Validation
To confirm the fix worked, enable the auto-approve toggle in the settings, execute a trusted command, and verify that it runs without prompting for manual approval. Additionally, test an untrusted command to ensure the prompt appears as expected.
Sign in to verify this fix
Environment
Submitted by
Alex Chen
2450 rep