oc-codex-multi-auth 6.1.6 → 6.1.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +276 -121
- package/config/minimal-opencode.json +2 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +3 -2
- package/dist/index.js.map +1 -1
- package/dist/lib/auto-update-checker.d.ts +7 -1
- package/dist/lib/auto-update-checker.d.ts.map +1 -1
- package/dist/lib/auto-update-checker.js +51 -3
- package/dist/lib/auto-update-checker.js.map +1 -1
- package/dist/lib/config.d.ts +1 -0
- package/dist/lib/config.d.ts.map +1 -1
- package/dist/lib/config.js +4 -0
- package/dist/lib/config.js.map +1 -1
- package/dist/lib/request/request-transformer.d.ts.map +1 -1
- package/dist/lib/request/request-transformer.js +7 -2
- package/dist/lib/request/request-transformer.js.map +1 -1
- package/dist/lib/runtime.d.ts +1 -1
- package/dist/lib/runtime.js +1 -1
- package/dist/lib/schemas.d.ts +1 -0
- package/dist/lib/schemas.d.ts.map +1 -1
- package/dist/lib/schemas.js +1 -0
- package/dist/lib/schemas.js.map +1 -1
- package/dist/lib/tools/codex-export.js +2 -2
- package/dist/lib/tools/codex-export.js.map +1 -1
- package/dist/lib/tools/codex-help.js +3 -3
- package/dist/lib/tools/codex-help.js.map +1 -1
- package/dist/lib/tools/codex-remove.js +3 -3
- package/dist/lib/tools/codex-remove.js.map +1 -1
- package/dist/lib/tools/index.d.ts +8 -14
- package/dist/lib/tools/index.d.ts.map +1 -1
- package/dist/lib/tools/index.js +4 -6
- package/dist/lib/tools/index.js.map +1 -1
- package/package.json +2 -2
- package/scripts/clean-dist.js +27 -0
- package/scripts/install-oc-codex-multi-auth-core.js +19 -1
- package/scripts/install-oc-codex-multi-auth.js +15 -3
- package/dist/lib/tools/_shared.d.ts +0 -16
- package/dist/lib/tools/_shared.d.ts.map +0 -1
- package/dist/lib/tools/_shared.js +0 -21
- package/dist/lib/tools/_shared.js.map +0 -1
package/README.md
CHANGED
|
@@ -1,206 +1,361 @@
|
|
|
1
1
|
# oc-codex-multi-auth
|
|
2
2
|
|
|
3
|
-
<!--
|
|
4
|
-
Badges: CI + OpenSSF Scorecard will turn green once Phase 3 Batch A (CI workflow + Scorecard workflow) lands and runs its first job. Until then they may render as "no status" / 404 — that is expected and self-resolves automatically.
|
|
5
|
-
-->
|
|
6
3
|
[](https://www.npmjs.com/package/oc-codex-multi-auth)
|
|
7
4
|
[](https://www.npmjs.com/package/oc-codex-multi-auth)
|
|
8
|
-
|
|
9
|
-
|
|
5
|
+
|
|
6
|
+
OpenCode plugin for ChatGPT Plus/Pro OAuth, Codex-first GPT-5 workflows, and multi-account rotation.
|
|
10
7
|
|
|
11
8
|
<img width="1227" height="702" alt="cover" src="https://github.com/user-attachments/assets/b796eb2f-282e-468a-ba6a-acadf09d731b" />
|
|
12
9
|
|
|
13
|
-
Use your ChatGPT Plus/Pro subscription inside OpenCode with OAuth login, GPT-5/Codex model presets, and multi-account failover.
|
|
14
10
|
|
|
15
|
-
`oc-codex-multi-auth` is an OpenCode plugin for developers who want Codex-first GPT-5 workflows in OpenCode without switching to separate Platform API credentials for personal use. It uses the same official OAuth flow as the Codex CLI, adds model templates for current GPT-5 families, and can rotate across multiple ChatGPT accounts when one account is rate-limited or unavailable.
|
|
16
11
|
|
|
17
|
-
|
|
12
|
+
> [!NOTE]
|
|
13
|
+
> This package is the supported OpenCode plugin line.
|
|
14
|
+
> Older package names and config entries should be replaced with `oc-codex-multi-auth`.
|
|
18
15
|
|
|
19
|
-
|
|
20
|
-
- Ships ready-to-use GPT-5.5 OAuth model templates, variant picker presets, optional explicit selector IDs, `gpt-5-codex`, and related GPT-5 families
|
|
21
|
-
- Routes requests through a stateless Codex-compatible request pipeline with automatic token refresh
|
|
22
|
-
- Supports multi-account rotation, per-project account storage, and guided onboarding commands
|
|
16
|
+
## What You Get
|
|
23
17
|
|
|
24
|
-
|
|
18
|
+
- Official ChatGPT OAuth login through OpenCode's auth flow
|
|
19
|
+
- Ready-to-use GPT-5.5, GPT-5.5 Fast, GPT-5.4 Mini, GPT-5.4 Nano, GPT-5.1, and Codex model templates
|
|
20
|
+
- Compact modern OpenCode config with model variants, plus legacy explicit selector IDs when needed
|
|
21
|
+
- Stateless Codex-compatible request handling with `store: false` and `reasoning.encrypted_content`
|
|
22
|
+
- Multi-account rotation with health-aware selection, cooldowns, and automatic token refresh
|
|
23
|
+
- Per-project account storage under `~/.opencode/projects/<project-key>/...`
|
|
24
|
+
- Guided account setup, health, dashboard, export/import, keychain, and troubleshooting tools
|
|
25
|
+
- Optional OS-native keychain backend for stored account pools
|
|
26
|
+
- Request logging, metrics, and diagnostics for OpenCode integration debugging
|
|
27
|
+
- Stable docs set for install, config, troubleshooting, privacy, and development architecture
|
|
28
|
+
|
|
29
|
+
---
|
|
30
|
+
|
|
31
|
+
<details open>
|
|
32
|
+
<summary><b>Terms and Usage Notice</b></summary>
|
|
33
|
+
|
|
34
|
+
> [!CAUTION]
|
|
35
|
+
> This project is for personal development use with your own ChatGPT Plus/Pro subscription.
|
|
36
|
+
>
|
|
37
|
+
> By using this plugin, you acknowledge:
|
|
38
|
+
> - This is an independent open-source project, not an official OpenAI product
|
|
39
|
+
> - It is not intended for commercial resale, shared multi-user access, or production services
|
|
40
|
+
> - You are responsible for your own usage and policy compliance
|
|
41
|
+
> - For production/commercial workloads, use the OpenAI Platform API
|
|
42
|
+
|
|
43
|
+
</details>
|
|
44
|
+
|
|
45
|
+
---
|
|
46
|
+
|
|
47
|
+
## Installation
|
|
48
|
+
|
|
49
|
+
<details open>
|
|
50
|
+
<summary><b>For Humans</b></summary>
|
|
51
|
+
|
|
52
|
+
### Option A: Standard install
|
|
25
53
|
|
|
26
54
|
```bash
|
|
27
|
-
# 1. Install or refresh the plugin config
|
|
28
55
|
npx -y oc-codex-multi-auth@latest
|
|
56
|
+
```
|
|
57
|
+
|
|
58
|
+
### Option B: Full explicit model catalog
|
|
29
59
|
|
|
30
|
-
|
|
60
|
+
Use this when you want direct selector IDs such as `openai/gpt-5.5-medium` in addition to OpenCode variants.
|
|
61
|
+
|
|
62
|
+
```bash
|
|
63
|
+
npx -y oc-codex-multi-auth@latest --full
|
|
64
|
+
```
|
|
65
|
+
|
|
66
|
+
### Option C: Verify wiring
|
|
67
|
+
|
|
68
|
+
```bash
|
|
69
|
+
opencode --version
|
|
70
|
+
opencode debug config
|
|
31
71
|
opencode auth login
|
|
72
|
+
```
|
|
32
73
|
|
|
33
|
-
|
|
34
|
-
|
|
74
|
+
The installer updates `~/.config/opencode/opencode.json`, backs up the previous config, normalizes the plugin entry to `"oc-codex-multi-auth"`, and clears the OpenCode cached plugin copy so OpenCode reinstalls the latest package.
|
|
75
|
+
|
|
76
|
+
</details>
|
|
77
|
+
|
|
78
|
+
<details>
|
|
79
|
+
<summary><b>For LLM Agents</b></summary>
|
|
80
|
+
|
|
81
|
+
### Step-by-step
|
|
82
|
+
|
|
83
|
+
1. Install or refresh config:
|
|
84
|
+
- `npx -y oc-codex-multi-auth@latest`
|
|
85
|
+
2. Run first login flow:
|
|
86
|
+
- `opencode auth login`
|
|
87
|
+
3. Validate config:
|
|
88
|
+
- `opencode debug config`
|
|
89
|
+
4. Run a smoke request:
|
|
90
|
+
- `opencode run "Explain this repository" --model=openai/gpt-5.5 --variant=medium`
|
|
91
|
+
5. Inspect plugin state with the OpenCode tool surface:
|
|
92
|
+
- `codex-status`
|
|
93
|
+
- `codex-doctor`
|
|
94
|
+
- `codex-list`
|
|
95
|
+
|
|
96
|
+
### Verification
|
|
97
|
+
|
|
98
|
+
```bash
|
|
99
|
+
opencode debug config
|
|
100
|
+
opencode auth login
|
|
101
|
+
opencode run "ping" --model=openai/gpt-5.5 --variant=medium
|
|
35
102
|
```
|
|
36
103
|
|
|
37
|
-
|
|
104
|
+
</details>
|
|
105
|
+
|
|
106
|
+
---
|
|
38
107
|
|
|
39
|
-
|
|
40
|
-
- backs up an existing config before changing it
|
|
41
|
-
- normalizes the plugin entry to `"oc-codex-multi-auth"`
|
|
42
|
-
- clears the cached plugin copy so OpenCode reinstalls the latest package
|
|
108
|
+
## Quick Start
|
|
43
109
|
|
|
44
|
-
|
|
45
|
-
- model picker entries stay on actual OAuth model families such as `gpt-5.5` and `gpt-5.5-fast`
|
|
46
|
-
- reasoning presets are selected through OpenCode's model variant picker (`none`, `low`, `medium`, `high`, `xhigh`)
|
|
47
|
-
- rerunning the default installer removes explicit preset entries and stale base models from earlier plugin catalogs
|
|
110
|
+
Install and sign in:
|
|
48
111
|
|
|
49
|
-
|
|
112
|
+
```bash
|
|
113
|
+
npx -y oc-codex-multi-auth@latest
|
|
114
|
+
opencode auth login
|
|
115
|
+
```
|
|
50
116
|
|
|
51
|
-
|
|
117
|
+
Run a prompt with the compact modern selectors:
|
|
52
118
|
|
|
53
119
|
```bash
|
|
54
|
-
# General GPT-5 workflow
|
|
55
120
|
opencode run "Summarize the failing test and suggest a fix" --model=openai/gpt-5.5 --variant=medium
|
|
56
121
|
opencode run "Summarize the failing test and suggest a fix" --model=openai/gpt-5.5-fast --variant=medium
|
|
122
|
+
```
|
|
57
123
|
|
|
58
|
-
|
|
124
|
+
Use Codex-focused routing:
|
|
125
|
+
|
|
126
|
+
```bash
|
|
59
127
|
opencode run "Refactor the retry logic and update the tests" --model=openai/gpt-5-codex --variant=high
|
|
60
128
|
```
|
|
61
129
|
|
|
62
|
-
|
|
130
|
+
If browser launch is blocked, use the alternate login paths in [docs/getting-started.md](docs/getting-started.md#alternate-login-paths).
|
|
63
131
|
|
|
64
|
-
|
|
65
|
-
> This project is for personal development use with your own ChatGPT Plus/Pro subscription.
|
|
66
|
-
>
|
|
67
|
-
> - It is not intended for commercial resale, shared multi-user access, or production services.
|
|
68
|
-
> - It uses official OAuth authentication, but it is an independent open-source project and is not affiliated with OpenAI.
|
|
69
|
-
> - For production applications, use the [OpenAI Platform API](https://platform.openai.com/).
|
|
70
|
-
> - You are responsible for complying with [OpenAI's Terms of Use](https://openai.com/policies/terms-of-use/).
|
|
132
|
+
---
|
|
71
133
|
|
|
72
|
-
##
|
|
134
|
+
## Command Toolkit
|
|
73
135
|
|
|
74
|
-
|
|
136
|
+
### Start here
|
|
75
137
|
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
-
|
|
138
|
+
| Tool | What it answers |
|
|
139
|
+
| --- | --- |
|
|
140
|
+
| `codex-setup` | How do I finish first-run setup safely? |
|
|
141
|
+
| `codex-help` | Which plugin commands exist and what do they do? |
|
|
142
|
+
| `codex-doctor` | What is wrong with auth, config, storage, or routing? |
|
|
143
|
+
| `codex-next` | What should I do next to get unstuck? |
|
|
79
144
|
|
|
80
|
-
|
|
145
|
+
### Daily use
|
|
81
146
|
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
-
|
|
88
|
-
-
|
|
89
|
-
- Request logging and troubleshooting hooks for debugging OpenCode integration issues
|
|
147
|
+
| Tool | What it answers |
|
|
148
|
+
| --- | --- |
|
|
149
|
+
| `codex-list` | Which accounts are saved and which one is active? |
|
|
150
|
+
| `codex-switch` | How do I move to a different saved account? |
|
|
151
|
+
| `codex-status` | Which account, model family, and routing state are active? |
|
|
152
|
+
| `codex-limits` | What quota or rate-limit state is visible now? |
|
|
153
|
+
| `codex-dashboard` | Can I manage accounts from one interactive surface? |
|
|
90
154
|
|
|
91
|
-
|
|
155
|
+
### Account management
|
|
92
156
|
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
-
|
|
96
|
-
-
|
|
157
|
+
| Tool | What it answers |
|
|
158
|
+
| --- | --- |
|
|
159
|
+
| `codex-label` | How do I name an account? |
|
|
160
|
+
| `codex-tag` | How do I group accounts with tags? |
|
|
161
|
+
| `codex-note` | How do I attach a private note to an account? |
|
|
162
|
+
| `codex-remove` | How do I remove a saved account safely? |
|
|
163
|
+
| `codex-refresh` | How do I refresh or re-login an account? |
|
|
97
164
|
|
|
98
|
-
|
|
165
|
+
### Diagnostics and backup
|
|
99
166
|
|
|
100
|
-
|
|
167
|
+
| Tool | What it answers |
|
|
168
|
+
| --- | --- |
|
|
169
|
+
| `codex-health` | Which accounts look healthy, limited, or disabled? |
|
|
170
|
+
| `codex-metrics` | What runtime counters and request metrics are visible? |
|
|
171
|
+
| `codex-diag` | Can I export a diagnostic snapshot? |
|
|
172
|
+
| `codex-diff` | What changed between account/config snapshots? |
|
|
173
|
+
| `codex-export` | How do I back up account storage? |
|
|
174
|
+
| `codex-import` | How do I restore accounts with a dry-run first? |
|
|
175
|
+
| `codex-keychain` | Which credential backend is active and can I migrate it? |
|
|
101
176
|
|
|
102
|
-
|
|
103
|
-
2. The plugin authenticates with ChatGPT OAuth and refreshes tokens when needed.
|
|
104
|
-
3. Requests are normalized for the Codex backend and sent with `store: false`.
|
|
105
|
-
4. The plugin chooses the best account/workspace candidate, retries intelligently, and preserves conversation continuity through encrypted reasoning state.
|
|
177
|
+
### Reliability behavior
|
|
106
178
|
|
|
107
|
-
|
|
179
|
+
- stateless request handling forces `store: false`
|
|
180
|
+
- `reasoning.encrypted_content` is preserved for multi-turn continuity
|
|
181
|
+
- account rotation is health-aware and avoids repeatedly selecting cooling accounts
|
|
182
|
+
- 5xx bursts, network failures, and quota responses penalize account health
|
|
183
|
+
- token refresh is queued to avoid refresh races
|
|
184
|
+
- unsupported-model fallback is strict by default, with opt-in fallback controls
|
|
108
185
|
|
|
109
|
-
|
|
186
|
+
---
|
|
110
187
|
|
|
111
|
-
|
|
188
|
+
## Storage Paths
|
|
112
189
|
|
|
113
|
-
|
|
190
|
+
| File | Default path |
|
|
191
|
+
| --- | --- |
|
|
192
|
+
| OpenCode config | `~/.config/opencode/opencode.json` |
|
|
193
|
+
| OpenCode auth tokens | `~/.opencode/auth/openai.json` |
|
|
194
|
+
| Plugin config | `~/.opencode/openai-codex-auth-config.json` |
|
|
195
|
+
| Global account storage | `~/.opencode/oc-codex-multi-auth-accounts.json` |
|
|
196
|
+
| Per-project accounts | `~/.opencode/projects/<project-key>/oc-codex-multi-auth-accounts.json` |
|
|
197
|
+
| Flagged accounts | `~/.opencode/oc-codex-multi-auth-flagged-accounts.json` |
|
|
198
|
+
| Backups | `~/.opencode/backups/` or `~/.opencode/projects/<project-key>/backups/` |
|
|
199
|
+
| Logs | `~/.opencode/logs/codex-plugin/` |
|
|
114
200
|
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
201
|
+
Per-project storage is enabled by default. The plugin walks up from the current directory to find a project root, then stores account pools under the project-specific key. If no project root is found, it falls back to global storage.
|
|
202
|
+
|
|
203
|
+
---
|
|
118
204
|
|
|
119
205
|
## Configuration
|
|
120
206
|
|
|
121
|
-
|
|
207
|
+
Primary config files:
|
|
208
|
+
- `~/.config/opencode/opencode.json`
|
|
209
|
+
- `~/.opencode/openai-codex-auth-config.json`
|
|
210
|
+
|
|
211
|
+
Selected runtime/environment overrides:
|
|
212
|
+
|
|
213
|
+
| Variable | Effect |
|
|
214
|
+
| --- | --- |
|
|
215
|
+
| `CODEX_AUTH_REQUEST_TRANSFORM_MODE=legacy` | Re-enable legacy Codex request rewriting |
|
|
216
|
+
| `CODEX_MODE=0/1` | Disable/enable bridge prompt behavior |
|
|
217
|
+
| `CODEX_TUI_V2=0/1` | Disable/enable codex-style tool output |
|
|
218
|
+
| `CODEX_TUI_COLOR_PROFILE=truecolor|ansi256|ansi16` | Force terminal color profile |
|
|
219
|
+
| `CODEX_TUI_GLYPHS=ascii|unicode|auto` | Force terminal glyph style |
|
|
220
|
+
| `CODEX_AUTH_PER_PROJECT_ACCOUNTS=0/1` | Disable/enable per-project account pools |
|
|
221
|
+
| `CODEX_AUTH_AUTO_UPDATE=0/1` | Disable/enable daily npm update check and cache refresh |
|
|
222
|
+
| `CODEX_AUTH_UNSUPPORTED_MODEL_POLICY=strict|fallback` | Control unsupported-model retry behavior |
|
|
223
|
+
| `CODEX_AUTH_ACCOUNT_ID=<id>` | Force a specific workspace/account id |
|
|
224
|
+
| `CODEX_AUTH_FETCH_TIMEOUT_MS=<ms>` | Request timeout override |
|
|
225
|
+
| `CODEX_AUTH_STREAM_STALL_TIMEOUT_MS=<ms>` | SSE stream stall timeout override |
|
|
226
|
+
| `ENABLE_PLUGIN_REQUEST_LOGGING=1` | Enable request metadata logs |
|
|
227
|
+
| `CODEX_PLUGIN_LOG_BODIES=1` | Include raw request/response bodies in logs; sensitive |
|
|
228
|
+
| `CODEX_KEYCHAIN=1` | Opt in to OS-native keychain account storage |
|
|
229
|
+
|
|
230
|
+
Validate config after changes:
|
|
231
|
+
|
|
232
|
+
```bash
|
|
233
|
+
opencode debug config
|
|
234
|
+
opencode run "test" --model=openai/gpt-5.5 --variant=medium
|
|
235
|
+
```
|
|
236
|
+
|
|
237
|
+
Modern OpenCode versions use [config/opencode-modern.json](config/opencode-modern.json). Older versions can use [config/opencode-legacy.json](config/opencode-legacy.json). See [config/README.md](config/README.md) for the full model template matrix.
|
|
122
238
|
|
|
123
|
-
|
|
124
|
-
- [Configuration Reference](docs/configuration.md) for config keys, env vars, and fallback behavior
|
|
125
|
-
- [Config Templates](config/README.md) for modern vs legacy OpenCode examples
|
|
239
|
+
---
|
|
126
240
|
|
|
127
241
|
## Credential Storage
|
|
128
242
|
|
|
129
|
-
|
|
243
|
+
<details open>
|
|
244
|
+
<summary><b>Default JSON backend</b></summary>
|
|
130
245
|
|
|
131
|
-
|
|
246
|
+
By default, account pools are stored locally as V3 JSON files. File permissions are restricted where the platform supports them.
|
|
132
247
|
|
|
133
|
-
|
|
248
|
+
Use JSON storage when you want predictable, inspectable local files and easy backup/export behavior.
|
|
134
249
|
|
|
135
|
-
|
|
136
|
-
- **Windows**: Credential Manager
|
|
137
|
-
- **Linux**: libsecret (requires a running secret service such as GNOME Keyring or KWallet)
|
|
250
|
+
</details>
|
|
138
251
|
|
|
139
|
-
|
|
252
|
+
<details>
|
|
253
|
+
<summary><b>Optional OS keychain backend</b></summary>
|
|
140
254
|
|
|
141
|
-
|
|
255
|
+
Set `CODEX_KEYCHAIN=1` to store account pools in the OS keychain instead:
|
|
142
256
|
|
|
143
|
-
|
|
257
|
+
- macOS: Keychain
|
|
258
|
+
- Windows: Credential Manager
|
|
259
|
+
- Linux: libsecret, with a running secret service such as GNOME Keyring or KWallet
|
|
144
260
|
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
codex-keychain
|
|
261
|
+
Manage the backend from OpenCode:
|
|
262
|
+
|
|
263
|
+
```text
|
|
264
|
+
codex-keychain status
|
|
265
|
+
codex-keychain migrate
|
|
266
|
+
codex-keychain rollback
|
|
149
267
|
```
|
|
150
268
|
|
|
151
|
-
|
|
269
|
+
If the keychain is unavailable, the plugin logs a warning and falls back to JSON storage for that operation. Credentials are never silently deleted.
|
|
152
270
|
|
|
153
|
-
|
|
271
|
+
</details>
|
|
154
272
|
|
|
155
|
-
|
|
273
|
+
---
|
|
156
274
|
|
|
157
275
|
## Troubleshooting
|
|
158
276
|
|
|
159
|
-
|
|
277
|
+
<details open>
|
|
278
|
+
<summary><b>60-second recovery</b></summary>
|
|
160
279
|
|
|
161
|
-
|
|
162
|
-
-
|
|
163
|
-
-
|
|
164
|
-
-
|
|
280
|
+
```text
|
|
281
|
+
codex-doctor --fix
|
|
282
|
+
codex-next
|
|
283
|
+
codex-status format="json"
|
|
284
|
+
```
|
|
165
285
|
|
|
166
|
-
|
|
286
|
+
If still broken:
|
|
167
287
|
|
|
168
|
-
|
|
288
|
+
```bash
|
|
289
|
+
opencode auth login
|
|
290
|
+
```
|
|
169
291
|
|
|
170
|
-
|
|
292
|
+
</details>
|
|
293
|
+
|
|
294
|
+
<details>
|
|
295
|
+
<summary><b>Common symptoms</b></summary>
|
|
296
|
+
|
|
297
|
+
- Plugin does not load: rerun `npx -y oc-codex-multi-auth@latest`, then restart OpenCode
|
|
298
|
+
- Config looks wrong: run `opencode debug config` and confirm `"plugin": ["oc-codex-multi-auth"]`
|
|
299
|
+
- OAuth callback fails: free port `1455`, then rerun `opencode auth login`
|
|
300
|
+
- Browser launch is blocked: use the device-code/manual login path from [docs/getting-started.md](docs/getting-started.md#alternate-login-paths)
|
|
301
|
+
- Wrong account is selected: run `codex-list`, then `codex-switch`
|
|
302
|
+
- Account pool looks unhealthy: run `codex-health format="json"` and `codex-doctor deep=true format="json"`
|
|
303
|
+
- Import/export feels risky: run `codex-import path="..." dryRun=true` before applying
|
|
304
|
+
- Debugging model fallback: enable `ENABLE_PLUGIN_REQUEST_LOGGING=1` and inspect `~/.opencode/logs/codex-plugin/`
|
|
305
|
+
|
|
306
|
+
</details>
|
|
307
|
+
|
|
308
|
+
<details>
|
|
309
|
+
<summary><b>Diagnostics pack</b></summary>
|
|
310
|
+
|
|
311
|
+
```text
|
|
312
|
+
codex-status format="json"
|
|
313
|
+
codex-limits format="json"
|
|
314
|
+
codex-health format="json"
|
|
315
|
+
codex-next format="json"
|
|
316
|
+
codex-list format="json"
|
|
317
|
+
codex-dashboard format="json"
|
|
318
|
+
codex-metrics format="json"
|
|
319
|
+
codex-doctor deep=true format="json"
|
|
320
|
+
```
|
|
171
321
|
|
|
172
|
-
|
|
322
|
+
</details>
|
|
173
323
|
|
|
174
|
-
|
|
175
|
-
- Publish `oc-codex-multi-auth@6.0.0`
|
|
176
|
-
- Deprecate the legacy npm package with a pointer to the new package
|
|
177
|
-
- Verify docs, badges, repo links, and OpenCode config examples all resolve to `oc-codex-multi-auth`
|
|
178
|
-
- rerun `opencode auth login`
|
|
179
|
-
- inspect `~/.opencode/logs/codex-plugin/` after running one request with `ENABLE_PLUGIN_REQUEST_LOGGING=1`
|
|
324
|
+
---
|
|
180
325
|
|
|
181
|
-
##
|
|
326
|
+
## Documentation
|
|
182
327
|
|
|
183
|
-
|
|
328
|
+
- Docs portal: [docs/README.md](docs/README.md)
|
|
329
|
+
- Documentation map: [docs/DOCUMENTATION.md](docs/DOCUMENTATION.md)
|
|
330
|
+
- Getting started: [docs/getting-started.md](docs/getting-started.md)
|
|
331
|
+
- Configuration: [docs/configuration.md](docs/configuration.md)
|
|
332
|
+
- Config templates: [config/README.md](config/README.md)
|
|
333
|
+
- Troubleshooting: [docs/troubleshooting.md](docs/troubleshooting.md)
|
|
334
|
+
- FAQ: [docs/faq.md](docs/faq.md)
|
|
335
|
+
- Privacy: [docs/privacy.md](docs/privacy.md)
|
|
336
|
+
- Architecture: [docs/development/ARCHITECTURE.md](docs/development/ARCHITECTURE.md)
|
|
337
|
+
- Testing: [docs/development/TESTING.md](docs/development/TESTING.md)
|
|
338
|
+
- Audit index: [docs/audits/INDEX.md](docs/audits/INDEX.md)
|
|
184
339
|
|
|
185
|
-
|
|
186
|
-
- which OpenCode versions it supports
|
|
187
|
-
- how the modern and legacy config templates differ
|
|
188
|
-
- when to use this plugin versus the OpenAI Platform API
|
|
340
|
+
---
|
|
189
341
|
|
|
190
|
-
##
|
|
342
|
+
## Release Notes
|
|
191
343
|
|
|
192
|
-
|
|
344
|
+
- Current package version: `6.1.7`
|
|
345
|
+
- Changelog: [CHANGELOG.md](CHANGELOG.md)
|
|
346
|
+
- Releases are automated with [release-please](https://github.com/googleapis/release-please)
|
|
193
347
|
|
|
194
|
-
-
|
|
195
|
-
- [Code of Conduct](CODE_OF_CONDUCT.md)
|
|
196
|
-
- [Security Policy](SECURITY.md)
|
|
348
|
+
Merging the release-please PR cuts the tagged release and publishes the package through the configured release workflow. Manual `npm publish` is not required for routine releases.
|
|
197
349
|
|
|
198
|
-
##
|
|
350
|
+
## License
|
|
199
351
|
|
|
200
|
-
|
|
352
|
+
MIT License. See [LICENSE](LICENSE).
|
|
201
353
|
|
|
202
|
-
|
|
354
|
+
<details>
|
|
355
|
+
<summary><b>Legal</b></summary>
|
|
203
356
|
|
|
204
|
-
|
|
357
|
+
- Not affiliated with OpenAI.
|
|
358
|
+
- "ChatGPT", "GPT-5", "Codex", and "OpenAI" are trademarks of OpenAI.
|
|
359
|
+
- You assume responsibility for your own usage and compliance.
|
|
205
360
|
|
|
206
|
-
|
|
361
|
+
</details>
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AAKH,OAAO,KAAK,EAAE,MAAM,EAAe,MAAM,qBAAqB,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AAKH,OAAO,KAAK,EAAE,MAAM,EAAe,MAAM,qBAAqB,CAAC;AAkM/D;;;;;;;;;;;;;;;GAeG;AAEH,eAAO,MAAM,iBAAiB,EAAE,MA03G/B,CAAC;AAEF,eAAO,MAAM,gBAAgB,QAAoB,CAAC;AAElD,eAAe,iBAAiB,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -32,7 +32,7 @@ import { queuedRefresh } from "./lib/refresh-queue.js";
|
|
|
32
32
|
import { openBrowserUrl } from "./lib/auth/browser.js";
|
|
33
33
|
import { startLocalOAuthServer } from "./lib/auth/server.js";
|
|
34
34
|
import { promptAddAnotherAccount, promptLoginMode } from "./lib/cli.js";
|
|
35
|
-
import { getCodexMode, getRequestTransformMode, getFastSession, getFastSessionStrategy, getFastSessionMaxInputItems, getRetryProfile, getRetryBudgetOverrides, getRateLimitToastDebounceMs, getRetryAllAccountsMaxRetries, getRetryAllAccountsMaxWaitMs, getRetryAllAccountsRateLimited, getFallbackToGpt52OnUnsupportedGpt53, getUnsupportedCodexPolicy, getUnsupportedCodexFallbackChain, getTokenRefreshSkewMs, getSessionRecovery, getAutoResume, getToastDurationMs, getPerProjectAccounts, getEmptyResponseMaxRetries, getEmptyResponseRetryDelayMs, getPidOffsetEnabled, getFetchTimeoutMs, getStreamStallTimeoutMs, getCodexTuiV2, getCodexTuiColorProfile, getCodexTuiGlyphMode, getBeginnerSafeMode, loadPluginConfig, } from "./lib/config.js";
|
|
35
|
+
import { getCodexMode, getRequestTransformMode, getFastSession, getFastSessionStrategy, getFastSessionMaxInputItems, getRetryProfile, getRetryBudgetOverrides, getRateLimitToastDebounceMs, getRetryAllAccountsMaxRetries, getRetryAllAccountsMaxWaitMs, getRetryAllAccountsRateLimited, getFallbackToGpt52OnUnsupportedGpt53, getUnsupportedCodexPolicy, getUnsupportedCodexFallbackChain, getTokenRefreshSkewMs, getSessionRecovery, getAutoResume, getAutoUpdate, getToastDurationMs, getPerProjectAccounts, getEmptyResponseMaxRetries, getEmptyResponseRetryDelayMs, getPidOffsetEnabled, getFetchTimeoutMs, getStreamStallTimeoutMs, getCodexTuiV2, getCodexTuiColorProfile, getCodexTuiGlyphMode, getBeginnerSafeMode, loadPluginConfig, } from "./lib/config.js";
|
|
36
36
|
import { AUTH_LABELS, CODEX_BASE_URL, DUMMY_API_KEY, LOG_STAGES, PLUGIN_NAME, PROVIDER_ID, ACCOUNT_LIMITS, } from "./lib/constants.js";
|
|
37
37
|
import { initLogger, logRequest, logDebug, logInfo, logWarn, logError, setCorrelationId, clearCorrelationId, } from "./lib/logger.js";
|
|
38
38
|
import { checkAndNotify } from "./lib/auto-update-checker.js";
|
|
@@ -1054,6 +1054,7 @@ export const OpenAIOAuthPlugin = async ({ client }) => {
|
|
|
1054
1054
|
const streamStallTimeoutMs = getStreamStallTimeoutMs(pluginConfig);
|
|
1055
1055
|
const sessionRecoveryEnabled = getSessionRecovery(pluginConfig);
|
|
1056
1056
|
const autoResumeEnabled = getAutoResume(pluginConfig);
|
|
1057
|
+
const autoUpdateEnabled = getAutoUpdate(pluginConfig);
|
|
1057
1058
|
const emptyResponseMaxRetries = getEmptyResponseMaxRetries(pluginConfig);
|
|
1058
1059
|
const emptyResponseRetryDelayMs = getEmptyResponseRetryDelayMs(pluginConfig);
|
|
1059
1060
|
const pidOffsetEnabled = getPidOffsetEnabled(pluginConfig);
|
|
@@ -1092,7 +1093,7 @@ export const OpenAIOAuthPlugin = async ({ client }) => {
|
|
|
1092
1093
|
: null;
|
|
1093
1094
|
checkAndNotify(async (message, variant) => {
|
|
1094
1095
|
await showToast(message, variant);
|
|
1095
|
-
}).catch((err) => {
|
|
1096
|
+
}, { autoUpdate: autoUpdateEnabled }).catch((err) => {
|
|
1096
1097
|
logDebug(`Update check failed: ${err instanceof Error ? err.message : String(err)}`);
|
|
1097
1098
|
});
|
|
1098
1099
|
await runStartupPreflight();
|