mirror of
https://github.com/RooVetGit/Roo-Code.git
synced 2026-09-06 08:18:39 +00:00
- Removed 'roo-code.commandWhitelist' from VS Code settings (package.json) - Added command whitelisting to Auto Approve settings in plugin UI - Migrated existing whitelist settings to new location on extension activation - Updated all related components, tests, and localization files - Maintains backward compatibility by migrating existing settings This change improves user experience by consolidating all auto-approval settings in one location within the plugin's settings interface.
77 lines
2.8 KiB
Markdown
77 lines
2.8 KiB
Markdown
# PR #5491 Fix Implementation Summary
|
|
|
|
## Overview
|
|
|
|
Implemented a feature flag to disable LLM-based command suggestions in response to reviewer feedback about avoiding reliance on LLMs for command whitelist suggestions.
|
|
|
|
## Changes Made
|
|
|
|
### 1. Configuration Setting Added
|
|
|
|
- **File**: `src/package.json`
|
|
- Added new setting: `roo-cline.disableLlmCommandSuggestions`
|
|
- Type: boolean, default: false
|
|
- Description: "Disable LLM-generated command suggestions and use only programmatic pattern generation"
|
|
|
|
### 2. Localization
|
|
|
|
- **File**: `src/package.nls.json`
|
|
- Added description for the new setting
|
|
|
|
### 3. Tool Prompt Conditional Logic
|
|
|
|
- **File**: `src/core/prompts/tools/execute-command.ts`
|
|
- Modified `getExecuteCommandDescription` to conditionally include suggestions section
|
|
- When `disableLlmCommandSuggestions` is true, the suggestions parameter is omitted from the tool description
|
|
|
|
### 4. Tool Implementation Update
|
|
|
|
- **File**: `src/core/tools/executeCommandTool.ts`
|
|
- Added check for `disableLlmCommandSuggestions` setting
|
|
- When enabled, suggestions from LLM are ignored even if provided
|
|
|
|
### 5. Settings Propagation
|
|
|
|
- **File**: `src/core/task/Task.ts`
|
|
- Updated to pass the `disableLlmCommandSuggestions` setting through the system prompt generation
|
|
|
|
### 6. Test Coverage
|
|
|
|
- **File**: `src/core/tools/__tests__/executeCommandTool.spec.ts`
|
|
- Added comprehensive test suite for the new setting
|
|
- Tests verify suggestions are ignored when setting is enabled
|
|
- Tests verify suggestions work normally when setting is disabled or not set
|
|
|
|
- **File**: `src/core/prompts/tools/__tests__/execute-command.spec.ts`
|
|
- Added tests for conditional prompt generation
|
|
- Verifies suggestions section is excluded when setting is enabled
|
|
|
|
## How It Works
|
|
|
|
1. **When `disableLlmCommandSuggestions` is false (default)**:
|
|
|
|
- LLM receives instructions to provide command suggestions
|
|
- Tool processes suggestions and shows them to the user
|
|
- Existing behavior is preserved
|
|
|
|
2. **When `disableLlmCommandSuggestions` is true**:
|
|
- LLM does not receive instructions about suggestions
|
|
- Even if LLM provides suggestions, they are ignored
|
|
- Falls back to programmatic pattern generation only
|
|
|
|
## Benefits
|
|
|
|
1. **Addresses Reviewer Concern**: Removes reliance on LLM for command suggestions when desired
|
|
2. **Backward Compatible**: Default behavior unchanged, existing users unaffected
|
|
3. **User Control**: Users can choose between LLM suggestions or deterministic patterns
|
|
4. **Token Savings**: When enabled, reduces token usage by not including suggestion instructions
|
|
5. **Deterministic Behavior**: Provides predictable command pattern generation when needed
|
|
|
|
## Testing
|
|
|
|
All tests pass:
|
|
|
|
- Execute command tool tests: 23 passed
|
|
- Execute command prompt tests: 4 passed
|
|
|
|
The implementation is complete and ready for review.
|