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.
After trust is dismissed, cursor-addressed FIFO redraws can leave the monitor's
cached status at WAITING_USER_ANSWER even though the rendered pane is idle.
Copilot opts into fresh-pane recovery for that stale waiting state. Recovery
requires a quiet output buffer, two consecutive matching pane classifications,
and current-generation evidence; a live approval dialog remains waiting.
Copilot v1.0.95 has been observed with both a ❯ composer between separator
rules and an empty heavy-box composer (╻▄▄…, ┃, ╹▀▀…). The detector accepts
both captured layouts, independent of the mode displayed in the footer. For the
heavy box, matching borders, an empty interior, and the following Copilot hint
bar are required; active execution and trust/approval indicators still block
readiness. A plain capture-pane snapshot preserves visible box characters but
omits color and terminal negotiation sequences, so it does not establish why
Copilot selected a particular layout.
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
Its MCP config format has no working-directory key (checked against the vendor's own MCP documentation, 2026-09-16), so CAO carries an agent plugin's declared cwd by launching the server through /bin/sh -c 'cd -- "$1" && shift && exec "$@"'. exec replaces the shell, the environment passes through, and argument boundaries survive because each argument stays a separate argv element. On a host with no /bin/sh such a server is skipped with mcp.cwd_unsupported rather than started in the wrong directory.
See Agent Plugins for the full per-provider table.
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