feat: auto-approve GitHub Copilot in auto-yes mode#306
Open
anxkhn wants to merge 1 commit into
Open
Conversation
claude-squad launches each agent's command verbatim in tmux, so an autonomous (auto-yes) GitHub Copilot session stalls on Copilot's interactive trust/permission prompt with nothing to dismiss it. Add a copilot-aware program builder, mirroring how the repo already special-cases agents via the Program* constants. When a session runs in auto-yes mode and the program is copilot, tmux.AutoYesProgram appends the verified Copilot CLI auto-approve flags (--allow-all-tools --no-ask-user) so the agent runs without blocking. The helper is idempotent and leaves all other programs untouched. To make the auto-yes intent available at launch time, NewInstance now honors the previously unused InstanceOptions.AutoYes field, and the two session-creation sites in app pass the global auto-yes flag through. The flags are applied at every tmux launch site (new session, and paused session resume) so behavior is consistent across create and resume. Covered by unit tests asserting AutoYesProgram output and the exact tmux new-session argv built for copilot in auto-yes mode.
|
All contributors have signed the CLA ✍️ ✅ |
Author
|
I have read the CLA Document and I hereby sign the CLA |
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.
What
Makes GitHub Copilot a first-class agent for autonomous (auto-yes) sessions. claude-squad launches each agent's command verbatim in tmux, so an auto-yes Copilot session currently stalls on Copilot's interactive trust/permission prompt with nothing to dismiss it.
When a session runs in auto-yes mode and the configured program is
copilot, the launch command now gets Copilot's auto-approve flags appended:so the agent runs to completion without blocking.
How
tmux.AutoYesProgram(program, autoYes)helper (session/tmux/tmux.go), gated on a newProgramCopilotconstant, mirroring how the repo already special-cases agents by program name. It is idempotent, recognizes a user-configured--allow-all/--yolo, and leaves every other program (claude, aider, gemini, codex, ...) untouched.NewInstancenow honors the existingInstanceOptions.AutoYesfield so the auto-yes intent is known at launch; the two session-creation sites inapp/app.gopass the global auto-yes flag through.The flags are verified against GitHub Copilot CLI v1.0.65 (
--allow-all-tools= allow all tools to run automatically,--no-ask-user= disable the ask_user tool).Testing (on this machine)
go build ./...,go vet ./...,gofmt -l .,golangci-lint run(v1.60.1, the CI-pinned version), andgo test ./...all pass.TestAutoYesProgram(8 cases) andTestStartTmuxSessionCopilotAutoYesassert the exact tmux argv built for copilot in auto-yes mode:tmux new-session -d -s <name> -c <workdir> copilot --allow-all-tools --no-ask-user.copilot --helpv1.0.65.Notes
--model ...the user sets is kept).