fix(copilot): use --yolo to grant all permissions in non-interactive mode#2298
Merged
mnriem merged 3 commits intogithub:mainfrom Apr 21, 2026
Merged
Conversation
…mode The Copilot CLI's --allow-all-tools flag only covers tool execution permissions but does not grant path or URL access. When the Copilot agent autonomously runs shell commands (e.g. npm run build) during workflow execution, the CLI blocks path access and cannot prompt for approval in non-interactive mode, producing: Permission denied and could not request permission from user Replace --allow-all-tools with --yolo (equivalent to --allow-all-tools --allow-all-paths --allow-all-urls) to grant all three permission types. Rename the opt-out env var from SPECKIT_ALLOW_ALL_TOOLS to SPECKIT_COPILOT_ALLOW_ALL to match the formal --allow-all alias and scope it to the Copilot integration. Fixes github#2294
Contributor
There was a problem hiding this comment.
Pull request overview
This PR updates the GitHub Copilot CLI integration so non-interactive workflow execution can proceed without permission prompts by granting broader Copilot CLI permissions.
Changes:
- Switch Copilot CLI permission flag from
--allow-all-toolsto--yoloin exec/dispatch paths. - Rename the opt-out environment variable to
SPECKIT_COPILOT_ALLOW_ALL. - Update workflow test assertion to expect the new flag.
Show a summary per file
| File | Description |
|---|---|
| src/specify_cli/integrations/copilot/init.py | Uses --yolo and a new env var to control “allow all” behavior for Copilot CLI runs. |
| tests/test_workflows.py | Updates Copilot exec-args assertion to match the new flag. |
Copilot's findings
Tip
Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comments suppressed due to low confidence (1)
src/specify_cli/integrations/copilot/init.py:101
- Same env var backwards-compat concern here as in
build_exec_args(): removingSPECKIT_ALLOW_ALL_TOOLSmeans existing opt-out configurations won’t be applied during workflow dispatch, potentially enabling broader permissions than expected. Recommend checking both env vars (with clear precedence) so prior configurations continue to work.
cli_args = [
"copilot", "-p", prompt,
"--agent", agent_name,
]
if os.environ.get("SPECKIT_COPILOT_ALLOW_ALL", "1") != "0":
cli_args.append("--yolo")
- Files reviewed: 2/2 changed files
- Comments generated: 2
…ALLOW_ALL_TOOLS Address Copilot review feedback: - Honour the old SPECKIT_ALLOW_ALL_TOOLS env var as a fallback with a DeprecationWarning so existing opt-outs are not silently ignored. - Rename the new canonical env var to SPECKIT_COPILOT_ALLOW_ALL_TOOLS. - New var takes precedence when both are set. - Use monkeypatch in tests to avoid flakiness from ambient env vars. - Add tests for deprecation warning, precedence, and opt-out paths.
Contributor
There was a problem hiding this comment.
Copilot's findings
Tip
Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
- Files reviewed: 2/2 changed files
- Comments generated: 2
DeprecationWarning is suppressed by default in Python, so users relying on the old SPECKIT_ALLOW_ALL_TOOLS env var would never see the deprecation notice during normal CLI runs. Switch to UserWarning which is always shown. Update test to also assert the warning category.
Contributor
There was a problem hiding this comment.
Copilot's findings
Tip
Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
- Files reviewed: 2/2 changed files
- Comments generated: 0 new
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fixes #2294
The Copilot CLI's
--allow-all-toolsflag only covers tool execution permissions but does not grant path or URL access. When the Copilot agent autonomously runs shell commands (e.g.npm run build) during workflow execution, the CLI blocks path access and cannot prompt for approval in non-interactive mode, producing:Changes
--allow-all-toolswith--yolo(equivalent to--allow-all-tools --allow-all-paths --allow-all-urls) in bothbuild_exec_args()anddispatch_command()to grant all three permission typesSPECKIT_ALLOW_ALL_TOOLStoSPECKIT_COPILOT_ALLOW_ALL_TOOLSand scope it to the Copilot integrationSPECKIT_ALLOW_ALL_TOOLSenv var with aUserWarningfallback so existing opt-outs are not silently ignoredmonkeypatchin tests to avoid flakiness from ambient env varsFiles changed
src/specify_cli/integrations/copilot/__init__.py— flag, env var, and deprecation logictests/test_workflows.py— test assertion updates and new env var testsTesting
All 141 tests pass (workflow + copilot integration suites).