Skip to content

Add Github Copilot Provider#1254

Open
zortos293 wants to merge 23 commits intopingdotgg:mainfrom
zortos293:feat/copilot-integration
Open

Add Github Copilot Provider#1254
zortos293 wants to merge 23 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 provider across server, contracts, and UI

  • Adds @github/copilot-sdk integration via a new CopilotAdapter service that manages session lifecycle, turn tracking, and health checks including auth state and model enumeration.
  • Extends contracts and shared model utilities to support 'copilot' as a ProviderKind with model options, slug aliases, reasoning effort options, and CopilotModelOptions schema.
  • Adds settings UI for Copilot CLI path and config directory, custom model management, and a CopilotTraitsPicker for selecting reasoning effort when supported by the model.
  • Registers GitHub Copilot in ProviderAdapterRegistry, PROVIDER_OPTIONS, the provider model picker (with GitHub icon), and health banner.
  • Risk: The Copilot adapter spawns an external CLI process; health check timeout varies by platform (10s on Windows, default otherwise), and unauthenticated status is reported as an error.

Macroscope summarized 93bc16e.


Note

High Risk
Adds a new first-class provider with substantial new session/event-handling code and CLI probing, and adjusts thread provider-binding rules in the orchestration reactor, which could affect routing and turn start behavior across providers.

Overview
Adds GitHub Copilot as a first-class provider end-to-end: server now includes a CopilotAdapter built on @github/copilot-sdk (session lifecycle, model/mode switching, approvals & user-input requests, runtime event mapping, and turn/usage tracking) plus bundled CLI path resolution.

Extends provider plumbing to include Copilot in ProviderAdapterRegistry, ProviderHealth (including runtime model metadata for reasoning), ProviderSessionDirectory, and server wiring, and updates ProviderCommandReactor to bind pristine threads to an explicitly requested/inferred provider while rejecting provider switches once a thread is effectively locked.

Updates the web app to expose Copilot in the provider picker, health banner, install/settings (Copilot CLI path/config dir, custom Copilot models), and adds a Copilot traits picker that selects reasoning effort using runtime model capabilities when available.

Written by Cursor Bugbot for commit 93bc16e. This will update automatically on new commits. Configure here.

@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: 6523b718-bfd1-490d-92a8-723a17c506ba

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.

@zortos293 zortos293 marked this pull request as ready for review March 24, 2026 13:47
}),
).toBeUndefined();
});
});
Copy link
Contributor

Choose a reason for hiding this comment

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

Duplicate getProviderStartOptions test describe blocks

Low Severity

Two identical describe("getProviderStartOptions", ...) blocks exist in the same file, each containing "returns only populated provider overrides" and "returns undefined when no provider overrides are configured" tests with the same copilot-inclusive assertions. The first block (newly added) and the second block (modified existing) are fully redundant.

Additional Locations (1)
Fix in Cursor Fix in Web

Copy link
Contributor

@cursor cursor bot left a comment

Choose a reason for hiding this comment

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

Cursor Bugbot has reviewed your changes and found 2 potential issues.

There are 3 total unresolved issues (including 1 from previous review).

Fix All in Cursor

Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

_tag: "CopilotHealthProbeError",
cause,
}) satisfies CopilotHealthProbeError,
}).pipe(Effect.timeoutOption(getCopilotHealthCheckTimeoutMs()), Effect.result);
Copy link
Contributor

Choose a reason for hiding this comment

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

timeoutOption called with milliseconds instead of Duration

Medium Severity

Effect.timeoutOption expects a Duration value, but getCopilotHealthCheckTimeoutMs() returns a raw number (milliseconds). While Effect treats plain numbers as milliseconds in some APIs, the existing codebase passes DEFAULT_TIMEOUT_MS (also a raw number) to Effect.timeoutOption at other call sites, so this is consistent. However, getCopilotHealthCheckTimeoutMs returns 10,000 on Windows vs 4,000 elsewhere—the Windows-specific timeout of 10 seconds may be insufficient given that the Copilot health probe starts a CLI process, calls getStatus, getAuthStatus, and potentially listModels sequentially inside a single promise. If the probe times out, the finally block calling client.stop() may not run, leaking the Copilot CLI process.

Additional Locations (1)
Fix in Cursor Fix in Web

}).pipe(Effect.timeoutOption(getCopilotHealthCheckTimeoutMs()), Effect.result);

if (Result.isFailure(probe)) {
const error = probe.failure.cause;
Copy link
Contributor

Choose a reason for hiding this comment

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

Failure cause access incorrect after Effect.result wrapping

Medium Severity

When Result.isFailure(probe) is true after Effect.result, probe.failure is an Effect Cause, not the CopilotHealthProbeError directly. Accessing probe.failure.cause retrieves the Cause's internal cause chain rather than the CopilotHealthProbeError.cause field. The instanceof Error check on line 662 will likely fail, producing the generic fallback message and hiding the actual error details.

Fix in Cursor Fix in Web

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