Fix Copilot CLI --allow-tool argument format for v0.0.347+, add verification steps, and update dev workflows#2092
Fix Copilot CLI --allow-tool argument format for v0.0.347+, add verification steps, and update dev workflows#2092
Conversation
|
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Added verification steps in commit d591dc5:
These steps will catch configuration issues early and provide clear error messages if the CLI isn't installed or the prompt file is missing/empty. |
|
@copilot make dev.md use copilot |
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
dev.md already uses Copilot ( - name: Verify Copilot CLI installation
run: |
echo "Verifying GitHub Copilot CLI installation..."
if ! command -v copilot &> /dev/null; then
echo "Error: copilot command not found"
exit 1
fi
copilot --version
echo "GitHub Copilot CLI is installed and working"This verification step runs after npm install to ensure the CLI is properly installed before execution. |
✅ Dev Hawk Report - SuccessWorkflow Run: #2954
The Dev workflow completed successfully! 🎉 SummaryAll checks passed for the Copilot CLI verification changes:
The changes to update the
|
|
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Done in commit 4406988:
The compiled workflows now show:
|
|
|
. |
|
@copilot In the detection job, make sure all --add-for folders are pre-created https://github.com/githubnext/gh-aw/actions/runs/18704084037/job/53338646639#step:7:1 |
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Fixed in commit 1613411. The detection job now pre-creates all directories used by Copilot CLI: - name: Ensure threat-detection directory and log
run: |
mkdir -p /tmp/gh-aw/threat-detection
mkdir -p /tmp/gh-aw/agent
mkdir -p /tmp/gh-aw/.copilot/logs
touch /tmp/gh-aw/threat-detection/detection.logThis ensures the directories for |
|
✅ Dev Hawk Report - SuccessWorkflow Run: #2958
The Dev workflow completed successfully! 🎉 SummaryAll verification steps and tests passed for the commit "Ensure all --add-dir folders are pre-created in detection job". The workflow validated:
Great work on the Copilot CLI --allow-tool argument format fix and the enhanced verification steps!
|
Problem
The detection job in smoke-copilot workflow started failing after the Copilot CLI was updated from v0.0.344 to v0.0.347. The agent job continued to work, but the threat detection job failed immediately with exit code 1 and no error output.
Evidence:
Root Cause
Copilot CLI v0.0.347 changed how it handles the
--allow-toolparameter for shell commands. The old format wrapped bash commands inshell(), but the new version expects just the command name.Old format (v0.0.344):
New format (v0.0.347):
copilot --allow-tool cat --allow-tool grep --prompt "..."This aligns with the official Copilot CLI documentation, which shows examples like
copilot -p "List my open PRs" --allow-tool grep.Changes
Code Changes
pkg/workflow/copilot_engine.go:computeCopilotToolArguments()to generate command names directly without theshell()wrapperGetInstallationSteps()for all Copilot workflowspkg/workflow/bash_defaults_consistency_test.go: AddedisCommonBashCommand()helper to properly detect bash commands in the new formatpkg/workflow/threat_detection.go:--add-dirpaths to prevent execution failuresVerification Steps Added
For all Copilot workflows:
copilotcommand is available and runscopilot --versionto ensure it's working properlyFor threat detection jobs (additional):
2. Verify prompt file - Before execution, checks that the prompt file exists at
/tmp/gh-aw/aw-prompts/prompt.txtand has content3. Pre-create required directories - Creates all directories used by Copilot CLI's
--add-dirand--log-dirarguments:/tmp/gh-aw/agent//tmp/gh-aw/.copilot/logs//tmp/gh-aw/threat-detection/These steps help catch configuration issues early and provide better error messages for debugging.
Workflow Configuration Updates
dev.md: Added safe-outputs create-issue configuration with[dev]prefix andautomation,dev-testlabels to enable automatic issue creation from workflow resultsdev-hawk.md: Changed engine fromcopilottoclaudefor better workflow monitoring and analysis capabilitiesTest Updates
Updated all test expectations to match the new format:
copilot_engine_test.go- Updated expected tool arguments, command line assertions, and installation step countcopilot_git_commands_integration_test.go- Updated git command expectationsbash_defaults_consistency_test.go- Updated shell tool detection logicWorkflow Changes
Recompiled all 67 workflows to generate
.lock.ymlfiles with the correct command format and verification steps.Verification
All tests passing:
make test-unit)make test-integration)make lint)make recompile)Example
Before:
After:
Threat Detection (additional verification and directory setup):
Fixes https://github.com/githubnext/gh-aw/actions/runs/18702772209/job/53334797200
Original prompt
✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.