fix: solve #3862 — Copilot CLI rejects prompt as positional arg#3863
Draft
github-actions[bot] wants to merge 1 commit into
Draft
fix: solve #3862 — Copilot CLI rejects prompt as positional arg#3863github-actions[bot] wants to merge 1 commit into
github-actions[bot] wants to merge 1 commit into
Conversation
The Copilot prompt-launch command was built as `copilot -i --allow-tool=write "<prompt>"`. The Copilot CLI treats `-i` as interactive mode, which accepts no positional arguments, so launching from the new workspace modal failed with: error: too many arguments. Expected 0 arguments but got 1. Pass the prompt through Copilot's `--prompt` flag instead, with the flag placed last so the heredoc-quoted value becomes its argument. The same fix is applied to the legacy permissions migration so pre-#3546 users are not migrated into the broken command shape. Closes #3862
WestonReed
approved these changes
Apr 29, 2026
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.
Root cause
The Copilot prompt-launch command was being built as:
The GitHub Copilot CLI treats
-ias interactive mode, which accepts no positional arguments. Passing the heredoc-quoted prompt as a positional therefore fails with:This blocks launching Copilot from the new workspace modal whenever a prompt is supplied.
The fix
Replace
-iwith the--promptflag in Copilot'spromptCommand, placing the flag last so the existing prompt-builder (${command} "$(cat <<EOF…)") emits the heredoc as the value of--prompt:The same change is applied to
LEGACY_BUILTIN_TERMINAL_AGENT_OVERRIDES.copilot.promptCommandinagent-permissions-migration.tsso pre-#3546 users running the YOLO migration are not migrated into the broken shape.The non-prompt
command(copilot --allow-tool=write) is unchanged — Copilot starts in interactive mode by default when no flags are supplied.Tests
passes copilot prompts via --prompt flag, not as positionalinpackages/shared/src/agent-command.test.ts— fails on the buggycopilot -i …shape and passes on the fix.packages/shared/pass.Closes #3862
Summary by cubic
Fixes #3862 by passing Copilot prompts via the
--promptflag instead of a positional arg, so launching from the new workspace modal works again. Interactive mode-ino longer rejects prompts.copilotpromptCommandtocopilot --allow-tool=write --prompt "$(cat <<'…')"; removed-i.LEGACY_BUILTIN_TERMINAL_AGENT_OVERRIDES.copilot.promptCommandto avoid migrating users into the broken command shape.Written for commit 4db6d9d. Summary will update on new commits. Review in cubic