Skip to content

fix: inherit provider loaders for provider aliases#18487

Open
raf1hh wants to merge 1 commit intoanomalyco:devfrom
raf1hh:fix/auth-provider-loader-inheritance
Open

fix: inherit provider loaders for provider aliases#18487
raf1hh wants to merge 1 commit intoanomalyco:devfrom
raf1hh:fix/auth-provider-loader-inheritance

Conversation

@raf1hh
Copy link

@raf1hh raf1hh commented Mar 21, 2026

Issue for this PR

Closes #18486

Type of change

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

What does this PR do?

Fix custom providers configured with auth_provider so they inherit the referenced provider's SDK options and model loader behavior.

Before this change, built-in auth/plugin loaders were only applied to the source provider id and there is no way to reuse built-in sdk auth/model-loading behavior.

This change applies plugin auth loaders to aliased providers and reuses model/vars loaders from the referenced provider, so config like this now works:

{
  "$schema": "https://opencode.ai/config.json",
  "provider": {
    "my-github-copilot": {
      "name": "My GitHub Copilot",
      "auth_provider": "github-copilot",
      "npm": "@ai-sdk/github-copilot"
    }
  }
}

With this change, my-github-copilot behaves like a GitHub Copilot-backed provider for auth/model loading, while still keeping its own provider id and config entry instead of overriding github-copilot directly.

Without this fix, using a custom id here is limiting because the aliased provider does not inherit the built-in loader behavior.

How did you verify your code works?

I cherry-picked this onto current upstream dev, verified the PR diff is limited to this fix, and ran bun typecheck from packages/opencode.

Screenshots / recordings

Not a UI change.

Checklist

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

@raf1hh raf1hh closed this Mar 21, 2026
@raf1hh raf1hh reopened this Mar 21, 2026
@raf1hh raf1hh changed the title fix: inherit provider loaders for auth_provider aliases fix: inherit provider loaders for provider aliases Mar 21, 2026
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.

custom providers do not inherit provider loaders

1 participant