GeezerVison is showing github.com — bug: multiple plugins registering auth for the same provider silently overwrite each other · Issue #6261 · anomalyco/opencode
bug: multiple plugins registering auth for the same provider silently overwrite each other #6261
Description
When multiple plugins register authentication methods for the same provider (e.g., both opencode-antigravity-auth and opencode-websearch-cited register for google), only one plugin's methods are available. The other plugin's auth methods are silently discarded.
This affects both the CLI (opencode auth login) and the API (GET /provider/auth).
Root Cause
API (provider/auth.ts): Uses fromEntries() to build the methods map, which overwrites duplicate keys - last plugin wins.
CLI (cli/cmd/auth.ts): Uses .find() to get only the first matching plugin - first plugin wins.
Reproduction
- Install
opencode-antigravity-auth and opencode-websearch-cited
- Run
opencode auth login and select Google
- Only see "Google API key" - the Antigravity OAuth option is missing
Or via API:
curl -s http://127.0.0.1:7860/provider/auth | jq '.google'
# Returns only: [{ "type": "api", "label": "Google API key" }]
Expected
All auth methods from all plugins should be available for the same provider.
Fix
PR #6260
Activity
changed the title
[-]Multiple plugins registering auth for the same provider silently overwrite each other[/-] [+]bug: multiple plugins registering auth for the same provider silently overwrite each other[/+] on Dec 27, 2025github-actions commented on Dec 27, 2025
This issue might be a duplicate of existing issues. Please check:
Both of these issues describe related scenarios where multiple authentication credentials/instances for the same provider are needed. Your issue describes a specific bug where only one plugin's auth methods survive, which is the technical manifestation of this limitation.
Feel free to ignore if this is addressing a different specific case.
thdxr commented on Mar 25, 2026
To stay organized issues are automatically closed after 90 days of no activity. If the issue is still relevant please open a new one.
Metadata
Metadata
Development
No branches or pull requestsIssue actions