You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
- Add Known Limitations section to troubleshooting docs explaining that
OpenCode blocks this plugin by design (skips plugins with
'opencode-openai-codex-auth' in the name)
- Add prominent warning to README about the issue
- Include OPENCODE_PR_PROPOSAL.md with upstream fix proposal
- Fix: remove debug console.log statements from loader
- Fix: check multiAccount flag before handling auth (coexist with built-in)
Closes#11
Enable OpenCode to authenticate against **OpenAI's Codex backend** via OAuth so you can use ChatGPT Plus/Pro rate limits and access models like `gpt-5.2`, `gpt-5.2-codex`, and `gpt-5.1-codex-max` with your ChatGPT credentials.
9
9
10
+
> [!WARNING]
11
+
> **Known Issue:** OpenCode currently blocks this plugin by design. The plugin downloads but never loads because OpenCode's plugin loader skips plugins containing `opencode-openai-codex-auth` in the name (to prevent conflicts with the built-in auth). We're working on an upstream fix. See [Issue #11](https://github.com/ndycode/opencode-chatgpt-multi-auth/issues/11) and [Troubleshooting](docs/troubleshooting.md#known-limitations) for details.
12
+
10
13
## What You Get
11
14
12
15
-**GPT-5.2, GPT-5.2 Codex, GPT-5.1 Codex Max** and all GPT-5.x variants via ChatGPT OAuth
@@ -48,7 +51,7 @@ Enable OpenCode to authenticate against **OpenAI's Codex backend** via OAuth so
48
51
Paste this into any LLM agent (Claude Code, OpenCode, Cursor, etc.):
49
52
50
53
```
51
-
Install the opencode-openai-codex-auth-multi plugin and add the OpenAI model definitions to ~/.config/opencode/opencode.json by following: https://raw.githubusercontent.com/ndycode/opencode-openai-codex-auth-multi/main/README.md
54
+
Install the opencode-openai-codex-auth-multi plugin and add the OpenAI model definitions to ~/.config/opencode/opencode.json by following: https://raw.githubusercontent.com/ndycode/opencode-chatgpt-multi-auth/main/README.md
# OpenCode PR: Merge Auth Methods from Multiple Plugins
2
+
3
+
## Problem
4
+
5
+
When multiple plugins register for the same provider (e.g., `openai`), only the first plugin's auth methods are shown. This is because `auth.ts:310` uses `.find()` which returns the first match:
Since internal plugins (like `CodexAuthPlugin`) load before external plugins, external plugins can never add auth methods to providers that have internal plugins.
12
+
13
+
## Use Case
14
+
15
+
Multi-account authentication plugins need to add their auth methods alongside built-in options. For example:
16
+
- Built-in: "ChatGPT Pro/Plus"
17
+
- External: "ChatGPT Pro/Plus (Multi-Account)"
18
+
19
+
Users should see both options when selecting OpenAI provider.
20
+
21
+
## Proposed Solution
22
+
23
+
Change `auth.ts` to collect and merge auth methods from ALL plugins that register for the same provider:
1.**Backward Compatible**: Existing behavior unchanged for providers with single plugin
84
+
2.**Extensible**: External plugins can add auth methods to any provider
85
+
3.**Priority Preserved**: Internal plugins' loaders still take precedence
86
+
4.**Minimal Change**: ~10 lines changed, no new dependencies
87
+
88
+
## Testing
89
+
90
+
1. Install an external plugin that registers for `openai` provider
91
+
2. Run `opencode auth login` → select "OpenAI"
92
+
3. Verify both internal and external auth methods appear in the list
93
+
94
+
## Alternative Considered
95
+
96
+
Have external plugins use different provider IDs (e.g., `openai-multi`), but this requires users to manually type the provider ID via "Other", which is poor UX.
Copy file name to clipboardExpand all lines: docs/troubleshooting.md
+67Lines changed: 67 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -8,6 +8,73 @@ Common issues and debugging techniques for the OpenCode OpenAI Codex Auth Plugin
8
8
9
9
---
10
10
11
+
## Known Limitations
12
+
13
+
<detailsopen>
14
+
<summary><b>⚠️ OpenCode blocks this plugin by design</b></summary>
15
+
16
+
**Status:** This is a known issue affecting all users.
17
+
18
+
**What's happening:**
19
+
20
+
OpenCode's plugin loader explicitly skips plugins with `opencode-openai-codex-auth` in the name (see `packages/opencode/src/plugin/index.ts` line ~53):
21
+
22
+
```typescript
23
+
if (plugin.includes("opencode-openai-codex-auth") ||plugin.includes("opencode-copilot-auth")) continue
24
+
```
25
+
26
+
This is intentional — OpenCode has built-in `CodexAuthPlugin` and `CopilotAuthPlugin` that handle OAuth for these providers. External plugins are blocked to prevent conflicts.
27
+
28
+
**Impact:**
29
+
- The plugin downloads successfully
30
+
- The plugin is present in `~/.cache/opencode/node_modules/`
31
+
- But it never loads or executes
32
+
- No logs appear in `~/.opencode/logs/codex-plugin/`
33
+
34
+
**Workarounds:**
35
+
36
+
1.**Wait for upstream fix** — We've submitted a [PR proposal](OPENCODE_PR_PROPOSAL.md) to allow multiple auth plugins per provider
37
+
2.**Use a patched OpenCode fork** — For advanced users only (requires building from source)
38
+
3.**Use the built-in single-account auth** — Run `opencode auth login` without this plugin
0 commit comments