feat: surface plugin auth providers in the login picker#13921
Merged
rekram1-node merged 2 commits intoanomalyco:devfrom Feb 17, 2026
Merged
feat: surface plugin auth providers in the login picker#13921rekram1-node merged 2 commits intoanomalyco:devfrom
rekram1-node merged 2 commits intoanomalyco:devfrom
Conversation
Contributor
|
Thanks for your contribution! This PR doesn't have a linked issue. All PRs must reference an existing issue. Please:
See CONTRIBUTING.md for details. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What does this PR do?
Fixes #13917.
Plugins can register auth for providers not in models.dev, but those providers don't show up in the
opencode auth loginpicker. The workaround is passing the provider ID as a positional arg — which works fine if you set up the environment yourself, but falls apart in teams or managed setups where users shouldn't need to know what provider ID their plugin registered. The picker is supposed to be the discovery mechanism; if it doesn't show what's available, it's not doing its job.This adds a
resolvePluginProvidersfunction that collects auth providers from loaded plugins, deduplicates, and appends them to the picker with a(plugin)hint. Providers already in models.dev are not added again — they're already in the picker, and the existing post-selection logic already checksPlugin.list()for plugin auth on any selected provider, so plugins like codex and copilot that register auth for built-in providers continue to work as before. This change only adds picker entries for providers that would otherwise be invisible.The existing
enabled_providers/disabled_providersconfig is respected for plugin providers too — same filtering logic, same precedence.How did you verify your code works?
resolvePluginProvidersis a pure function, so the unit tests exercise it directly without mocking — feed it different combinations of hooks, existing providers, and enabled/disabled sets, check what comes out.For the end-to-end path, I pointed
OPENCODE_MODELS_API_URLat a localhost server with a custom provider definition and ranbun dev -- auth loginwith a plugin registeringauth.provider: "portkey-test". It shows up in the picker with a(plugin)hint, is searchable, and selectable.