fix: merge auth methods from multiple plugins for the same provider#6260
Open
Davincible wants to merge 1 commit intoanomalyco:devfrom
Open
fix: merge auth methods from multiple plugins for the same provider#6260Davincible wants to merge 1 commit intoanomalyco:devfrom
Davincible wants to merge 1 commit intoanomalyco:devfrom
Conversation
- Replace fromEntries() with merge loop in provider/auth.ts - Deduplicate aliased plugin exports in plugin/index.ts - Aggregate methods from all plugins in CLI auth.ts - Add source labels for non-native plugins (except generic API key methods)
This was referenced Jan 22, 2026
00637c0 to
71e0ba2
Compare
f1ae801 to
08fa7f7
Compare
|
This is a valid issue and this PR fixes it |
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.
Fixes auth method conflicts when multiple plugins register for the same provider.
Problem
fromEntries()inprovider/auth.tsoverwrites duplicate provider keys (last plugin wins).find()in CLIauth.tsreturns only the first matching pluginGoogleOAuthPlugin = AntigravityCLIOAuthPlugin) get loaded twiceSolution
Plugin loader (
plugin/index.ts): Track called functions to skip aliased exports; store package name in_sourcefieldAuth aggregation (
provider/auth.ts): ReplacefromEntries()with merge loop that accumulates methods from all pluginsCLI auth (
cli/cmd/auth.ts): Aggregate methods from all matching plugins instead of using.find()Labeling: Non-native plugins show source in label (e.g., "Google API key (websearch-cited)"), except for generic "Manually enter API Key" which is the same as native fallback
Before
{ "google": [{ "type": "api", "label": "Google API key" }] }After
{ "google": [ { "type": "oauth", "label": "OAuth with Google (Antigravity) (antigravity)" }, { "type": "api", "label": "Manually enter API Key" }, { "type": "api", "label": "Google API key (websearch-cited)" } ] }Test Cases