oc-codex-multi-auth 6.9.1 → 6.10.1
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 +45 -14
- package/config/README.md +71 -22
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +35 -7
- package/dist/index.js.map +1 -1
- package/dist/lib/auth/server.d.ts.map +1 -1
- package/dist/lib/auth/server.js +7 -3
- package/dist/lib/auth/server.js.map +1 -1
- package/dist/lib/config.d.ts +6 -0
- package/dist/lib/config.d.ts.map +1 -1
- package/dist/lib/config.js +9 -0
- package/dist/lib/config.js.map +1 -1
- package/dist/lib/oauth-success.d.ts +1 -0
- package/dist/lib/oauth-success.d.ts.map +1 -1
- package/dist/lib/oauth-success.html +198 -707
- package/dist/lib/oauth-success.js +202 -708
- package/dist/lib/oauth-success.js.map +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-doctor.d.ts.map +1 -1
- package/dist/lib/tools/codex-doctor.js +168 -142
- package/dist/lib/tools/codex-doctor.js.map +1 -1
- package/dist/lib/tools/codex-health.d.ts.map +1 -1
- package/dist/lib/tools/codex-health.js +41 -38
- package/dist/lib/tools/codex-health.js.map +1 -1
- package/dist/lib/tools/codex-refresh.d.ts.map +1 -1
- package/dist/lib/tools/codex-refresh.js +24 -103
- package/dist/lib/tools/codex-refresh.js.map +1 -1
- package/dist/lib/tools/index.d.ts +1 -0
- package/dist/lib/tools/index.d.ts.map +1 -1
- package/dist/lib/tools/index.js.map +1 -1
- package/dist/lib/tools/refresh-account.d.ts +63 -0
- package/dist/lib/tools/refresh-account.d.ts.map +1 -0
- package/dist/lib/tools/refresh-account.js +159 -0
- package/dist/lib/tools/refresh-account.js.map +1 -0
- package/dist/lib/ui/beginner.d.ts +1 -0
- package/dist/lib/ui/beginner.d.ts.map +1 -1
- package/dist/lib/ui/beginner.js +12 -1
- package/dist/lib/ui/beginner.js.map +1 -1
- package/package.json +155 -155
- package/scripts/install-oc-codex-multi-auth-core.js +6 -6
package/README.md
CHANGED
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
[](https://github.com/ndycode/oc-codex-multi-auth/actions/workflows/ci.yml)
|
|
6
6
|
[](LICENSE)
|
|
7
7
|
|
|
8
|
-
`oc-codex-multi-auth` is an OpenCode plugin for ChatGPT Plus/Pro OAuth, Codex and GPT-5 model routing, multi-account rotation, account switching, health checks, quota visibility, diagnostics, and recovery tools. It installs the OpenCode provider/TUI configuration, registers a `codex-*` command toolkit, and routes OpenCode OpenAI SDK requests through the ChatGPT-backed Codex flow with local account state.
|
|
8
|
+
`oc-codex-multi-auth` is an OpenCode plugin for ChatGPT Plus/Pro OAuth, Codex and GPT-5 model routing (including GPT-5.6 Sol/Terra/Luna), multi-account rotation, account switching, health checks, quota visibility, diagnostics, and recovery tools. It installs the OpenCode provider/TUI configuration, registers a 24-tool `codex-*` command toolkit, and routes OpenCode OpenAI SDK requests through the ChatGPT-backed Codex flow with local account state.
|
|
9
9
|
|
|
10
10
|
Use it when you want OpenCode to run Codex-style coding workflows from your own ChatGPT subscription while keeping accounts visible, switchable, health-checked, and recoverable from the terminal.
|
|
11
11
|
|
|
@@ -20,10 +20,10 @@ Use it when you want OpenCode to run Codex-style coding workflows from your own
|
|
|
20
20
|
## What You Get
|
|
21
21
|
|
|
22
22
|
- OpenCode plugin support for ChatGPT Plus/Pro OAuth and Codex/GPT-5 coding workflows
|
|
23
|
-
-
|
|
24
|
-
- Compact modern OpenCode config with variant
|
|
23
|
+
- GPT-5.6 Sol, Terra, and Luna (responses-lite path) plus GPT-5.5, GPT-5.5 Fast, GPT-5.4 Mini, GPT-5.4 Nano, GPT-5.1, and Codex model templates
|
|
24
|
+
- Compact modern OpenCode config with 12 base families and 53 variant presets; explicit legacy selector IDs when needed
|
|
25
25
|
- Stateless Codex-compatible request handling with `store: false` and `reasoning.encrypted_content`
|
|
26
|
-
- Multi-account rotation with health
|
|
26
|
+
- Multi-account rotation with hybrid health scoring, cooldowns, automatic token refresh, and failover
|
|
27
27
|
- Explicit saved-account listing, account switching, labeling, tagging, notes, health checks, and diagnostics
|
|
28
28
|
- Per-project account storage under `~/.opencode/projects/<project-key>/...`
|
|
29
29
|
- Guided setup, doctor, next-action, dashboard, export/import, keychain, and troubleshooting tools
|
|
@@ -46,10 +46,10 @@ Use it when you want OpenCode to run Codex-style coding workflows from your own
|
|
|
46
46
|
|
|
47
47
|
| Surface | Purpose |
|
|
48
48
|
| --- | --- |
|
|
49
|
-
| `oc-codex-multi-auth` | npm installer bin; updates `~/.config/opencode/opencode.json`, manages `tui.json`, normalizes stale plugin entries, and clears OpenCode plugin cache |
|
|
49
|
+
| `oc-codex-multi-auth` | npm installer bin; updates `~/.config/opencode/opencode.json`, manages `tui.json`, normalizes stale plugin entries, and clears OpenCode plugin cache. Also runs standalone commands: `doctor`, `status`, `list`, `limits`, `dashboard`, `health`, `diag`, `warm` |
|
|
50
50
|
| OpenCode plugin entry (`index.ts`) | auth loader, OAuth login modes, provider fetch pipeline, account rotation, retry/failover, and `codex-*` tool registry |
|
|
51
51
|
| OpenCode TUI plugin (`tui.ts`) | prompt quota status, quota details, shared quota cache, and active-account-aware display |
|
|
52
|
-
|
|
|
52
|
+
| 24 `codex-*` tools | setup, help, status, list, switch, warm, limits, health, metrics, doctor, dashboard, pool, backup, keychain, diagnostics, and recovery actions |
|
|
53
53
|
|
|
54
54
|
The plugin does not replace OpenCode. OpenCode remains the host; this package installs provider/TUI config and supplies the OAuth-backed Codex request pipeline that OpenCode calls.
|
|
55
55
|
|
|
@@ -76,12 +76,24 @@ The plugin does not replace OpenCode. OpenCode remains the host; this package in
|
|
|
76
76
|
<details open>
|
|
77
77
|
<summary><b>For Humans</b></summary>
|
|
78
78
|
|
|
79
|
-
### Option A: Standard install
|
|
79
|
+
### Option A: Standard install (compact modern)
|
|
80
|
+
|
|
81
|
+
Default mode writes 12 base OAuth model families and leaves reasoning depth to OpenCode's variant picker.
|
|
80
82
|
|
|
81
83
|
```bash
|
|
82
84
|
npx -y oc-codex-multi-auth@latest
|
|
83
85
|
```
|
|
84
86
|
|
|
87
|
+
Installer flags:
|
|
88
|
+
|
|
89
|
+
| Flag | Effect |
|
|
90
|
+
| --- | --- |
|
|
91
|
+
| (default) / `--modern` | Compact modern catalog: 12 bases, 53 variants |
|
|
92
|
+
| `--full` | Compact bases plus 53 explicit selector IDs |
|
|
93
|
+
| `--legacy` | Explicit-only catalog for older OpenCode |
|
|
94
|
+
| `--dry-run` | Show actions without writing |
|
|
95
|
+
| `--no-cache-clear` | Skip clearing the OpenCode plugin cache |
|
|
96
|
+
|
|
85
97
|
### Option B: Full explicit model catalog
|
|
86
98
|
|
|
87
99
|
Use this when you want direct selector IDs such as `openai/gpt-5.5-medium` in addition to OpenCode variants.
|
|
@@ -100,6 +112,20 @@ opencode auth login
|
|
|
100
112
|
|
|
101
113
|
The installer updates `~/.config/opencode/opencode.json`, backs up the previous config, normalizes the plugin entry to `"oc-codex-multi-auth"`, enables the TUI status plugin in `~/.config/opencode/tui.json`, and clears the OpenCode cached plugin copy so OpenCode reinstalls the latest package.
|
|
102
114
|
|
|
115
|
+
### Standalone CLI (no agent / no token cost)
|
|
116
|
+
|
|
117
|
+
```bash
|
|
118
|
+
oc-codex-multi-auth status
|
|
119
|
+
oc-codex-multi-auth list
|
|
120
|
+
oc-codex-multi-auth warm
|
|
121
|
+
oc-codex-multi-auth doctor
|
|
122
|
+
oc-codex-multi-auth health
|
|
123
|
+
oc-codex-multi-auth limits
|
|
124
|
+
oc-codex-multi-auth dashboard
|
|
125
|
+
oc-codex-multi-auth diag
|
|
126
|
+
# or: npx -y oc-codex-multi-auth@latest warm --json
|
|
127
|
+
```
|
|
128
|
+
|
|
103
129
|
</details>
|
|
104
130
|
|
|
105
131
|
<details>
|
|
@@ -113,7 +139,7 @@ The installer updates `~/.config/opencode/opencode.json`, backs up the previous
|
|
|
113
139
|
- `opencode auth login`
|
|
114
140
|
3. Validate config:
|
|
115
141
|
- `opencode debug config`
|
|
116
|
-
4. Run a smoke request:
|
|
142
|
+
4. Run a smoke request (compact modern selectors):
|
|
117
143
|
- `opencode run "Explain this repository" --model=openai/gpt-5.5 --variant=medium`
|
|
118
144
|
5. Inspect plugin state with the OpenCode tool surface:
|
|
119
145
|
- `codex-status`
|
|
@@ -146,6 +172,7 @@ Run a prompt with compact modern selectors:
|
|
|
146
172
|
```bash
|
|
147
173
|
opencode run "Summarize the failing test and suggest a fix" --model=openai/gpt-5.5 --variant=medium
|
|
148
174
|
opencode run "Summarize the failing test and suggest a fix" --model=openai/gpt-5.5-fast --variant=medium
|
|
175
|
+
opencode run "Plan the refactor" --model=openai/gpt-5.6-sol --variant=high
|
|
149
176
|
```
|
|
150
177
|
|
|
151
178
|
Use Codex-focused routing:
|
|
@@ -210,7 +237,8 @@ Most of these also run as a **direct CLI** with no agent/model involvement (no t
|
|
|
210
237
|
|
|
211
238
|
- stateless request handling forces `store: false`
|
|
212
239
|
- `reasoning.encrypted_content` is preserved for multi-turn continuity
|
|
213
|
-
-
|
|
240
|
+
- GPT-5.6 tiers use the responses-lite request shape and default client identity `opencode`; other models default to `codex_cli_rs`
|
|
241
|
+
- account rotation is health-aware (`rotationStrategy` default `hybrid`) and avoids repeatedly selecting cooling accounts
|
|
214
242
|
- 5xx bursts, network failures, and quota responses penalize account health
|
|
215
243
|
- token refresh is queued to avoid refresh races
|
|
216
244
|
- unsupported-model handling is strict by default, with opt-in fallback controls
|
|
@@ -304,13 +332,14 @@ Selected runtime/environment overrides:
|
|
|
304
332
|
| `CODEX_AUTH_REQUEST_TRANSFORM_MODE=legacy` | Re-enable legacy Codex request rewriting |
|
|
305
333
|
| `CODEX_MODE=0/1` | Disable/enable bridge prompt behavior |
|
|
306
334
|
| `CODEX_TUI_V2=0/1` | Disable/enable codex-style tool output |
|
|
307
|
-
| `CODEX_TUI_COLOR_PROFILE=truecolor
|
|
308
|
-
| `CODEX_TUI_GLYPHS=ascii
|
|
309
|
-
| `CODEX_TUI_MASK_EMAIL=0/1` |
|
|
335
|
+
| `CODEX_TUI_COLOR_PROFILE=truecolor\|ansi256\|ansi16` | Force terminal color profile |
|
|
336
|
+
| `CODEX_TUI_GLYPHS=ascii\|unicode\|auto` | Force terminal glyph style |
|
|
337
|
+
| `CODEX_TUI_MASK_EMAIL=0/1` | Mask account emails across account-display surfaces (list/status/limits/health/dashboard/menus + TUI quota status) |
|
|
310
338
|
| `CODEX_TUI_MASK_EMAIL_DETAILS=0/1` | Also hide account email in quota details when prompt masking is enabled |
|
|
311
339
|
| `CODEX_AUTH_PER_PROJECT_ACCOUNTS=0/1` | Disable/enable per-project account pools |
|
|
312
340
|
| `CODEX_AUTH_AUTO_UPDATE=0/1` | Disable/enable daily npm update check and cache refresh |
|
|
313
|
-
| `
|
|
341
|
+
| `CODEX_AUTH_ROTATION_STRATEGY=hybrid\|sticky\|round-robin` | Account selection strategy |
|
|
342
|
+
| `CODEX_AUTH_UNSUPPORTED_MODEL_POLICY=strict\|fallback` | Control unsupported-model retry behavior |
|
|
314
343
|
| `CODEX_AUTH_ACCOUNT_ID=<id>` | Force a specific workspace/account id |
|
|
315
344
|
| `CODEX_AUTH_FETCH_TIMEOUT_MS=<ms>` | Request timeout override |
|
|
316
345
|
| `CODEX_AUTH_STREAM_STALL_TIMEOUT_MS=<ms>` | SSE stream stall timeout override |
|
|
@@ -318,6 +347,8 @@ Selected runtime/environment overrides:
|
|
|
318
347
|
| `CODEX_PLUGIN_LOG_BODIES=1` | Include raw request/response bodies in logs; sensitive |
|
|
319
348
|
| `CODEX_KEYCHAIN=1` | Opt in to OS-native keychain account storage |
|
|
320
349
|
|
|
350
|
+
Boolean env overrides are truthy only for the literal string `"1"`.
|
|
351
|
+
|
|
321
352
|
Validate config after changes:
|
|
322
353
|
|
|
323
354
|
```bash
|
|
@@ -434,7 +465,7 @@ codex-doctor deep=true format="json"
|
|
|
434
465
|
|
|
435
466
|
## Release Notes
|
|
436
467
|
|
|
437
|
-
- Current package version: `6.1
|
|
468
|
+
- Current package version: `6.9.1`
|
|
438
469
|
- Changelog: [CHANGELOG.md](CHANGELOG.md)
|
|
439
470
|
- Releases are automated with [release-please](https://github.com/googleapis/release-please)
|
|
440
471
|
|
package/config/README.md
CHANGED
|
@@ -1,15 +1,29 @@
|
|
|
1
1
|
# Configuration
|
|
2
2
|
|
|
3
|
-
This directory contains the official OpenCode config templates for `oc-codex-multi-auth
|
|
3
|
+
This directory contains the official OpenCode config templates for `oc-codex-multi-auth` v6.9.1.
|
|
4
4
|
|
|
5
5
|
## Required: choose the right config file
|
|
6
6
|
|
|
7
7
|
| File | OpenCode version | Description |
|
|
8
8
|
|------|------------------|-------------|
|
|
9
|
-
| [`opencode-modern.json`](./opencode-modern.json) | **v1.0.210+** | Variant-based config:
|
|
10
|
-
| [`opencode-legacy.json`](./opencode-legacy.json) | **v1.0.209 and below** | Legacy explicit entries:
|
|
9
|
+
| [`opencode-modern.json`](./opencode-modern.json) | **v1.0.210+** | Variant-based config: **12 base models**, **53 variants** total |
|
|
10
|
+
| [`opencode-legacy.json`](./opencode-legacy.json) | **v1.0.209 and below** | Legacy explicit entries: **53** individual model definitions |
|
|
11
11
|
|
|
12
|
-
|
|
12
|
+
## Install modes
|
|
13
|
+
|
|
14
|
+
| Installer flag | What gets written |
|
|
15
|
+
|----------------|-------------------|
|
|
16
|
+
| default / `--modern` | Compact modern: 12 base OAuth families + variant picker |
|
|
17
|
+
| `--full` | Modern bases **plus** explicit legacy selector IDs |
|
|
18
|
+
| `--legacy` | Explicit-only catalog (53 preset model entries) |
|
|
19
|
+
|
|
20
|
+
```bash
|
|
21
|
+
npx -y oc-codex-multi-auth@latest # compact modern (default)
|
|
22
|
+
npx -y oc-codex-multi-auth@latest --full # modern + explicit IDs
|
|
23
|
+
npx -y oc-codex-multi-auth@latest --legacy # explicit only
|
|
24
|
+
```
|
|
25
|
+
|
|
26
|
+
Rerun the default installer to remove explicit preset IDs and stale base models left by earlier plugin catalogs.
|
|
13
27
|
|
|
14
28
|
## Quick pick
|
|
15
29
|
|
|
@@ -33,19 +47,47 @@ opencode --version
|
|
|
33
47
|
|
|
34
48
|
## Why there are two templates
|
|
35
49
|
|
|
36
|
-
OpenCode v1.0.210+ added model `variants`, so one model entry can expose multiple reasoning levels. That keeps modern config
|
|
50
|
+
OpenCode v1.0.210+ added model `variants`, so one model entry can expose multiple reasoning levels. That keeps modern config smaller while preserving the same effective presets.
|
|
37
51
|
|
|
38
52
|
Both templates include:
|
|
39
|
-
|
|
40
|
-
|
|
53
|
+
|
|
54
|
+
### Base model families (12)
|
|
55
|
+
|
|
56
|
+
| Base | Variants (modern) |
|
|
57
|
+
|------|-------------------|
|
|
58
|
+
| `gpt-5.6-sol` | low, medium, high, xhigh, max, ultra |
|
|
59
|
+
| `gpt-5.6-terra` | low, medium, high, xhigh, max, ultra |
|
|
60
|
+
| `gpt-5.6-luna` | low, medium, high, xhigh, max |
|
|
61
|
+
| `gpt-5.5` | none, low, medium, high, xhigh |
|
|
62
|
+
| `gpt-5.5-fast` | none, low, medium, high, xhigh |
|
|
63
|
+
| `gpt-5.4-mini` | none, low, medium, high, xhigh |
|
|
64
|
+
| `gpt-5.4-nano` | none, low, medium, high, xhigh |
|
|
65
|
+
| `gpt-5.1-codex-max` | low, medium, high, xhigh |
|
|
66
|
+
| `gpt-5.1-codex` | low, medium, high |
|
|
67
|
+
| `gpt-5.1-codex-mini` | medium, high |
|
|
68
|
+
| `gpt-5.1` | none, low, medium, high |
|
|
69
|
+
| `gpt-5-codex` | low, medium, high |
|
|
70
|
+
|
|
71
|
+
Shared template requirements:
|
|
72
|
+
|
|
41
73
|
- `store: false` and `include: ["reasoning.encrypted_content"]`
|
|
42
|
-
- Context metadata
|
|
74
|
+
- Context metadata:
|
|
75
|
+
- `gpt-5.6-sol` / `gpt-5.6-terra` / `gpt-5.6-luna` / `gpt-5.5` / `gpt-5.5-fast`: context **1,050,000**, output **128,000**
|
|
76
|
+
- `gpt-5.4-mini` / `gpt-5.4-nano` / Codex models (`gpt-5-codex`, `gpt-5.1-codex*`, …): context **400,000**, output **128,000**
|
|
77
|
+
- `gpt-5.1`: context **272,000**, output **128,000**
|
|
78
|
+
|
|
79
|
+
Use `opencode debug config` to verify that these template entries were merged into your effective config. The default compact install shows base OAuth entries such as `gpt-5.5` / `gpt-5.6-sol`; the separate OpenCode variant picker exposes the reasoning presets.
|
|
80
|
+
|
|
81
|
+
If your OpenCode runtime supports global compaction tuning, you can also set values near the largest context windows (for example ~1M context / slightly lower auto-compact limit). Prefer values that match your selected model family.
|
|
43
82
|
|
|
44
|
-
|
|
83
|
+
## GPT-5.6 notes
|
|
45
84
|
|
|
46
|
-
|
|
47
|
-
-
|
|
48
|
-
-
|
|
85
|
+
- Served over the **responses-lite** path (`use_responses_lite`).
|
|
86
|
+
- Preview entitlement: accounts without access auto-fallback
|
|
87
|
+
`gpt-5.6-sol → gpt-5.6-terra → gpt-5.6-luna → gpt-5.5`
|
|
88
|
+
(disable with `CODEX_AUTH_DISABLE_GPT56_AUTO_FALLBACK=1`).
|
|
89
|
+
- Default client identity for 5.6 is host/opencode (`originator: opencode`); other families default to Codex CLI identity.
|
|
90
|
+
- `ultra` is accepted as a client-side alias and sent as `max` on the wire (no subagent orchestration in this plugin).
|
|
49
91
|
|
|
50
92
|
## Spark model note
|
|
51
93
|
|
|
@@ -60,6 +102,7 @@ Recommended compact UI selectors:
|
|
|
60
102
|
```bash
|
|
61
103
|
opencode run "task" --model=openai/gpt-5.5 --variant=medium
|
|
62
104
|
opencode run "task" --model=openai/gpt-5.5-fast --variant=medium
|
|
105
|
+
opencode run "task" --model=openai/gpt-5.6-sol --variant=medium
|
|
63
106
|
opencode run "task" --model=openai/gpt-5-codex --variant=high
|
|
64
107
|
```
|
|
65
108
|
|
|
@@ -75,29 +118,35 @@ A barebones debug template is available at [`minimal-opencode.json`](./minimal-o
|
|
|
75
118
|
|
|
76
119
|
## Unsupported-model behavior
|
|
77
120
|
|
|
78
|
-
Current defaults are strict entitlement handling except for default
|
|
79
|
-
|
|
121
|
+
Current defaults are strict entitlement handling except for common default-selector entitlement gates:
|
|
122
|
+
|
|
123
|
+
- **GPT-5.6** auto-fallback: `gpt-5.6-sol → gpt-5.6-terra → gpt-5.6-luna → gpt-5.5`
|
|
124
|
+
- **`gpt-5.5`** and canonical **`gpt-5-codex`** can auto-fallback through `gpt-5.4`, `gpt-5.4-mini`, then `gpt-5.4-nano` when the backend reports the selected model is not supported
|
|
80
125
|
- `unsupportedCodexPolicy: "strict"` returns other entitlement errors directly
|
|
81
126
|
- set `unsupportedCodexPolicy: "fallback"` (or `CODEX_AUTH_UNSUPPORTED_MODEL_POLICY=fallback`) to enable the full fallback chain for manual/legacy selectors
|
|
82
127
|
- `fallbackToGpt52OnUnsupportedGpt53: true` keeps the legacy `gpt-5.3-codex -> gpt-5.2-codex` edge inside fallback mode
|
|
83
128
|
- user-typed `gpt-5.5-pro*` is canonicalized to `gpt-5.5` before fallback because GPT-5.5 Pro is ChatGPT-only, not a Codex-routable model
|
|
84
129
|
- legacy Codex selectors such as `gpt-5.2-codex`, `gpt-5.3-codex`, and `gpt-5.3-codex-spark` normalize to canonical `gpt-5-codex`; if that canonical Codex model is gated, the default auto-fallback can retry through the GPT-5.4 family
|
|
130
|
+
- set `CODEX_AUTH_DISABLE_GPT56_AUTO_FALLBACK=1` to disable GPT-5.6 auto-fallback
|
|
85
131
|
- set `CODEX_AUTH_DISABLE_GPT55_AUTO_FALLBACK=1` to disable GPT-5.5 auto-fallback
|
|
86
132
|
- set `CODEX_AUTH_DISABLE_CODEX_AUTO_FALLBACK=1` to disable canonical Codex/GPT-5.4-family auto-fallback
|
|
87
133
|
- `gpt-5.4-pro -> gpt-5.4` remains available for older manual configs
|
|
88
134
|
- `unsupportedCodexFallbackChain` lets you override fallback order per model
|
|
89
135
|
|
|
90
|
-
Default
|
|
91
|
-
|
|
92
|
-
- `gpt-5-
|
|
93
|
-
- `gpt-5.
|
|
94
|
-
- `gpt-5
|
|
95
|
-
- `gpt-5.
|
|
96
|
-
- `gpt-5.
|
|
97
|
-
- `gpt-5.
|
|
136
|
+
Default chains when generic fallback policy is enabled (and empty override map):
|
|
137
|
+
|
|
138
|
+
- `gpt-5.6-sol → gpt-5.6-terra → gpt-5.6-luna → gpt-5.5` (also auto under default strict for preview gates)
|
|
139
|
+
- `gpt-5.5 → gpt-5.4 → gpt-5.4-mini → gpt-5.4-nano`
|
|
140
|
+
- `gpt-5-codex → gpt-5.4 → gpt-5.4-mini → gpt-5.4-nano`
|
|
141
|
+
- `gpt-5.4-pro → gpt-5.4` (if you manually select `gpt-5.4-pro`)
|
|
142
|
+
- `gpt-5.3-codex → gpt-5-codex → gpt-5.2-codex`
|
|
143
|
+
- `gpt-5.3-codex-spark → gpt-5-codex → gpt-5.3-codex → gpt-5.2-codex` (only if Spark IDs are added manually)
|
|
144
|
+
- `gpt-5.2-codex → gpt-5-codex`
|
|
145
|
+
- `gpt-5.1-codex → gpt-5-codex`
|
|
98
146
|
|
|
99
147
|
## Additional docs
|
|
100
148
|
|
|
101
149
|
- Main config reference: [`docs/configuration.md`](../docs/configuration.md)
|
|
102
150
|
- Getting started: [`docs/getting-started.md`](../docs/getting-started.md)
|
|
151
|
+
- Tools and CLI: [`docs/tools-and-cli.md`](../docs/tools-and-cli.md)
|
|
103
152
|
- Troubleshooting: [`docs/troubleshooting.md`](../docs/troubleshooting.md)
|
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;AA8M/D;;;;;;;;;;;;;;;GAeG;AAEH,eAAO,MAAM,iBAAiB,EAAE,MA8wH/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, getAutoUpdate, getToastDurationMs, getPerProjectAccounts, getEmptyResponseMaxRetries, getEmptyResponseRetryDelayMs, getPidOffsetEnabled, getRotationStrategy, getModelAccountPool, getFetchTimeoutMs, getStreamStallTimeoutMs, getCodexTuiV2, getCodexTuiColorProfile, getCodexTuiGlyphMode, getBeginnerSafeMode, getCodexTuiMaskEmail, 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, getAccountToastsEnabled, getPerProjectAccounts, getEmptyResponseMaxRetries, getEmptyResponseRetryDelayMs, getPidOffsetEnabled, getRotationStrategy, getModelAccountPool, getFetchTimeoutMs, getStreamStallTimeoutMs, getCodexTuiV2, getCodexTuiColorProfile, getCodexTuiGlyphMode, getBeginnerSafeMode, getCodexTuiMaskEmail, 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";
|
|
@@ -896,6 +896,35 @@ export const OpenAIOAuthPlugin = async ({ client }) => {
|
|
|
896
896
|
});
|
|
897
897
|
}
|
|
898
898
|
};
|
|
899
|
+
const reloadCachedAccountManager = async () => {
|
|
900
|
+
if (!cachedAccountManager)
|
|
901
|
+
return;
|
|
902
|
+
const previous = cachedAccountManager;
|
|
903
|
+
// Flush the outgoing manager's pending debounced save BEFORE reading
|
|
904
|
+
// fresh disk state. Otherwise a queued save from `previous` can fire
|
|
905
|
+
// after this reload and silently overwrite the single-use refresh
|
|
906
|
+
// tokens codex-health/codex-refresh just persisted via
|
|
907
|
+
// withAccountStorageTransaction — a lost-update on rotated credentials.
|
|
908
|
+
// Mirrors invalidateAccountManagerCache above.
|
|
909
|
+
try {
|
|
910
|
+
await previous.flushPendingSave();
|
|
911
|
+
}
|
|
912
|
+
catch (error) {
|
|
913
|
+
logWarn(`Failed to flush pending save while reloading account manager: ${error instanceof Error ? error.message : String(error)}`);
|
|
914
|
+
}
|
|
915
|
+
try {
|
|
916
|
+
const reloadedManager = await AccountManager.loadFromDisk();
|
|
917
|
+
cachedAccountManager = reloadedManager;
|
|
918
|
+
accountManagerPromise = Promise.resolve(reloadedManager);
|
|
919
|
+
// Dispose only after the replacement is installed so we never leak
|
|
920
|
+
// the outgoing manager's shutdown handler on every reload, and so a
|
|
921
|
+
// load failure leaves the working manager intact.
|
|
922
|
+
previous.disposeShutdownHandler();
|
|
923
|
+
}
|
|
924
|
+
catch (error) {
|
|
925
|
+
logWarn(`Failed to reload account manager: ${error instanceof Error ? error.message : String(error)}`);
|
|
926
|
+
}
|
|
927
|
+
};
|
|
899
928
|
const persistAuthenticatedSelections = async (results, replaceAll) => {
|
|
900
929
|
try {
|
|
901
930
|
await persistAccountPool(results, replaceAll);
|
|
@@ -948,11 +977,7 @@ export const OpenAIOAuthPlugin = async ({ client }) => {
|
|
|
948
977
|
await clearPromptQuotaCache();
|
|
949
978
|
// Reload manager from disk so we don't overwrite newer rotated
|
|
950
979
|
// refresh tokens with stale in-memory state.
|
|
951
|
-
|
|
952
|
-
const reloadedManager = await AccountManager.loadFromDisk();
|
|
953
|
-
cachedAccountManager = reloadedManager;
|
|
954
|
-
accountManagerPromise = Promise.resolve(reloadedManager);
|
|
955
|
-
}
|
|
980
|
+
await reloadCachedAccountManager();
|
|
956
981
|
await showToast(`Switched to account ${index + 1}`, "info");
|
|
957
982
|
}
|
|
958
983
|
}
|
|
@@ -984,6 +1009,7 @@ export const OpenAIOAuthPlugin = async ({ client }) => {
|
|
|
984
1009
|
accountManagerPromise = value;
|
|
985
1010
|
},
|
|
986
1011
|
},
|
|
1012
|
+
reloadCachedAccountManager,
|
|
987
1013
|
runtimeMetrics,
|
|
988
1014
|
beginnerSafeModeRef: {
|
|
989
1015
|
get current() {
|
|
@@ -1126,6 +1152,7 @@ export const OpenAIOAuthPlugin = async ({ client }) => {
|
|
|
1126
1152
|
const fallbackToGpt52OnUnsupportedGpt53 = getFallbackToGpt52OnUnsupportedGpt53(pluginConfig);
|
|
1127
1153
|
const unsupportedCodexFallbackChain = getUnsupportedCodexFallbackChain(pluginConfig);
|
|
1128
1154
|
const toastDurationMs = getToastDurationMs(pluginConfig);
|
|
1155
|
+
const accountToastsEnabled = getAccountToastsEnabled(pluginConfig);
|
|
1129
1156
|
const fetchTimeoutMs = getFetchTimeoutMs(pluginConfig);
|
|
1130
1157
|
const streamStallTimeoutMs = getStreamStallTimeoutMs(pluginConfig);
|
|
1131
1158
|
const sessionRecoveryEnabled = getSessionRecovery(pluginConfig);
|
|
@@ -1497,7 +1524,8 @@ export const OpenAIOAuthPlugin = async ({ client }) => {
|
|
|
1497
1524
|
// for this request so the TUI quota cache accepts the next real
|
|
1498
1525
|
// response-header snapshot instead of filtering it as stale.
|
|
1499
1526
|
accountManager.saveToDiskDebounced();
|
|
1500
|
-
if (
|
|
1527
|
+
if (accountToastsEnabled &&
|
|
1528
|
+
accountCount > 1 &&
|
|
1501
1529
|
accountManager.shouldShowAccountToast(account.index, rateLimitToastDebounceMs)) {
|
|
1502
1530
|
const accountLabel = formatAccountLabel(account, account.index, {
|
|
1503
1531
|
maskEmail: maskEmailEnabled,
|