Skip to content

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

Merged
johntmyers merged 5 commits intoNVIDIA:mainfrom
htekdev:main
Mar 20, 2026
Merged

feat(providers): add GitHub Copilot CLI agent provider#476
johntmyers merged 5 commits intoNVIDIA:mainfrom
htekdev:main

Conversation

@htekdev
Copy link
Contributor

@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 is a standalone copilot binary — it 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 as a recognized provider type
  • Command detection: Standalone copilot binary detection (including full path resolution); gh alone still resolves to github
  • Network policy: Added copilot block in sandbox-policy.yaml with endpoints from GitHub's official Copilot allowlist reference:
    • github.com, api.github.com (auth, user management)
    • api.githubcopilot.com, api.individual.githubcopilot.com, api.business.githubcopilot.com, api.enterprise.githubcopilot.com (subscription-based API routing)
    • copilot-proxy.githubusercontent.com, origin-tracker.githubusercontent.com (model proxy)
    • copilot-telemetry.githubusercontent.com, default.exp-tas.com (telemetry, feature flags)
    • release-assets.githubusercontent.com (binary updates)
  • Binary paths: npm global install (/usr/lib/node_modules/@github/copilot/...), /usr/local/bin/copilot, ~/.local/bin/copilot, /usr/bin/node
  • 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 assertion: copilot
  • New command detection assertions: standalone copilot, /usr/local/bin/copilot, gh alone still maps to github

Checklist

  • Follows existing provider pattern (modeled after codex.rs)
  • Conventional commit format
  • Documentation updated
  • Network policy sourced from official GitHub allowlist docs
  • No secrets or credentials committed

htekdev and others added 2 commits March 19, 2026 12:26
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
feat(providers): add GitHub Copilot CLI agent provider
@htekdev htekdev requested a review from a team as a code owner March 19, 2026 17:34
@github-actions
Copy link

Thank you for your interest in contributing to OpenShell, @htekdev.

This project uses a vouch system for first-time contributors. Before submitting a pull request, you need to be vouched by a maintainer.

To get vouched:

  1. Open a Vouch Request discussion.
  2. Describe what you want to change and why.
  3. Write in your own words — do not have an AI generate the request.
  4. A maintainer will comment /vouch if approved.
  5. Once vouched, open a new PR (preferred) or reopen this one after a few minutes.

See CONTRIBUTING.md for details.

@github-actions github-actions bot closed this Mar 19, 2026
@github-actions
Copy link

github-actions bot commented Mar 19, 2026

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

@htekdev
Copy link
Contributor Author

htekdev commented Mar 19, 2026

I have read the DCO document and I hereby sign the DCO.

@johntmyers johntmyers reopened this Mar 19, 2026
Copy link
Collaborator

@johntmyers johntmyers left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That policy is only for testing. I would recommend creating a new sandbox template here: https://github.com/NVIDIA/OpenShell-community where you can ensure co-pilot installs on the image and you can provide a default policy to be used. The other templates should give you a good blueprint for doing that. Not a blocker to adding this as a provider here but I think is useful for anyone wanting to get up and running quickly.

@htekdev
Copy link
Contributor Author

htekdev commented Mar 19, 2026

That policy is only for testing. I would recommend creating a new sandbox template here: https://github.com/NVIDIA/OpenShell-community where you can ensure co-pilot installs on the image and you can provide a default policy to be used. The other templates should give you a good blueprint for doing that. Not a blocker to adding this as a provider here but I think is useful for anyone wanting to get up and running quickly.

We have another PR coming for that one too.

NVIDIA/OpenShell-Community#47

The copilot provider uses a standalone copilot binary, not gh copilot.
Removes the two-token subcommand detection block and its corresponding test.
@htekdev htekdev requested a review from johntmyers March 19, 2026 21:15
htekdev added 2 commits March 19, 2026 16:15
The copilot provider is just 'copilot', not 'gh copilot' or 'github-copilot'.
Simplifies the normalize_provider_type match to only accept 'copilot'.
Adds missing endpoints from GitHub's official Copilot allowlist reference:
- api.individual.githubcopilot.com (Pro/Pro+ plan routing)
- api.business.githubcopilot.com (Business plan routing)
- copilot-proxy.githubusercontent.com (model proxy)
- copilot-telemetry.githubusercontent.com (telemetry)
- default.exp-tas.com (feature flags/experimentation)
- origin-tracker.githubusercontent.com (API service)

Removes gh binaries since copilot is a standalone binary, not gh copilot.

Source: https://docs.github.com/en/copilot/reference/copilot-allowlist-reference
@johntmyers johntmyers merged commit eff88b7 into NVIDIA:main Mar 20, 2026
9 of 10 checks passed
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