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. |
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes 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 3bbc092. Configure here.
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>
Keep sidebarThreadSummaryById owned by shell updates by removing the detail-stream metadata patch and its regression test. 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>
Ensure Copilot session.error events complete the active turn as failed before clearing active turn state, and cover the lifecycle with a regression test. 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>

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
High Risk
Large new Copilot adapter surface plus changed checkpoint revert ordering affects filesystem and provider state together; mistakes could leave workspaces inconsistent after failed reverts.
Overview
GitHub Copilot is wired in as a server provider via
@github/copilot/@github/copilot-sdk, with a newCopilotDriverand a largeCopilotAdaptertest suite covering sessions, permissions, diffs, task output, queued turns, and lifecycle edge cases.Checkpoint revert now verifies the target git ref exists, restores the filesystem checkpoint before calling
rollbackConversation, and on provider rollback failure attempts to restore the pre-revert checkpoint, records a failure activity, and invalidates workspace entries; provider rollback is skipped when the initial filesystem restore fails.Read-model / UX fixes:
latestTurnIdand in-memorylatestTurnno longer advance when a different turn is still running; turn-diff completion respects the same rule. First-turn helpers enqueue title and branch generation on a drainable worker (title generation retries, replaces titles that match a truncated client seed), and reactor drain waits for that work. Runtime ingestion mapscontent.deltastreams intoreasoning.*andtool.outputthread activities. Checkpoint diff errors for missing refs are clearer in tests.Reviewed by Cursor Bugbot for commit b589b84. Bugbot is set up for automated code reviews on this repo. Configure here.
Note
Add GitHub Copilot as a built-in provider with full adapter, text generation, and settings support
copilotdriver kind end-to-end: settings schema, provider registry entry, UI provider picker, model picker sidebar, and icon mappingCopilotAdapterto integrate the GitHub Copilot SDK: starts/stops a client, creates/resumes sessions, translates SDK events intoProviderRuntimeevents, and manages turn lifecycle including diffs and token snapshotsCopilotTextGenerationfor commit messages, PR content, branch names, and thread titles using JSON-schema-constrained Copilot sessions with client reuse and idle auto-shutdownbinaryPath> bundled shim undernode_modules/.bin/copilot, normalizing POSIXSHELLandCOPILOT_FEATURE_FLAGSat runtimelatestTurn/latestTurnIdsettlement in the projector and store so in-progress turns are not prematurely overwritten by concurrent checkpoint or diff events@github/copilotand@github/copilot-sdkas server dependencies increases the bundle; the bundled CLI shim path resolution searches up to 8 ancestor directories of the module root at startupMacroscope summarized b589b84.