Skip to content

Add GitHub Copilot CLI as a worker backend preset - #19

Open
anxkhn wants to merge 1 commit into
luckeyfaraday:mainfrom
anxkhn:feat/copilot-preset
Open

Add GitHub Copilot CLI as a worker backend preset#19
anxkhn wants to merge 1 commit into
luckeyfaraday:mainfrom
anxkhn:feat/copilot-preset

Conversation

@anxkhn

@anxkhn anxkhn commented Jun 29, 2026

Copy link
Copy Markdown

What

Adds a copilot preset so the loop can drive GitHub Copilot CLI as a worker backend, alongside the existing claude_code / codex / opencode / aider presets.

The preset mirrors the existing ones in agentloop/adapters/cli.py:

copilot -p {combined} -s --no-ask-user [--allow-all-tools] [--model <model>]
  • -s prints only the final answer (clean stdout to parse, same as the others).
  • --no-ask-user keeps the worker autonomous so it never blocks on a question.
  • --allow-all-tools is gated behind skip_permissions (the bypass analogue to claude's --dangerously-skip-permissions).
  • --model is passed through, same as claude_code.

Wiring

  • agentloop/adapters/cli.py: new CliAgent.copilot preset.
  • agentloop/mcp_server.py: registered in _CLI_PRESETS, the doctor executable map, backend=auto caller detection (alias + COPILOT_CLI / COPILOT_AGENT_SESSION_ID env hints), and model passthrough.
  • examples/run_with_cli_agent.py and README: copilot listed as a selectable backend.

Verification

  • uv pip install -e .[dev,mcp]; ruff clean on touched files; full suite 109 passed.
  • Added preset shape / skip-permissions / model-passthrough tests.
  • Smoke-tested against the real copilot CLI (v1.0.65, authenticated): the preset round-trips a prompt and returns the expected single-word answer.

Note

This repo has no LICENSE file. Please confirm the intended license / contribution terms before merging.

@anxkhn
anxkhn force-pushed the feat/copilot-preset branch from df0b887 to dacf7f4 Compare June 29, 2026 05:26
@luckeyfaraday

Copy link
Copy Markdown
Owner

Reviewed locally. The license concern in the PR body is resolved now: the repo is clearly MIT-licensed on main and GitHub detects the MIT License widget; follow-up metadata PR #20 is merged.

Local verification:

  • python3 -m pytest passes (109 passed)
  • GitHub reports this PR as mergeable/clean
  • Copilot CLI flags used here match GitHub's documented CLI reference

I could not reproduce the real Copilot CLI smoke test locally because this machine does not have copilot installed, but I do not see a merge blocker from the code or tests.

Adds a copilot preset to CliAgent mirroring the existing claude/codex/
opencode/aider templates: builds copilot -p {combined} -s --no-ask-user,
gates --allow-all-tools behind skip_permissions, and passes --model through.
Wires it into the MCP server presets, backend list, executable map, caller
auto-detect (alias + COPILOT_CLI/COPILOT_AGENT_SESSION_ID env hints), model
passthrough, the example runner, and README. Adds preset and backend tests.
@anxkhn
anxkhn force-pushed the feat/copilot-preset branch from dacf7f4 to b5d4304 Compare July 8, 2026 20:11
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.

2 participants