Skip to content

Add Github Copilot Provider#1254

Draft
zortos293 wants to merge 22 commits intopingdotgg:mainfrom
zortos293:feat/copilot-integration
Draft

Add Github Copilot Provider#1254
zortos293 wants to merge 22 commits intopingdotgg:mainfrom
zortos293:feat/copilot-integration

Conversation

@zortos293
Copy link
Contributor

@zortos293 zortos293 commented Mar 20, 2026

What Changed

  • Added Copilot provider support across the server, shared contracts, and web UI.
  • Wired up Copilot adapter/session/health handling and related model plumbing.
  • Fixed thread provider binding so threads stay attached to the correct provider.

Why

  • This makes Copilot available as a first-class provider while keeping provider selection and thread routing predictable.

UI Changes

  • Updated provider picker/settings surfaces to include Copilot-related behavior and provider health state.

Checklist

  • This PR is small and focused
  • I explained what changed and why
  • I included before/after screenshots for any UI changes
  • I included a video for animation/interaction changes

Note

Add GitHub Copilot as a supported AI provider

  • Introduces a full CopilotAdapter service in CopilotAdapter.ts that integrates @github/copilot-sdk, supporting session start/resume, turn sending/aborting, interactive permission prompts, user-input requests, model/reasoning-effort switching, and thread reading.
  • Adds Copilot to the provider registry, health check system, session directory decoder, and server provider layer so it is available alongside Codex and Claude.
  • Extends contracts, shared model utilities, and app settings to define Copilot model slugs, aliases, default model (claude-sonnet-4.6), reasoning effort options, and persisted settings for copilotCliPath and copilotConfigDir.
  • Adds a settings UI section for Copilot CLI path and config directory, a GitHub icon in the model picker, and a PROVIDER_OPTIONS entry labeled 'GitHub Copilot'.
  • Includes a patch for @github/copilot-sdk@0.1.32 to fix an ESM import path in dist/session.js.
📊 Macroscope summarized 0a91001. 33 files reviewed, 8 issues evaluated, 1 issue filtered, 4 comments posted

🗂️ Filtered Issues

apps/web/src/appSettings.test.ts — 0 comments posted, 1 evaluated, 1 filtered
  • line 233: The test expects claude-sonnet-4.6 (with a period) for the copilot provider, but the analogous claudeAgent test on line 227 expects claude-sonnet-4-6 (with a hyphen). This inconsistency suggests a copy-paste typo - either the model slug format is wrong (period vs hyphen), or the copilot test should be checking for a copilot-specific normalized slug rather than a claude model slug. [ Out of scope (triage) ]

@github-actions github-actions bot added size:XXL 1,000+ changed lines (additions + deletions). vouch:unvouched PR author is not yet trusted in the VOUCHED list. labels Mar 20, 2026
@coderabbitai
Copy link

coderabbitai bot commented Mar 20, 2026

Important

Review skipped

Auto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

Run ID: 58d939f6-96ae-47ca-aff8-0d90b807fbce

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

});
}

const existing = sessions.get(input.threadId);
Copy link
Contributor

Choose a reason for hiding this comment

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

🟢 Low Layers/CopilotAdapter.ts:1390

When startSession finds an existing session with the same threadId, it returns the existing session immediately without applying any of the input parameters (model, reasoningEffort, runtimeMode). If the caller intends to reconfigure the session, those parameters are silently ignored and the existing session's current configuration is returned instead. Consider either reconfiguring the session to match the new parameters or throwing an error when the requested configuration differs from the existing session.

🚀 Reply "fix it for me" or copy this AI Prompt for your agent:
In file apps/server/src/provider/Layers/CopilotAdapter.ts around line 1390:

When `startSession` finds an existing session with the same `threadId`, it returns the existing session immediately without applying any of the input parameters (`model`, `reasoningEffort`, `runtimeMode`). If the caller intends to reconfigure the session, those parameters are silently ignored and the existing session's current configuration is returned instead. Consider either reconfiguring the session to match the new parameters or throwing an error when the requested configuration differs from the existing session.

Evidence trail:
apps/server/src/provider/Layers/CopilotAdapter.ts lines 1380-1403 (REVIEWED_COMMIT): Shows `startSession` returning existing session with `existing.runtimeMode`, `existing.model` instead of input parameters when `sessions.get(input.threadId)` finds a match.

apps/server/src/provider/Layers/CopilotAdapter.ts lines 1430-1483 (REVIEWED_COMMIT): Shows new session creation properly using `input.model`, `input.runtimeMode`, and `reasoningEffort` from input - confirming the contrast with the existing session path.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:XXL 1,000+ changed lines (additions + deletions). vouch:unvouched PR author is not yet trusted in the VOUCHED list.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant