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
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes using high effort and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit fd59d96. Configure here.
There was a problem hiding this comment.
Effect service conventions review for the new GitHub Copilot provider. The previously-flagged import-namespace, CopilotCliPathResolutionError, and TextGenerationShape items now look resolved at this head. Two error-convention issues remain in changed scope.
Posted via Macroscope — Effect Service Conventions
There was a problem hiding this comment.
Effect service conventions: one new finding in CopilotTextGeneration.ts. Previously flagged issues (CopilotProbePromiseError in copilotRuntime.ts and the inline error-construction helpers in CopilotAdapter.ts) remain unaddressed but are not re-commented here to avoid duplication.
Posted via Macroscope — Effect Service Conventions

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
Touches checkpoint revert ordering and provider conversation rollback (filesystem + provider state), plus turn-completion matching logic that affects session readiness across providers.
Overview
Adds GitHub Copilot as a server provider via a new
CopilotDriverand@github/copilot/@github/copilot-sdkdependencies, wiring snapshot, adapter, and text generation like other built-in drivers.Checkpoint revert now verifies the target ref exists, restores the filesystem before calling provider rollback, and skips rollback when filesystem restore fails. If rollback fails after a successful restore, it attempts to restore the current checkpoint, refreshes workspace entries, and records a failure activity instead of leaving a half-applied revert.
Runtime ingestion accepts
turn.completedevents without aturnIdwhen the active turn still matches the provider session (or the provider has already cleared the active turn), and mapscontent.deltastreams into reasoning and tool output activities.First-turn orchestration queues title/branch generation on a drainable worker (with retries), broadens when auto-generated titles may replace truncated or provider-expanded seeds, and keeps
latestTurnIdonthread.session-setwhenactiveTurnIdis null.Reviewed by Cursor Bugbot for commit 790af4a. 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 and adapter support
copilotprovider driver (CopilotDriver.ts) and wires it into the built-in driver registry, making GitHub Copilot selectable in the UI alongside other providers.gpt-4.1), and display name mappings.deriveLatestContextWindowSnapshotto prefer the latest bounded window snapshot, stop at compaction events, and fall back to token-only snapshots when no limit is available.contextTier,variant) from incorrectly settingpromptEffortin the composer state.Macroscope summarized 790af4a.