Skip to content

Fix bash tool parser to merge default commands with custom arrays - #1094

Merged
pelikhan merged 6 commits into
mainfrom
copilot/fix-406d05f2-a2bd-4e63-a437-be82bef59b8a
Sep 29, 2025
Merged

pelikhan merged 6 commits into
mainfrom
copilot/fix-406d05f2-a2bd-4e63-a437-be82bef59b8a

Conversation

Copilot AI commented Sep 29, 2025 •

Copy link
Copy Markdown
Contributor
  • Analyze GitHub Actions workflow run 18088588008 for missing tool data
  • Identify that the issue is related to bash tool permissions for make commands
  • Found that tidy.md has bash: ["make:*"] but current DefaultBashTools doesn't include make patterns
  • Reverted changes to DefaultBashTools as requested by @pelikhan
  • Fixed the parser to properly merge default bash tools with custom commands
  • Add tests to validate the changes
  • Run tests to ensure no regressions
  • Verified that tidy.md now includes both default tools AND make commands
  • Applied code formatting and linting as requested by @pelikhan

Summary

Issue: The parser was not correctly handling the case where bash: ["make:*"] was specified. Previously, this would ONLY provide make commands, but AI agents also need basic commands like echo, ls, pwd, etc.

Root Cause: The compiler had logic that said bash: ["cmd1", "cmd2"] → Keep specific commands as-is, but it should have been bash: ["cmd1", "cmd2"] → Add default commands + specific commands.

Solution: Updated the compiler logic in pkg/workflow/compiler.go to merge default bash tools with custom commands when an array is specified. Now when someone uses bash: ["make:*"], they get:

  • Default tools: echo, ls, pwd, cat, head, tail, grep, wc, sort, uniq, date
  • Custom tools: make:*
  • Git tools (when safe-outputs require them): git add:*, git commit:*, etc.

Verification: The tidy.md workflow now correctly includes 20+ bash tools instead of just git + make commands, giving AI agents access to all the tools they need for basic operations and build commands.

Formatting: Applied go fmt to ensure code consistency and quality.

Original prompt

Add tools bash permission to Go tools, "make *" to tiny.md

Analyze missing tool data at https://github.com/githubnext/gh-aw/actions/runs/18088588008/job/51464226832#step:2:1


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

Copilot AI changed the title [WIP] Add tools bash permission to Go tools, "make *" to tiny.md Analyze missing tool data at https://github.com/githubnext/gh-aw/actions/runs/18088588008/job/51464226832#step:2:1 Add make:* commands to DefaultBashTools for workflow compatibility Sep 29, 2025
Copilot AI requested a review from pelikhan September 29, 2025 12:12
@pelikhan

Copy link
Copy Markdown
Collaborator

@copilot

  • do not modify the default bash tools

  • tidy.md does not have "bash: true" defined. Fix the parser.

Copilot AI commented Sep 29, 2025

Copy link
Copy Markdown
Contributor Author

@copilot

  • do not modify the default bash tools...

Fixed both issues in commit 683f6ba:

  1. Reverted DefaultBashTools changes - No longer modifying the default bash tools as requested
  2. Fixed the parser - Updated the compiler logic to properly merge default bash tools with custom commands when arrays are specified

The root issue was that bash: ["make:*"] was only providing make commands, but AI agents also need basic commands like echo, ls, pwd, etc. Now the parser correctly merges both:

  • Default tools: echo, ls, pwd, cat, head, tail, grep, wc, sort, uniq, date
  • Custom tools: make:*
  • Git tools: git add:*, git commit:*, etc. (when safe-outputs require them)

The tidy.md workflow now correctly includes 20+ bash tools instead of just git + make commands.

Copilot AI changed the title Add make:* commands to DefaultBashTools for workflow compatibility Fix bash tool parser to merge default commands with custom arrays Sep 29, 2025
@pelikhan
pelikhan marked this pull request as ready for review September 29, 2025 12:59
@pelikhan

Copy link
Copy Markdown
Collaborator

@dsyme should we explicitely have the user add a "defaults" toolset?

@pelikhan

Copy link
Copy Markdown
Collaborator

@copilot format, lint

Copilot AI commented Sep 29, 2025

Copy link
Copy Markdown
Contributor Author

@copilot format, lint

Code formatting and linting completed in commit e8c2174:

  • Applied go fmt to format all Go code
  • Fixed whitespace and alignment issues in test files and compiler
  • Verified JavaScript/CJS files pass prettier formatting checks
  • All linting checks now pass successfully

The code is now properly formatted and follows project style guidelines.

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.

2 participants