Skip to content

feat(provider): github copilot auto model#20522

Open
Aarogaming wants to merge 4 commits intoanomalyco:devfrom
Aarogaming:feat/github-copilot-provider
Open

feat(provider): github copilot auto model#20522
Aarogaming wants to merge 4 commits intoanomalyco:devfrom
Aarogaming:feat/github-copilot-provider

Conversation

@Aarogaming
Copy link
Copy Markdown

@Aarogaming Aarogaming commented Apr 1, 2026

Issue for this PR

Closes #20607

Type of change

  • Bug fix
  • New feature
  • Refactor / code improvement
  • Documentation

What does this PR do?

Adds support for GitHub Copilot Auto model provider as a native integration, expanding our supported LLMs.

How did you verify your code works?

Tested the new provider internally via the UI and checked the network requests and token authentication.

Screenshots / recordings

Checklist

  • I have tested my changes locally
  • I have not included unrelated changes in this PR

Copilot AI review requested due to automatic review settings April 1, 2026 17:59
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Adds a native github-copilot/auto model entry so the Copilot provider can delegate “model selection” to GitHub Copilot (“Auto”) rather than requiring users to pick a concrete model ID.

Changes:

  • Extend the github-copilot custom loader to inject an auto model into the provider’s model list.
  • Define metadata/capabilities/limits for the new auto model entry.
  • Keep the existing Copilot getModel selection logic (chat vs responses) unchanged.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

family: "copilot-auto",
api: {
id: "auto",
url: "https://api.github.com/copilot",
Copy link

Copilot AI Apr 1, 2026

Choose a reason for hiding this comment

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

The new Copilot "auto" model hard-codes api.url to https://api.github.com/copilot, but the rest of the Copilot integration (and existing tests) expect the Copilot base URL to be https://api.githubcopilot.com. This will route requests to the wrong host. Use the same base URL as the other github-copilot models (e.g., copy from an existing model in input.models) or update the URL to the correct Copilot endpoint.

Suggested change
url: "https://api.github.com/copilot",
url: "https://api.githubcopilot.com",

Copilot uses AI. Check for mistakes.
Comment on lines +208 to +212
input.models["auto"] = {
id: ModelID.make("auto"),
providerID: ProviderID.make("github-copilot"),
name: "Auto (Server Selected)",
family: "copilot-auto",
Copy link

Copilot AI Apr 1, 2026

Choose a reason for hiding this comment

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

input.models["auto"] is assigned unconditionally. Because CUSTOM_LOADERS run after the config-based database extension, this will overwrite any user-specified provider.github-copilot.models.auto configuration (and would also clobber a future models.dev-provided auto entry). Add a guard (only create the model when it doesn’t already exist) or merge with the existing definition so config can override fields like limits/headers/options.

Copilot uses AI. Check for mistakes.
Comment on lines +207 to +216
"github-copilot": async (input) => {
input.models["auto"] = {
id: ModelID.make("auto"),
providerID: ProviderID.make("github-copilot"),
name: "Auto (Server Selected)",
family: "copilot-auto",
api: {
id: "auto",
url: "https://api.github.com/copilot",
npm: "@ai-sdk/github-copilot",
Copy link

Copilot AI Apr 1, 2026

Choose a reason for hiding this comment

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

This change adds a new built-in model entry ("github-copilot/auto") via a custom loader, but there isn’t any test coverage ensuring it shows up in Provider.list() (and that its api.url/api.npm are correct) under typical config/env setups. Please add a provider-layer test (similar to existing packages/opencode/test/provider/provider.test.ts cases) that asserts the auto model is present and uses the expected Copilot base URL.

Copilot uses AI. Check for mistakes.
@Aarogaming Aarogaming requested a review from adamdotdevin as a code owner April 1, 2026 18:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Feature Request: GitHub Copilot Auto model provider

2 participants