The Copilot provider enables CLI Agent Orchestrator (CAO) to run GitHub Copilot CLI in tmux-managed sessions.
This provider targets the current Copilot CLI surface (latest versions) and does not include legacy compatibility fallbacks.
- GitHub Copilot access and successful
copilot login - Copilot CLI installed (
copilotcommand available) - tmux installed
# Install Copilot CLI
npm install -g @github/copilot
# Authenticate
copilot login
# Verify
copilot --version
copilot --help# Start CAO server
cao-server
# Install CAO agent profile into Copilot's agents directory
cao install examples/assign/data_analyst.md --provider copilot_cli
# Launch Copilot-backed terminal
cao launch --agents data_analyst --provider copilot_cliVia HTTP API:
curl -X POST "http://localhost:9889/sessions?provider=copilot_cli&agent_profile=developer"The provider detects:
- IDLE: Copilot prompt visible, no pending response
- PROCESSING: no idle prompt yet / still running
- WAITING_USER_ANSWER: trust/confirmation prompt visible
- COMPLETED: response present and prompt returned
- ERROR: explicit error output detected
Trust handling is done in initialize(). get_status() is read-only.
GET /terminals/{terminal_id}/output?mode=last extracts the final assistant message by:
- Finding output after last user prompt line
- Trimming tail prompts/footer lines
- Falling back to assistant-prefix extraction
Copilot provider now follows the same split as other providers:
cao install --provider copilot_cliwrites<name>.agent.mdinto~/.copilot/agents- provider launch passes
--agent <name>directly - provider does not generate runtime agent markdown files
This keeps provider logic thin and moves profile materialization to install-time.
CAO injects cao-mcp-server at runtime via:
--additional-mcp-config <json>
Implementation:
- Add
cao-mcp-serverwithCAO_TERMINAL_ID - Pass the merged MCP payload inline as JSON
Provider expects these flags in your Copilot CLI:
--agent--additional-mcp-config--allow-all--autopilot
When --additional-mcp-config is missing from your copilot --help, CAO skips MCP config injection.
copilot --allow-all [--agent <name>] --config-dir ~/.copilot \
--add-dir <cwd> --additional-mcp-config '{"mcpServers":{...}}' --autopilotCopilot provider currently has no provider-specific environment knobs.
- Provider file:
src/cli_agent_orchestrator/providers/copilot_cli.py - Exit command:
/exit - Paste behavior: single Enter (
paste_enter_count = 1)
# Unit tests
uv run pytest test/providers/test_copilot_cli_unit.py -v
uv run pytest test/providers/test_provider_manager_unit.py -v
# Copilot E2E
uv run pytest -m e2e test/e2e/ -k copilot -v -o "addopts="Maintainer-requested scenarios:
uv run pytest -m e2e test/e2e/test_assign.py::TestCopilotCliAssign::test_assign_data_analyst -v -o "addopts="
uv run pytest -m e2e test/e2e/test_assign.py::TestCopilotCliAssign::test_assign_report_generator -v -o "addopts="
uv run pytest -m e2e test/e2e/test_supervisor_orchestration.py::TestCopilotCliSupervisorOrchestration::test_supervisor_handoff -v -o "addopts="
uv run pytest -m e2e test/e2e/test_supervisor_orchestration.py::TestCopilotCliSupervisorOrchestration::test_supervisor_assign_and_handoff -v -o "addopts="
uv run pytest -m e2e test/e2e/test_supervisor_orchestration.py::TestCopilotCliSupervisorOrchestration::test_supervisor_assign_three_analysts -v -o "addopts="-
Copilot does not start
- Re-run
copilot login - Verify
copilot --version - Verify required flags in
copilot --help
- Re-run
-
Agent profile not applied
- Install profile:
cao install <profile>.md --provider copilot_cli - Launch with
cao launch --agents <agent-name> --provider copilot_cli
- Install profile:
-
MCP tools missing
- Ensure
cao-mcp-serveris resolvable in current environment
- Ensure
-
Stuck in WAITING_USER_ANSWER
- Check active tmux pane for trust/confirmation prompt and answer once