#18487 · @raf1hh · opened Mar 21, 2026 at 3:33 AM UTC · last updated Mar 21, 2026 at 4:18 AM UTC
fix: inherit provider loaders for provider aliases
Score breakdown
Impact
Clarity
Urgency
Ease Of Review
Guidelines
Readiness
Size
Trust
Traction
Summary
This PR aims to fix aliased custom providers not inheriting authentication and model loading behavior from their referenced base providers. It introduces an "auth_provider" field to allow this inheritance. This enables custom provider IDs to leverage built-in SDK logic previously unavailable.
Description
Issue for this PR
Closes #18486
Type of change
- [ ] Bug fix
- [x] New feature
- [x] 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
- [x] I have tested my changes locally
- [x] I have not included unrelated changes in this PR
Linked Issues
#18486 custom providers do not inherit provider loaders
View issueComments
No comments.
Changed Files
packages/opencode/src/config/config.ts
+4−0packages/opencode/src/provider/provider.ts
+42−9