Skip to content

Add auto-approval messages for global chat.tools.autoApprove setting#261321

Merged
Tyriar merged 6 commits intomainfrom
copilot/fix-261319
Aug 13, 2025
Merged

Add auto-approval messages for global chat.tools.autoApprove setting#261321
Tyriar merged 6 commits intomainfrom
copilot/fix-261319

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Aug 12, 2025

When the global "chat.tools.autoApprove": true setting is enabled, terminal commands are automatically approved and executed without user confirmation. However, users were not informed why the command was auto-approved, leaving them without context about the automatic execution.

This change adds clear messaging to inform users when commands are auto-approved due to the global setting:

Before: Commands auto-approved by the global setting showed no explanation
After: Commands show "Auto approved by global tools setting" message

Changes Made

1. Enhanced Auto-Approval Detection (languageModelToolsService.ts)

  • Modified shouldAutoConfirm() to return detailed information about the auto-approval source
  • Added logic to set autoApproveInfo in terminal tool data when the global setting triggers auto-approval
  • Preserves existing terminal-specific auto-approval messages (they take precedence over global messages)

2. Updated Message Display (chatTerminalToolProgressPart.ts)

  • Modified content rendering to include autoApproveInfo when present
  • Ensures the auto-approval message appears below the command in the chat interface

Behavior

  • When "chat.tools.autoApprove": true is set, users now see a clear message explaining the auto-approval
  • Terminal-specific auto-approval rules continue to work as before and show their own messages
  • No changes to auto-approval functionality - only adds user-facing messaging for transparency

The fix ensures users understand when and why their commands are being automatically executed, improving the overall user experience and transparency of the auto-approval system.

Fixes #261319.

Warning

Firewall rules blocked me from connecting to one or more addresses

I tried to connect to the following addresses, but was blocked by firewall rules:

  • electronjs.org
    • Triggering command: node-gyp (dns block)

If you need me to access, download, or install something from one of these locations, you can either:


💬 Share your feedback on Copilot coding agent for the chance to win a $200 gift card! Click here to start the survey.

Copilot AI and others added 2 commits August 12, 2025 20:10
Co-authored-by: Tyriar <2193314+Tyriar@users.noreply.github.com>
Co-authored-by: Tyriar <2193314+Tyriar@users.noreply.github.com>
Copilot AI changed the title [WIP] Run in terminal auto approval messages should call out when "chat.tools.autoApprove": true is used Add auto-approval messages for global chat.tools.autoApprove setting Aug 12, 2025
Copilot AI requested a review from Tyriar August 12, 2025 20:19
@Tyriar Tyriar force-pushed the copilot/fix-261319 branch from b9ca6c7 to e7eead4 Compare August 13, 2025 10:32
@Tyriar Tyriar marked this pull request as ready for review August 13, 2025 10:32
@Tyriar Tyriar enabled auto-merge August 13, 2025 10:32
@Tyriar Tyriar merged commit 3e02f7c into main Aug 13, 2025
18 checks passed
@Tyriar Tyriar deleted the copilot/fix-261319 branch August 13, 2025 14:46
@vs-code-engineering vs-code-engineering Bot locked and limited conversation to collaborators Sep 27, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Run in terminal auto approval messages should call out when "chat.tools.autoApprove": true is used

3 participants