Skip to content

bug: multiple plugins registering auth for the same provider silently overwrite each other #6261

Closed as not planned

Description

@Davincible

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

  1. Install opencode-antigravity-auth and opencode-websearch-cited
  2. Run opencode auth login and select Google
  3. 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

  1. 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, 2025
  2. github-actions commented on Dec 27, 2025

    @github-actions
    Contributor

    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.

  3. thdxr commented on Mar 25, 2026

    @thdxr
    Member

    To stay organized issues are automatically closed after 90 days of no activity. If the issue is still relevant please open a new one.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions