Skip to content

Conversation

@Tyriar
Copy link
Member

@Tyriar Tyriar commented Dec 18, 2025

Fixes #282209

@Tyriar Tyriar added this to the December / January 2026 milestone Dec 18, 2025
@Tyriar Tyriar self-assigned this Dec 18, 2025
Copilot AI review requested due to automatic review settings December 18, 2025 12:57
Copy link
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

This PR adds default auto-approve rules for the sed command to the terminal chat agent tools configuration. The implementation follows the established pattern of allowing safe sed commands while blocking potentially dangerous operations that could modify files or execute arbitrary code.

Key Changes

  • Added auto-approve rules for the sed command with specific patterns to block dangerous flags and operations
  • Added comprehensive test coverage for both allowed and blocked sed command variations

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 4 comments.

File Description
src/vs/workbench/contrib/terminalContrib/chatAgentTools/common/terminalChatAgentToolsConfiguration.ts Added sed command to auto-approve configuration with two regex patterns: one blocking dangerous flags (-i, -e, -f, and their long-form equivalents) and another blocking dangerous sed commands (/e, /w, ;W)
src/vs/workbench/contrib/terminalContrib/chatAgentTools/test/electron-browser/runInTerminalTool.test.ts Added test cases for auto-approved sed commands (simple substitutions) and confirmation-required sed commands (in-place edits, file-based scripts, and dangerous command flags)

@Tyriar Tyriar marked this pull request as ready for review December 20, 2025 15:17
@Tyriar Tyriar enabled auto-merge December 20, 2025 15:17
@Tyriar Tyriar merged commit f6686c6 into main Dec 20, 2025
43 of 45 checks passed
@Tyriar Tyriar deleted the tyriar/282209_sed branch December 20, 2025 23:20
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.

Auto-approve GitHub Copilot non-destructive sed usage.

3 participants