Add GitHub Copilot as a built-in provider - #3076
Conversation
|
Important Review skippedAuto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Pro Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
ApprovabilityVerdict: Needs human review Diff is too large for automated approval analysis. A human reviewer should evaluate this PR. You can customize Macroscope's approvability policy. Learn more. |
5ae2460 to
acf1c04
Compare
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
|
might add new providers after orchestrator has merged #2829 |
This PR supersedes #2185. It includes the full Copilot integration from that PR plus the fixes and hardening discovered while testing it against the current codebase.
What Changed
Why
T3 Code supports multiple agent providers, but did not have GitHub Copilot support. This adds Copilot end to end in the same shape as the existing providers, so users can configure Copilot, select Copilot models, use Copilot for git text generation, and rely on the same session/runtime flows as other providers.
The extra hardening keeps Copilot predictable under real usage: turns complete once, tool output and reasoning project correctly, diffs are only emitted when meaningful, permission replies resolve cleanly, checkpoint handling is safer, and provider status/model data stays accurate.
UI Changes
Updated model picker:

Provider settings:

Checklist
Note
Medium Risk
New external SDK integration on the provider/session path with complex turn-idle queuing and permission handling; risk is mitigated by broad adapter tests but runtime behavior is still new surface area.
Overview
Adds
@github/copilotand@github/copilot-sdkto the server and introducesCopilotDriver, which follows the sameProviderDrivershape as other agents: per-instance state underproviders/copilot/{instanceId}, a managed provider snapshot (hourly refresh),makeCopilotAdapterfor sessions/turns/events, andmakeCopilotTextGenerationfor git-style text tasks.The bulk of the diff is a new
CopilotAdapter.testsuite (mocked SDK runtime) that locks in Copilot-specific behavior: permission and user-input flows (including bootstrap correlation andacceptForSession), MCP OAuth/header refresh without leaking secrets, resume/rollback via SDK history truncate, queued-turn and multi-session.idlecompletion semantics, plan-mode andTask_completeprojection, diffs from writes/Apply_patch, interrupts, stop-session draining, and failure paths (quota, send reject).Reviewed by Cursor Bugbot for commit 5e461d8. Bugbot is set up for automated code reviews on this repo. Configure here.
Note
Add GitHub Copilot as a built-in provider with full text generation support
copilotdriver registered in the provider registry, backed by the@github/copilot-sdkpackage, with settings forbinaryPath,serverUrl, and custom models.CopilotTextGenerationthat shares a singleCopilotClientper (cwd, settings) key, coalesces concurrent startups, and auto-stops idle clients after 30 seconds.CopilotAdapterfor session/turn/tool management andCopilotProviderfor status probing, auth snapshots, and model enumeration including long-context tier detection.gpt-4.1; the 'Coming soon' placeholder is removed.ServerSettingsServicenow replays its latest snapshot to late subscribers ({ replay: 1 }), changing subscription semantics for all consumers.Macroscope summarized 5e461d8.
Copilot SDK Lifecycle Note (Adapter)