Skip to content

feat: auto-approve GitHub Copilot in auto-yes mode#306

Open
anxkhn wants to merge 1 commit into
smtg-ai:mainfrom
anxkhn:feat/copilot-auto-yes
Open

feat: auto-approve GitHub Copilot in auto-yes mode#306
anxkhn wants to merge 1 commit into
smtg-ai:mainfrom
anxkhn:feat/copilot-auto-yes

Conversation

@anxkhn

@anxkhn anxkhn commented Jun 28, 2026

Copy link
Copy Markdown

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:

copilot  ->  copilot --allow-all-tools --no-ask-user

so the agent runs to completion without blocking.

How

  • New tmux.AutoYesProgram(program, autoYes) helper (session/tmux/tmux.go), gated on a new ProgramCopilot constant, 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.
  • NewInstance now honors the existing InstanceOptions.AutoYes field so the auto-yes intent is known at launch; the two session-creation sites in app/app.go pass the global auto-yes flag through.
  • The transform is applied at every tmux launch site (new session and paused-session resume).

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), and go test ./... all pass.
  • TestAutoYesProgram (8 cases) and TestStartTmuxSessionCopilotAutoYes assert 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.
  • The flags themselves were confirmed present in copilot --help v1.0.65.

Notes

  • Scope: the interactive trust-prompt pane-scraping path used for Claude/aider/gemini was intentionally not added for Copilot, because the flag-based approach is robust and Copilot's exact interactive prompt strings are not verified here. Model passthrough is preserved (any --model ... the user sets is kept).

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.
@github-actions

github-actions Bot commented Jun 28, 2026

Copy link
Copy Markdown

All contributors have signed the CLA ✍️ ✅
Posted by the CLA Assistant Lite bot.

@anxkhn

anxkhn commented Jun 28, 2026

Copy link
Copy Markdown
Author

I have read the CLA Document and I hereby sign the CLA

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.

1 participant