Plugin OAuth auth methods silently ignored (shadowed by other plugins) #7225

Open
opened 2026-02-16 18:06:30 -05:00 by yindo · 8 comments
Owner

Originally created by @thoreinstein on GitHub (Jan 22, 2026).

Originally assigned to: @rekram1-node on GitHub.

Description

Description

Plugin OAuth authentication methods are silently ignored when multiple plugins provide authentication for the same provider. Currently, the first matching plugin found "shadows" all others, preventing their authentication methods (like OAuth) from being displayed.

Root Cause

In packages/opencode/src/cli/cmd/auth.ts, the code uses Plugin.list().then(x => x.find(...)) to locate a plugin for a given provider. This returns only the first plugin found. If opencode-websearch-cited (which only supports API keys for Google) is loaded before opencode-gemini-auth (which supports OAuth for Google), the OAuth option is never presented to the user.

Plugins

opencode-gemini-auth,opencode-websearch-cited

OpenCode version

1.1.3

Steps to reproduce

  1. Install opencode-gemini-auth and opencode-websearch-cited.
  2. Run opencode auth login.
  3. Select "Google".
  4. Observe that only the API key prompt appears; the OAuth option is missing.

Screenshot and/or share link

No response

Operating System

macOS 26.2

Terminal

Ghostty

Originally created by @thoreinstein on GitHub (Jan 22, 2026). Originally assigned to: @rekram1-node on GitHub. ### Description ## Description Plugin OAuth authentication methods are silently ignored when multiple plugins provide authentication for the same provider. Currently, the first matching plugin found "shadows" all others, preventing their authentication methods (like OAuth) from being displayed. ## Root Cause In `packages/opencode/src/cli/cmd/auth.ts`, the code uses `Plugin.list().then(x => x.find(...))` to locate a plugin for a given provider. This returns only the first plugin found. If `opencode-websearch-cited` (which only supports API keys for Google) is loaded before `opencode-gemini-auth` (which supports OAuth for Google), the OAuth option is never presented to the user. ### Plugins opencode-gemini-auth,opencode-websearch-cited ### OpenCode version 1.1.3 ### Steps to reproduce 1. Install `opencode-gemini-auth` and `opencode-websearch-cited`. 2. Run `opencode auth login`. 3. Select "Google". 4. Observe that only the API key prompt appears; the OAuth option is missing. ### Screenshot and/or share link _No response_ ### Operating System macOS 26.2 ### Terminal Ghostty
yindo added the bug label 2026-02-16 18:06:30 -05:00
Author
Owner

@github-actions[bot] commented on GitHub (Jan 22, 2026):

This issue might be a duplicate of existing issues. Please check:

  • #6261: bug: multiple plugins registering auth for the same provider silently overwrite each other
  • #9971: feat: OAuth Enhancements - Multi-Account, YOLO Mode, Auto-Relogin

Feel free to ignore if none of these address your specific case.

@github-actions[bot] commented on GitHub (Jan 22, 2026): This issue might be a duplicate of existing issues. Please check: - #6261: bug: multiple plugins registering auth for the same provider silently overwrite each other - #9971: feat: OAuth Enhancements - Multi-Account, YOLO Mode, Auto-Relogin Feel free to ignore if none of these address your specific case.
Author
Owner

@Teeflo commented on GitHub (Jan 28, 2026):

I’m seeing the same behavior on my side.
My config includes both opencode-gemini-auth@latest and opencode-antigravity-auth@beta, and when I run opencode auth login and pick Google, I only get the API key and antigravity – the OAuth method from opencode-gemini-auth never shows up.

@Teeflo commented on GitHub (Jan 28, 2026): I’m seeing the same behavior on my side. My config includes both opencode-gemini-auth@latest and opencode-antigravity-auth@beta, and when I run opencode auth login and pick Google, I only get the API key and antigravity – the OAuth method from opencode-gemini-auth never shows up.
Author
Owner

@manascb1344 commented on GitHub (Feb 8, 2026):

Linking #8297 for reference!

@manascb1344 commented on GitHub (Feb 8, 2026): Linking #8297 for reference!
Author
Owner

@manascb1344 commented on GitHub (Feb 8, 2026):

Same issue here: opencode auth login -> Select Google -> only "Enter your API key" is shown; "OAuth with Google (Antigravity)" never appears.

  • OpenCode 1.1.53, installed via curl -fsSL https://opencode.ai/install | bash
  • Plugin in config: opencode-google-antigravity-auth (shekohex)
  • DEBUG log shows the plugin loads: service=plugin path=opencode-google-antigravity-auth loading plugin
  • Tried: system terminal (not IDE), running from cd ~, waiting 5+ seconds before selecting Google, full reinstall with opencode uninstall --keep-config --keep-data then install script again. No change.

So the plugin loads but its OAuth method is not shown for Google; only the API key prompt appears. Likely the same root cause as this issue (plugin auth methods ignored or overwritten for Google).

@manascb1344 commented on GitHub (Feb 8, 2026): Same issue here: `opencode auth login` -> Select Google -> only "Enter your API key" is shown; "OAuth with Google (Antigravity)" never appears. - OpenCode 1.1.53, installed via `curl -fsSL https://opencode.ai/install | bash` - Plugin in config: `opencode-google-antigravity-auth` (shekohex) - DEBUG log shows the plugin loads: `service=plugin path=opencode-google-antigravity-auth loading plugin` - Tried: system terminal (not IDE), running from `cd ~`, waiting 5+ seconds before selecting Google, full reinstall with `opencode uninstall --keep-config --keep-data` then install script again. No change. So the plugin loads but its OAuth method is not shown for Google; only the API key prompt appears. Likely the same root cause as this issue (plugin auth methods ignored or overwritten for Google).
Author
Owner

@manascb1344 commented on GitHub (Feb 8, 2026):

Found the root cause and fixed it on my end.

The issue was opencode-websearch-cited also registering auth for the google provider. With two plugins registering for the same provider, only one survives (#6261) - and the API-key-only one won.

Fix: Removed opencode-websearch-cited from my plugin list so only opencode-antigravity-auth registers for Google. OAuth option appeared immediately after that.

So this is a symptom of #6261 (multiple plugins registering auth for the same provider silently overwrite each other). The fix in PR #6260 would resolve this properly by merging auth methods from all plugins.

@manascb1344 commented on GitHub (Feb 8, 2026): Found the root cause and fixed it on my end. The issue was `opencode-websearch-cited` also registering auth for the `google` provider. With two plugins registering for the same provider, only one survives (#6261) - and the API-key-only one won. **Fix:** Removed `opencode-websearch-cited` from my plugin list so only `opencode-antigravity-auth` registers for Google. OAuth option appeared immediately after that. So this is a symptom of #6261 (multiple plugins registering auth for the same provider silently overwrite each other). The fix in PR #6260 would resolve this properly by merging auth methods from all plugins.
Author
Owner

@Techie5879 commented on GitHub (Feb 8, 2026):

I dont understand why this is happening with me for OpenAI -- I have 3 plugins installed -

"opencode-antigravity-auth@latest",
"opencode-websearch-cited@1.2.0",
"opencode-antigravity-quota@0.1.6"

None of them should modify openai auth - but not sure whats happening here? Trying to auth with chatgpt subscription (Teams) is not possible either via opencode auth login or /connect

@Techie5879 commented on GitHub (Feb 8, 2026): I dont understand why this is happening with me for OpenAI -- I have 3 plugins installed - ``` "opencode-antigravity-auth@latest", "opencode-websearch-cited@1.2.0", "opencode-antigravity-quota@0.1.6" ``` None of them should modify openai auth - but not sure whats happening here? Trying to auth with chatgpt subscription (Teams) is not possible either via `opencode auth login` or `/connect`
Author
Owner

@rekram1-node commented on GitHub (Feb 8, 2026):

@Techie5879 what error are u seeing?

@rekram1-node commented on GitHub (Feb 8, 2026): @Techie5879 what error are u seeing?
Author
Owner

@Techie5879 commented on GitHub (Feb 8, 2026):

@rekram1-node

i seem to have narrowed it down to the web-search-cited plugin

With web-search-cited enabled and trying to do opencode auth login or even /connect:

I see no errors, but I see: (note openx is just an alias to opencode for me)

Image

Commenting the plugin out in .jsonc gives:

Image

Note: I have followed websearch-cited note of putting it at last and it still messes with the auth flow. I think the plugin is silently failing somehow (?) or affecting the auth flow. debug logs show nothing so far

@Techie5879 commented on GitHub (Feb 8, 2026): @rekram1-node i seem to have narrowed it down to the `web-search-cited` plugin With web-search-cited enabled and trying to do `opencode auth login` or even `/connect`: I see no errors, but I see: (note openx is just an alias to opencode for me) <img width="519" height="205" alt="Image" src="https://github.com/user-attachments/assets/bbf3f920-ed51-4dcc-969c-eb90793141c2" /> Commenting the plugin out in .jsonc gives: <img width="589" height="254" alt="Image" src="https://github.com/user-attachments/assets/c6830d07-c391-4363-a45c-f69d0acf065f" /> Note: I have followed websearch-cited note of putting it at last and it still messes with the auth flow. I think the plugin is silently failing somehow (?) or affecting the auth flow. debug logs show nothing so far
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: anomalyco/opencode#7225