Repository navigation
Fix bash tool consistency: Add matching default commands for Claude and Copilot engines - #1089
Conversation
Co-authored-by: pelikhan <[email protected]>
Co-authored-by: pelikhan <[email protected]>
|
@copilot continue plan |
Continuing the plan to identify the specific discrepancy in default bash tools between Claude and Copilot engines. I'll run the integration test I created to see if it reveals the issue, then implement the fix. |
…nd Copilot engines Co-authored-by: pelikhan <[email protected]>
| tools["bash"] = defaultCommands | ||
| } else if bashCommands, ok := bashTool.([]any); ok && len(bashCommands) == 0 { | ||
| // bash is empty array - add default bash commands | ||
| defaultCommands := make([]any, len(constants.DefaultBashTools)) |
There was a problem hiding this comment.
@copilot empty array means no bash tools. Update documentation.
There was a problem hiding this comment.
Fixed in commit c614a7d. Updated the logic so bash: [] correctly means "no bash tools allowed" rather than adding default tools. Also added comprehensive documentation explaining the behavior:
bash: trueorbash: nil→ Add default commandsbash: []→ No bash tools allowed (empty array preserved)bash: ["cmd1", "cmd2"]→ Use specific commands only
The empty array now correctly preserves its semantic meaning of "no tools" rather than being converted to default commands.
Co-authored-by: pelikhan <[email protected]>
|
@copilot update documentation on bash tool (start a documentation page on tools if needed) |
Co-authored-by: pelikhan <[email protected]>
Added comprehensive bash tools documentation in commit 28a8734. Updated the existing tools documentation page ( New Bash Tools Section includes:
Updated Examples:
The documentation now fully explains the bash tool consistency improvements and provides clear guidance for users on how to configure bash tools safely and effectively. Warning Firewall rules blocked me from connecting to one or more addresses (expand for details)I tried to connect to the following addresses, but was blocked by firewall rules:
If you need me to access, download, or install something from one of these locations, you can either:
|
|
@copilot merge main, format, lint, fix tests |
Completed all requested tasks in commit 1e3dbf8: ✅ Merged main: Successfully merged latest changes from main branch, resolving all conflicts Key merge resolution: Updated failing test that assumed Claude doesn't support error validation - now correctly expects Claude to generate error validation steps since it has built-in error patterns. All unit tests now pass and the codebase is fully up-to-date with main while maintaining the bash tool consistency improvements. |
Fix bash tool consistency between Claude and Copilot agentic engines
COMPLETED: Fixed the bash tool consistency issue between Claude and Copilot engines by ensuring both provide identical default bash commands when bash tools are enabled.
Changes Made
DefaultBashToolsconstant with common safe bash commands:echo,ls,pwd,cat,head,tail,grep,wc,sort,uniq,dateapplyDefaultTools()incompiler.goto add default bash commands when bash is enabled withbash: trueorbash: nilbash: []means "no bash tools allowed" rather than adding default toolsdocs/src/content/docs/reference/tools.mdTestGenerateErrorValidationWithEngineConfigPatternswhich was outdated due to Claude now supporting error validationbash_defaults_consistency_test.goto verify both engines get identical default commands across all bash configuration scenarioscopilot_git_commands_integration_test.goto ensure Copilot has equivalent git command testing as ClaudeBash Configuration Behavior
bash: true→ Add default commands (echo,ls,pwd, etc.)bash: nil→ Add default commands (only if no git commands needed)bash: []→ No bash tools allowed (empty array preserved)bash: ["echo", "ls"]→ Use specified commands onlyDocumentation Added
Comprehensive bash tools documentation now includes:
Results
Both engines now provide exactly the same default bash commands when bash is enabled:
Bash(cat), Bash(date), Bash(echo), Bash(grep), Bash(head), Bash(ls), Bash(pwd), Bash(sort), Bash(tail), Bash(uniq), Bash(wc)+ bash helpers + Claude defaultsshell(cat) shell(date) shell(echo) shell(grep) shell(head) shell(ls) shell(pwd) shell(sort) shell(tail) shell(uniq) shell(wc)Key Features
bash: nilis used with safe outputs requiring git, it remains nil as expectedbash: []means no bash tools, not default toolsThe default set of allowed bash tools now matches perfectly between Claude and Copilot agentic engines, providing a consistent user experience across both engines while maintaining backward compatibility with existing workflows.
Original prompt
💬 Share your feedback on Copilot coding agent for the chance to win a $200 gift card! Click here to start the survey.