Skip to content

feat(providers): add GitHub Copilot CLI agent provider#1

Merged
htekdev merged 1 commit intomainfrom
feat/add-copilot-provider
Mar 19, 2026
Merged

feat(providers): add GitHub Copilot CLI agent provider#1
htekdev merged 1 commit intomainfrom
feat/add-copilot-provider

Conversation

@htekdev
Copy link
Owner

@htekdev htekdev commented Mar 19, 2026

Summary

  • Adds copilot as a new supported agent provider following the existing provider pattern (claude, codex, opencode)
  • Copilot CLI manages its own API communication to *.githubcopilot.com, so no inference routing changes are needed
  • Supports credential discovery via COPILOT_GITHUB_TOKEN, GH_TOKEN, and GITHUB_TOKEN env vars

Related Issue

N/A — new agent support request.

Changes

  • New file: crates/openshell-providers/src/providers/copilot.rsCopilotProvider struct with credential discovery and unit test
  • Registry: Registered CopilotProvider in ProviderRegistry::new()
  • Normalization: Added copilot, gh-copilot, github-copilot aliases
  • Command detection: Added two-token gh copilot wrapper detection before existing single-token logic; gh alone still resolves to github
  • Network policy: Added copilot block in sandbox-policy.yaml with GitHub/Copilot API endpoints and binary paths (npm, brew, user-local, node, gh)
  • Docs: Updated supported-agents.md, README.md (quickstart, tools table, providers section, supported agents table)

Testing

  • New unit test: discovers_copilot_env_credentials
  • New normalization assertions: copilot, gh-copilot, github-copilot
  • New command detection assertions: standalone copilot, /usr/local/bin/copilot, gh copilot wrapper, gh alone still maps to github

Checklist

  • Follows existing provider pattern (modeled after codex.rs)
  • Conventional commit format
  • Documentation updated
  • No secrets or credentials committed

Add copilot as a new supported agent provider, following the same
pattern as existing providers (claude, codex, opencode). Copilot CLI
manages its own API communication so no inference routing changes are
needed.

- New CopilotProvider with COPILOT_GITHUB_TOKEN/GH_TOKEN/GITHUB_TOKEN
  credential discovery
- Normalization aliases: copilot, gh-copilot, github-copilot
- Two-token command detection for `gh copilot` wrapper invocation
- Network policy with GitHub and Copilot API endpoints
- Updated docs and README with Copilot agent references
@htekdev htekdev merged commit f0c533f into main Mar 19, 2026
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