codex-multi-auth 2.5.0 → 2.6.0
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/.codex-plugin/plugin.json +1 -1
- package/README.md +2 -1
- package/config/codex-legacy.json +425 -0
- package/dist/lib/codex-manager/commands/best.js +2 -2
- package/dist/lib/codex-manager/commands/forecast.js +4 -4
- package/dist/lib/codex-manager/commands/report.js +4 -4
- package/dist/lib/codex-manager/help.js +2 -2
- package/dist/lib/codex-manager/quota-cache-helpers.d.ts +1 -1
- package/dist/lib/codex-manager/quota-cache-helpers.d.ts.map +1 -1
- package/dist/lib/codex-manager/quota-cache-helpers.js +2 -2
- package/dist/lib/codex-manager/repair-commands.js +4 -4
- package/dist/lib/config.d.ts.map +1 -1
- package/dist/lib/config.js +5 -1
- package/dist/lib/quota-probe.d.ts.map +1 -1
- package/dist/lib/quota-probe.js +5 -2
- package/dist/lib/request/helpers/model-map.d.ts +15 -1
- package/dist/lib/request/helpers/model-map.d.ts.map +1 -1
- package/dist/lib/request/helpers/model-map.js +45 -1
- package/dist/lib/runtime/quota-probe.d.ts.map +1 -1
- package/dist/lib/runtime/quota-probe.js +5 -2
- package/package.json +1 -1
- package/scripts/codex.js +129 -15
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "codex-multi-auth",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.6.0",
|
|
4
4
|
"description": "Install and operate codex-multi-auth for the official @openai/codex CLI with multi-account OAuth rotation, switching, health checks, and recovery tools.",
|
|
5
5
|
"interface": {
|
|
6
6
|
"composerIcon": "./assets/codex-multi-auth-icon.svg"
|
package/README.md
CHANGED
|
@@ -384,7 +384,8 @@ codex-multi-auth doctor --json
|
|
|
384
384
|
|
|
385
385
|
## Release Notes
|
|
386
386
|
|
|
387
|
-
- Current stable: [docs/releases/v2.
|
|
387
|
+
- Current stable: [docs/releases/v2.5.0.md](docs/releases/v2.5.0.md) — install via `npm i -g codex-multi-auth`
|
|
388
|
+
- Previous stable: [docs/releases/v2.4.0.md](docs/releases/v2.4.0.md)
|
|
388
389
|
- Previous stable: [docs/releases/v2.3.3.md](docs/releases/v2.3.3.md)
|
|
389
390
|
- Previous stable: [docs/releases/v2.3.2.md](docs/releases/v2.3.2.md)
|
|
390
391
|
- Previous stable: [docs/releases/v2.3.1.md](docs/releases/v2.3.1.md)
|
package/config/codex-legacy.json
CHANGED
|
@@ -15,6 +15,431 @@
|
|
|
15
15
|
"store": false
|
|
16
16
|
},
|
|
17
17
|
"models": {
|
|
18
|
+
"gpt-5.6-sol-low": {
|
|
19
|
+
"name": "GPT 5.6 Sol Low (OAuth)",
|
|
20
|
+
"limit": {
|
|
21
|
+
"context": 372000,
|
|
22
|
+
"output": 128000
|
|
23
|
+
},
|
|
24
|
+
"modalities": {
|
|
25
|
+
"input": [
|
|
26
|
+
"text",
|
|
27
|
+
"image"
|
|
28
|
+
],
|
|
29
|
+
"output": [
|
|
30
|
+
"text"
|
|
31
|
+
]
|
|
32
|
+
},
|
|
33
|
+
"options": {
|
|
34
|
+
"reasoningEffort": "low",
|
|
35
|
+
"reasoningSummary": "auto",
|
|
36
|
+
"textVerbosity": "medium",
|
|
37
|
+
"include": [
|
|
38
|
+
"reasoning.encrypted_content"
|
|
39
|
+
],
|
|
40
|
+
"store": false
|
|
41
|
+
}
|
|
42
|
+
},
|
|
43
|
+
"gpt-5.6-sol-medium": {
|
|
44
|
+
"name": "GPT 5.6 Sol Medium (OAuth)",
|
|
45
|
+
"limit": {
|
|
46
|
+
"context": 372000,
|
|
47
|
+
"output": 128000
|
|
48
|
+
},
|
|
49
|
+
"modalities": {
|
|
50
|
+
"input": [
|
|
51
|
+
"text",
|
|
52
|
+
"image"
|
|
53
|
+
],
|
|
54
|
+
"output": [
|
|
55
|
+
"text"
|
|
56
|
+
]
|
|
57
|
+
},
|
|
58
|
+
"options": {
|
|
59
|
+
"reasoningEffort": "medium",
|
|
60
|
+
"reasoningSummary": "auto",
|
|
61
|
+
"textVerbosity": "medium",
|
|
62
|
+
"include": [
|
|
63
|
+
"reasoning.encrypted_content"
|
|
64
|
+
],
|
|
65
|
+
"store": false
|
|
66
|
+
}
|
|
67
|
+
},
|
|
68
|
+
"gpt-5.6-sol-high": {
|
|
69
|
+
"name": "GPT 5.6 Sol High (OAuth)",
|
|
70
|
+
"limit": {
|
|
71
|
+
"context": 372000,
|
|
72
|
+
"output": 128000
|
|
73
|
+
},
|
|
74
|
+
"modalities": {
|
|
75
|
+
"input": [
|
|
76
|
+
"text",
|
|
77
|
+
"image"
|
|
78
|
+
],
|
|
79
|
+
"output": [
|
|
80
|
+
"text"
|
|
81
|
+
]
|
|
82
|
+
},
|
|
83
|
+
"options": {
|
|
84
|
+
"reasoningEffort": "high",
|
|
85
|
+
"reasoningSummary": "detailed",
|
|
86
|
+
"textVerbosity": "medium",
|
|
87
|
+
"include": [
|
|
88
|
+
"reasoning.encrypted_content"
|
|
89
|
+
],
|
|
90
|
+
"store": false
|
|
91
|
+
}
|
|
92
|
+
},
|
|
93
|
+
"gpt-5.6-sol-xhigh": {
|
|
94
|
+
"name": "GPT 5.6 Sol Extra High (OAuth)",
|
|
95
|
+
"limit": {
|
|
96
|
+
"context": 372000,
|
|
97
|
+
"output": 128000
|
|
98
|
+
},
|
|
99
|
+
"modalities": {
|
|
100
|
+
"input": [
|
|
101
|
+
"text",
|
|
102
|
+
"image"
|
|
103
|
+
],
|
|
104
|
+
"output": [
|
|
105
|
+
"text"
|
|
106
|
+
]
|
|
107
|
+
},
|
|
108
|
+
"options": {
|
|
109
|
+
"reasoningEffort": "xhigh",
|
|
110
|
+
"reasoningSummary": "detailed",
|
|
111
|
+
"textVerbosity": "medium",
|
|
112
|
+
"include": [
|
|
113
|
+
"reasoning.encrypted_content"
|
|
114
|
+
],
|
|
115
|
+
"store": false
|
|
116
|
+
}
|
|
117
|
+
},
|
|
118
|
+
"gpt-5.6-sol-max": {
|
|
119
|
+
"name": "GPT 5.6 Sol Max (OAuth)",
|
|
120
|
+
"limit": {
|
|
121
|
+
"context": 372000,
|
|
122
|
+
"output": 128000
|
|
123
|
+
},
|
|
124
|
+
"modalities": {
|
|
125
|
+
"input": [
|
|
126
|
+
"text",
|
|
127
|
+
"image"
|
|
128
|
+
],
|
|
129
|
+
"output": [
|
|
130
|
+
"text"
|
|
131
|
+
]
|
|
132
|
+
},
|
|
133
|
+
"options": {
|
|
134
|
+
"reasoningEffort": "max",
|
|
135
|
+
"reasoningSummary": "detailed",
|
|
136
|
+
"textVerbosity": "medium",
|
|
137
|
+
"include": [
|
|
138
|
+
"reasoning.encrypted_content"
|
|
139
|
+
],
|
|
140
|
+
"store": false
|
|
141
|
+
}
|
|
142
|
+
},
|
|
143
|
+
"gpt-5.6-sol-ultra": {
|
|
144
|
+
"name": "GPT 5.6 Sol Ultra (OAuth)",
|
|
145
|
+
"limit": {
|
|
146
|
+
"context": 372000,
|
|
147
|
+
"output": 128000
|
|
148
|
+
},
|
|
149
|
+
"modalities": {
|
|
150
|
+
"input": [
|
|
151
|
+
"text",
|
|
152
|
+
"image"
|
|
153
|
+
],
|
|
154
|
+
"output": [
|
|
155
|
+
"text"
|
|
156
|
+
]
|
|
157
|
+
},
|
|
158
|
+
"options": {
|
|
159
|
+
"reasoningEffort": "ultra",
|
|
160
|
+
"reasoningSummary": "detailed",
|
|
161
|
+
"textVerbosity": "medium",
|
|
162
|
+
"include": [
|
|
163
|
+
"reasoning.encrypted_content"
|
|
164
|
+
],
|
|
165
|
+
"store": false
|
|
166
|
+
}
|
|
167
|
+
},
|
|
168
|
+
"gpt-5.6-terra-low": {
|
|
169
|
+
"name": "GPT 5.6 Terra Low (OAuth)",
|
|
170
|
+
"limit": {
|
|
171
|
+
"context": 372000,
|
|
172
|
+
"output": 128000
|
|
173
|
+
},
|
|
174
|
+
"modalities": {
|
|
175
|
+
"input": [
|
|
176
|
+
"text",
|
|
177
|
+
"image"
|
|
178
|
+
],
|
|
179
|
+
"output": [
|
|
180
|
+
"text"
|
|
181
|
+
]
|
|
182
|
+
},
|
|
183
|
+
"options": {
|
|
184
|
+
"reasoningEffort": "low",
|
|
185
|
+
"reasoningSummary": "auto",
|
|
186
|
+
"textVerbosity": "medium",
|
|
187
|
+
"include": [
|
|
188
|
+
"reasoning.encrypted_content"
|
|
189
|
+
],
|
|
190
|
+
"store": false
|
|
191
|
+
}
|
|
192
|
+
},
|
|
193
|
+
"gpt-5.6-terra-medium": {
|
|
194
|
+
"name": "GPT 5.6 Terra Medium (OAuth)",
|
|
195
|
+
"limit": {
|
|
196
|
+
"context": 372000,
|
|
197
|
+
"output": 128000
|
|
198
|
+
},
|
|
199
|
+
"modalities": {
|
|
200
|
+
"input": [
|
|
201
|
+
"text",
|
|
202
|
+
"image"
|
|
203
|
+
],
|
|
204
|
+
"output": [
|
|
205
|
+
"text"
|
|
206
|
+
]
|
|
207
|
+
},
|
|
208
|
+
"options": {
|
|
209
|
+
"reasoningEffort": "medium",
|
|
210
|
+
"reasoningSummary": "auto",
|
|
211
|
+
"textVerbosity": "medium",
|
|
212
|
+
"include": [
|
|
213
|
+
"reasoning.encrypted_content"
|
|
214
|
+
],
|
|
215
|
+
"store": false
|
|
216
|
+
}
|
|
217
|
+
},
|
|
218
|
+
"gpt-5.6-terra-high": {
|
|
219
|
+
"name": "GPT 5.6 Terra High (OAuth)",
|
|
220
|
+
"limit": {
|
|
221
|
+
"context": 372000,
|
|
222
|
+
"output": 128000
|
|
223
|
+
},
|
|
224
|
+
"modalities": {
|
|
225
|
+
"input": [
|
|
226
|
+
"text",
|
|
227
|
+
"image"
|
|
228
|
+
],
|
|
229
|
+
"output": [
|
|
230
|
+
"text"
|
|
231
|
+
]
|
|
232
|
+
},
|
|
233
|
+
"options": {
|
|
234
|
+
"reasoningEffort": "high",
|
|
235
|
+
"reasoningSummary": "detailed",
|
|
236
|
+
"textVerbosity": "medium",
|
|
237
|
+
"include": [
|
|
238
|
+
"reasoning.encrypted_content"
|
|
239
|
+
],
|
|
240
|
+
"store": false
|
|
241
|
+
}
|
|
242
|
+
},
|
|
243
|
+
"gpt-5.6-terra-xhigh": {
|
|
244
|
+
"name": "GPT 5.6 Terra Extra High (OAuth)",
|
|
245
|
+
"limit": {
|
|
246
|
+
"context": 372000,
|
|
247
|
+
"output": 128000
|
|
248
|
+
},
|
|
249
|
+
"modalities": {
|
|
250
|
+
"input": [
|
|
251
|
+
"text",
|
|
252
|
+
"image"
|
|
253
|
+
],
|
|
254
|
+
"output": [
|
|
255
|
+
"text"
|
|
256
|
+
]
|
|
257
|
+
},
|
|
258
|
+
"options": {
|
|
259
|
+
"reasoningEffort": "xhigh",
|
|
260
|
+
"reasoningSummary": "detailed",
|
|
261
|
+
"textVerbosity": "medium",
|
|
262
|
+
"include": [
|
|
263
|
+
"reasoning.encrypted_content"
|
|
264
|
+
],
|
|
265
|
+
"store": false
|
|
266
|
+
}
|
|
267
|
+
},
|
|
268
|
+
"gpt-5.6-terra-max": {
|
|
269
|
+
"name": "GPT 5.6 Terra Max (OAuth)",
|
|
270
|
+
"limit": {
|
|
271
|
+
"context": 372000,
|
|
272
|
+
"output": 128000
|
|
273
|
+
},
|
|
274
|
+
"modalities": {
|
|
275
|
+
"input": [
|
|
276
|
+
"text",
|
|
277
|
+
"image"
|
|
278
|
+
],
|
|
279
|
+
"output": [
|
|
280
|
+
"text"
|
|
281
|
+
]
|
|
282
|
+
},
|
|
283
|
+
"options": {
|
|
284
|
+
"reasoningEffort": "max",
|
|
285
|
+
"reasoningSummary": "detailed",
|
|
286
|
+
"textVerbosity": "medium",
|
|
287
|
+
"include": [
|
|
288
|
+
"reasoning.encrypted_content"
|
|
289
|
+
],
|
|
290
|
+
"store": false
|
|
291
|
+
}
|
|
292
|
+
},
|
|
293
|
+
"gpt-5.6-terra-ultra": {
|
|
294
|
+
"name": "GPT 5.6 Terra Ultra (OAuth)",
|
|
295
|
+
"limit": {
|
|
296
|
+
"context": 372000,
|
|
297
|
+
"output": 128000
|
|
298
|
+
},
|
|
299
|
+
"modalities": {
|
|
300
|
+
"input": [
|
|
301
|
+
"text",
|
|
302
|
+
"image"
|
|
303
|
+
],
|
|
304
|
+
"output": [
|
|
305
|
+
"text"
|
|
306
|
+
]
|
|
307
|
+
},
|
|
308
|
+
"options": {
|
|
309
|
+
"reasoningEffort": "ultra",
|
|
310
|
+
"reasoningSummary": "detailed",
|
|
311
|
+
"textVerbosity": "medium",
|
|
312
|
+
"include": [
|
|
313
|
+
"reasoning.encrypted_content"
|
|
314
|
+
],
|
|
315
|
+
"store": false
|
|
316
|
+
}
|
|
317
|
+
},
|
|
318
|
+
"gpt-5.6-luna-low": {
|
|
319
|
+
"name": "GPT 5.6 Luna Low (OAuth)",
|
|
320
|
+
"limit": {
|
|
321
|
+
"context": 372000,
|
|
322
|
+
"output": 128000
|
|
323
|
+
},
|
|
324
|
+
"modalities": {
|
|
325
|
+
"input": [
|
|
326
|
+
"text",
|
|
327
|
+
"image"
|
|
328
|
+
],
|
|
329
|
+
"output": [
|
|
330
|
+
"text"
|
|
331
|
+
]
|
|
332
|
+
},
|
|
333
|
+
"options": {
|
|
334
|
+
"reasoningEffort": "low",
|
|
335
|
+
"reasoningSummary": "auto",
|
|
336
|
+
"textVerbosity": "medium",
|
|
337
|
+
"include": [
|
|
338
|
+
"reasoning.encrypted_content"
|
|
339
|
+
],
|
|
340
|
+
"store": false
|
|
341
|
+
}
|
|
342
|
+
},
|
|
343
|
+
"gpt-5.6-luna-medium": {
|
|
344
|
+
"name": "GPT 5.6 Luna Medium (OAuth)",
|
|
345
|
+
"limit": {
|
|
346
|
+
"context": 372000,
|
|
347
|
+
"output": 128000
|
|
348
|
+
},
|
|
349
|
+
"modalities": {
|
|
350
|
+
"input": [
|
|
351
|
+
"text",
|
|
352
|
+
"image"
|
|
353
|
+
],
|
|
354
|
+
"output": [
|
|
355
|
+
"text"
|
|
356
|
+
]
|
|
357
|
+
},
|
|
358
|
+
"options": {
|
|
359
|
+
"reasoningEffort": "medium",
|
|
360
|
+
"reasoningSummary": "auto",
|
|
361
|
+
"textVerbosity": "medium",
|
|
362
|
+
"include": [
|
|
363
|
+
"reasoning.encrypted_content"
|
|
364
|
+
],
|
|
365
|
+
"store": false
|
|
366
|
+
}
|
|
367
|
+
},
|
|
368
|
+
"gpt-5.6-luna-high": {
|
|
369
|
+
"name": "GPT 5.6 Luna High (OAuth)",
|
|
370
|
+
"limit": {
|
|
371
|
+
"context": 372000,
|
|
372
|
+
"output": 128000
|
|
373
|
+
},
|
|
374
|
+
"modalities": {
|
|
375
|
+
"input": [
|
|
376
|
+
"text",
|
|
377
|
+
"image"
|
|
378
|
+
],
|
|
379
|
+
"output": [
|
|
380
|
+
"text"
|
|
381
|
+
]
|
|
382
|
+
},
|
|
383
|
+
"options": {
|
|
384
|
+
"reasoningEffort": "high",
|
|
385
|
+
"reasoningSummary": "detailed",
|
|
386
|
+
"textVerbosity": "medium",
|
|
387
|
+
"include": [
|
|
388
|
+
"reasoning.encrypted_content"
|
|
389
|
+
],
|
|
390
|
+
"store": false
|
|
391
|
+
}
|
|
392
|
+
},
|
|
393
|
+
"gpt-5.6-luna-xhigh": {
|
|
394
|
+
"name": "GPT 5.6 Luna Extra High (OAuth)",
|
|
395
|
+
"limit": {
|
|
396
|
+
"context": 372000,
|
|
397
|
+
"output": 128000
|
|
398
|
+
},
|
|
399
|
+
"modalities": {
|
|
400
|
+
"input": [
|
|
401
|
+
"text",
|
|
402
|
+
"image"
|
|
403
|
+
],
|
|
404
|
+
"output": [
|
|
405
|
+
"text"
|
|
406
|
+
]
|
|
407
|
+
},
|
|
408
|
+
"options": {
|
|
409
|
+
"reasoningEffort": "xhigh",
|
|
410
|
+
"reasoningSummary": "detailed",
|
|
411
|
+
"textVerbosity": "medium",
|
|
412
|
+
"include": [
|
|
413
|
+
"reasoning.encrypted_content"
|
|
414
|
+
],
|
|
415
|
+
"store": false
|
|
416
|
+
}
|
|
417
|
+
},
|
|
418
|
+
"gpt-5.6-luna-max": {
|
|
419
|
+
"name": "GPT 5.6 Luna Max (OAuth)",
|
|
420
|
+
"limit": {
|
|
421
|
+
"context": 372000,
|
|
422
|
+
"output": 128000
|
|
423
|
+
},
|
|
424
|
+
"modalities": {
|
|
425
|
+
"input": [
|
|
426
|
+
"text",
|
|
427
|
+
"image"
|
|
428
|
+
],
|
|
429
|
+
"output": [
|
|
430
|
+
"text"
|
|
431
|
+
]
|
|
432
|
+
},
|
|
433
|
+
"options": {
|
|
434
|
+
"reasoningEffort": "max",
|
|
435
|
+
"reasoningSummary": "detailed",
|
|
436
|
+
"textVerbosity": "medium",
|
|
437
|
+
"include": [
|
|
438
|
+
"reasoning.encrypted_content"
|
|
439
|
+
],
|
|
440
|
+
"store": false
|
|
441
|
+
}
|
|
442
|
+
},
|
|
18
443
|
"gpt-5.5-none": {
|
|
19
444
|
"name": "GPT 5.5 None (OAuth)",
|
|
20
445
|
"limit": {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { describeCodexProbeFailure } from "../../quota-probe.js";
|
|
2
|
-
import {
|
|
2
|
+
import { resolveNormalizedModel } from "../../request/helpers/model-map.js";
|
|
3
3
|
import { DEFAULT_LIVE_PROBE_MODEL } from "../quota-cache-helpers.js";
|
|
4
4
|
/**
|
|
5
5
|
* Usage text and argument parsing for `best`. Previously module-private in
|
|
@@ -79,7 +79,7 @@ export async function runBestCommand(args, deps) {
|
|
|
79
79
|
return 1;
|
|
80
80
|
}
|
|
81
81
|
const options = parsedArgs.options;
|
|
82
|
-
const probeModel = resolveNormalizedModel(options.model?.trim() ||
|
|
82
|
+
const probeModel = resolveNormalizedModel(options.model?.trim() || DEFAULT_LIVE_PROBE_MODEL);
|
|
83
83
|
if (options.modelProvided && !options.live) {
|
|
84
84
|
logError("--model requires --live for codex-multi-auth best");
|
|
85
85
|
deps.printBestUsage();
|
|
@@ -2,7 +2,7 @@ import { extractAccountEmail, sanitizeEmail } from "../../accounts.js";
|
|
|
2
2
|
import { buildForecastExplanation, } from "../../forecast.js";
|
|
3
3
|
import { applyRefreshedAccountPatch, persistRefreshedAccountPatch, serializeForecastResults, } from "../forecast-report-shared.js";
|
|
4
4
|
import { describeCodexProbeFailure } from "../../quota-probe.js";
|
|
5
|
-
import {
|
|
5
|
+
import { DEFAULT_PROBE_MODEL, resolveNormalizedModel } from "../../request/helpers/model-map.js";
|
|
6
6
|
function joinStyledSegments(parts, styleText) {
|
|
7
7
|
if (parts.length === 0)
|
|
8
8
|
return "";
|
|
@@ -17,7 +17,7 @@ function printForecastUsage(logInfo) {
|
|
|
17
17
|
" --live, -l Probe live quota headers via Codex backend",
|
|
18
18
|
" --json, -j Print machine-readable JSON output",
|
|
19
19
|
" --explain Include structured recommendation reasoning",
|
|
20
|
-
` --model, -m Probe model for live mode (default: ${
|
|
20
|
+
` --model, -m Probe model for live mode (default: ${DEFAULT_PROBE_MODEL})`,
|
|
21
21
|
" --no-runtime-overlay Ignore persisted runtime skip diagnostics",
|
|
22
22
|
].join("\n"));
|
|
23
23
|
}
|
|
@@ -26,7 +26,7 @@ function parseForecastArgs(args) {
|
|
|
26
26
|
live: false,
|
|
27
27
|
json: false,
|
|
28
28
|
explain: false,
|
|
29
|
-
model:
|
|
29
|
+
model: DEFAULT_PROBE_MODEL,
|
|
30
30
|
runtimeOverlay: true,
|
|
31
31
|
};
|
|
32
32
|
for (let i = 0; i < args.length; i += 1) {
|
|
@@ -84,7 +84,7 @@ export async function runForecastCommand(args, deps) {
|
|
|
84
84
|
return 1;
|
|
85
85
|
}
|
|
86
86
|
const options = parsedArgs.options;
|
|
87
|
-
const requestedModel = options.model?.trim() ||
|
|
87
|
+
const requestedModel = options.model?.trim() || DEFAULT_PROBE_MODEL;
|
|
88
88
|
const probeModel = resolveNormalizedModel(requestedModel);
|
|
89
89
|
const display = deps.loadDashboardDisplaySettings
|
|
90
90
|
? (await deps.loadDashboardDisplaySettings().catch(() => null)) ??
|
|
@@ -4,7 +4,7 @@ import { extractAccountEmail, extractAccountId, formatAccountLabel, sanitizeEmai
|
|
|
4
4
|
import { evaluateForecastAccounts, recommendForecastAccount, summarizeForecast, } from "../../forecast.js";
|
|
5
5
|
import { applyRefreshedAccountPatch, persistRefreshedAccountPatch, serializeForecastResults, } from "../forecast-report-shared.js";
|
|
6
6
|
import { formatQuotaSnapshotLine, describeCodexProbeFailure, } from "../../quota-probe.js";
|
|
7
|
-
import {
|
|
7
|
+
import { DEFAULT_PROBE_MODEL, getModelCapabilities, getModelProfile, resolveNormalizedModel, } from "../../request/helpers/model-map.js";
|
|
8
8
|
import { sleep } from "../../utils.js";
|
|
9
9
|
import { tempPathFor } from "../../temp-path.js";
|
|
10
10
|
function parsePositiveIntegerOption(rawValue) {
|
|
@@ -31,7 +31,7 @@ function printReportUsage(logInfo) {
|
|
|
31
31
|
" --live, -l Probe live quota headers via Codex backend",
|
|
32
32
|
" --json, -j Print machine-readable JSON output",
|
|
33
33
|
" --explain Print per-account reasoning in text mode",
|
|
34
|
-
` --model, -m Probe model for live mode (default: ${
|
|
34
|
+
` --model, -m Probe model for live mode (default: ${DEFAULT_PROBE_MODEL})`,
|
|
35
35
|
" --max-accounts N Limit how many enabled accounts live mode can consider",
|
|
36
36
|
" --max-probes N Limit how many live quota probes can run",
|
|
37
37
|
" --cached-only Skip refreshes and only use already-usable access tokens",
|
|
@@ -43,7 +43,7 @@ function parseReportArgs(args) {
|
|
|
43
43
|
live: false,
|
|
44
44
|
json: false,
|
|
45
45
|
explain: false,
|
|
46
|
-
model:
|
|
46
|
+
model: DEFAULT_PROBE_MODEL,
|
|
47
47
|
cachedOnly: false,
|
|
48
48
|
};
|
|
49
49
|
for (let i = 0; i < args.length; i += 1) {
|
|
@@ -209,7 +209,7 @@ export async function runReportCommand(args, deps) {
|
|
|
209
209
|
return 1;
|
|
210
210
|
}
|
|
211
211
|
const options = parsedArgs.options;
|
|
212
|
-
const requestedModel = options.model?.trim() ||
|
|
212
|
+
const requestedModel = options.model?.trim() || DEFAULT_PROBE_MODEL;
|
|
213
213
|
const modelInspection = inspectRequestedModel(requestedModel);
|
|
214
214
|
deps.setStoragePath(null);
|
|
215
215
|
const storagePath = deps.getStoragePath();
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
const DEFAULT_LIVE_PROBE_MODEL =
|
|
1
|
+
import { DEFAULT_PROBE_MODEL } from "../request/helpers/model-map.js";
|
|
2
|
+
const DEFAULT_LIVE_PROBE_MODEL = DEFAULT_PROBE_MODEL;
|
|
3
3
|
export function printUsage() {
|
|
4
4
|
console.log([
|
|
5
5
|
"Codex Multi-Auth CLI",
|
|
@@ -10,7 +10,7 @@ import type { AccountMetadataV3 } from "../storage.js";
|
|
|
10
10
|
* implementation.
|
|
11
11
|
*/
|
|
12
12
|
/** Default model used for live quota probes across manager commands. */
|
|
13
|
-
export declare const DEFAULT_LIVE_PROBE_MODEL = "gpt-5.
|
|
13
|
+
export declare const DEFAULT_LIVE_PROBE_MODEL = "gpt-5.6-sol";
|
|
14
14
|
export declare function getPersistedQuotaViewForAccount(cache: QuotaCacheData | null, account: Pick<AccountMetadataV3, "accountId" | "email" | "rateLimitResetTimes">, accounts: readonly Pick<AccountMetadataV3, "accountId" | "email">[], now: number, emailFallbackState?: ReadonlyMap<string, import("../quota-readiness.js").QuotaEmailFallbackState>): QuotaCacheEntry | null;
|
|
15
15
|
export declare function updateQuotaCacheForAccount(cache: QuotaCacheData, account: Pick<AccountMetadataV3, "accountId" | "email">, snapshot: CodexQuotaSnapshot, accounts: readonly Pick<AccountMetadataV3, "accountId" | "email">[], emailFallbackState?: ReadonlyMap<string, import("../quota-readiness.js").QuotaEmailFallbackState>): boolean;
|
|
16
16
|
export declare function cloneQuotaCacheData(cache: QuotaCacheData): QuotaCacheData;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"quota-cache-helpers.d.ts","sourceRoot":"","sources":["../../../lib/codex-manager/quota-cache-helpers.ts"],"names":[],"mappings":"AAOA,OAAO,EACN,KAAK,cAAc,EACnB,KAAK,eAAe,EACpB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GAAG,OAAO,CAAC,EAAE,EACnE,kBAAkB,+EAAyC,GACzD,OAAO,CAeT"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { buildQuotaEmailFallbackState, hasSafeQuotaEmailFallback, hasUniqueQuotaAccountId, normalizeQuotaAccountId, normalizeQuotaEmail, } from "../quota-readiness.js";
|
|
2
|
-
import { DEFAULT_MODEL } from "../request/helpers/model-map.js";
|
|
2
|
+
import { DEFAULT_MODEL, DEFAULT_PROBE_MODEL, } from "../request/helpers/model-map.js";
|
|
3
3
|
import { getRateLimitResetTimeForFamily } from "../runtime/account-status.js";
|
|
4
4
|
/**
|
|
5
5
|
* Quota-cache lookup/update helpers shared by the manager CLI commands (audit
|
|
@@ -10,7 +10,7 @@ import { getRateLimitResetTimeForFamily } from "../runtime/account-status.js";
|
|
|
10
10
|
* implementation.
|
|
11
11
|
*/
|
|
12
12
|
/** Default model used for live quota probes across manager commands. */
|
|
13
|
-
export const DEFAULT_LIVE_PROBE_MODEL =
|
|
13
|
+
export const DEFAULT_LIVE_PROBE_MODEL = DEFAULT_PROBE_MODEL;
|
|
14
14
|
function getQuotaCacheEntryForAccount(cache, account, accounts, emailFallbackState = buildQuotaEmailFallbackState(accounts)) {
|
|
15
15
|
const accountId = normalizeQuotaAccountId(account.accountId);
|
|
16
16
|
if (accountId &&
|
|
@@ -11,7 +11,7 @@ import { findMatchingAccountIndex, getStoragePath, loadAccounts, loadFlaggedAcco
|
|
|
11
11
|
import { getCodexCliAuthPath, getCodexCliConfigPath, loadCodexCliState, } from "../codex-cli/state.js";
|
|
12
12
|
import { setCodexCliActiveSelection } from "../codex-cli/writer.js";
|
|
13
13
|
import { MODEL_FAMILIES } from "../prompts/codex.js";
|
|
14
|
-
import {
|
|
14
|
+
import { DEFAULT_PROBE_MODEL, resolveNormalizedModel } from "../request/helpers/model-map.js";
|
|
15
15
|
import { loadPersistedRuntimeObservabilitySnapshot } from "../runtime/runtime-observability.js";
|
|
16
16
|
function printFixUsage() {
|
|
17
17
|
console.log([
|
|
@@ -22,7 +22,7 @@ function printFixUsage() {
|
|
|
22
22
|
" --dry-run, -n Preview changes without writing storage",
|
|
23
23
|
" --json, -j Print machine-readable JSON output",
|
|
24
24
|
" --live, -l Run live session probe before deciding health",
|
|
25
|
-
` --model, -m Probe model for live mode (default: ${
|
|
25
|
+
` --model, -m Probe model for live mode (default: ${DEFAULT_PROBE_MODEL})`,
|
|
26
26
|
"",
|
|
27
27
|
"Behavior:",
|
|
28
28
|
" - Refreshes tokens for enabled accounts",
|
|
@@ -66,7 +66,7 @@ export function parseFixArgs(args) {
|
|
|
66
66
|
dryRun: false,
|
|
67
67
|
json: false,
|
|
68
68
|
live: false,
|
|
69
|
-
model:
|
|
69
|
+
model: DEFAULT_PROBE_MODEL,
|
|
70
70
|
};
|
|
71
71
|
for (let i = 0; i < args.length; i += 1) {
|
|
72
72
|
const argValue = args[i];
|
|
@@ -822,7 +822,7 @@ export async function runFix(args, deps) {
|
|
|
822
822
|
return 1;
|
|
823
823
|
}
|
|
824
824
|
const options = parsedArgs.options;
|
|
825
|
-
const probeModel = resolveNormalizedModel(options.model.trim() ||
|
|
825
|
+
const probeModel = resolveNormalizedModel(options.model.trim() || DEFAULT_PROBE_MODEL);
|
|
826
826
|
const display = DEFAULT_DASHBOARD_DISPLAY_SETTINGS;
|
|
827
827
|
const quotaCache = options.live ? await loadQuotaCache() : null;
|
|
828
828
|
const workingQuotaCache = quotaCache ? deps.cloneQuotaCacheData(quotaCache) : null;
|
package/dist/lib/config.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../../lib/config.ts"],"names":[],"mappings":"AAaA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC;AAoE/C,MAAM,MAAM,sBAAsB,GAAG,QAAQ,GAAG,UAAU,CAAC;AAE3D,KAAK,wBAAwB,GAAG,SAAS,GAAG,MAAM,GAAG,MAAM,GAAG,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;AAED;;;;;;;;;GASG;AACH,wBAAgB,wBAAwB,CAAC,YAAY,EAAE,YAAY,GAAG,MAAM,CAO3E;AAED;;;;;;;;;;GAUG;AACH,wBAAgB,8BAA8B,CAAC,YAAY,EAAE,YAAY,GAAG,MAAM,CAOjF;AAED;;;;;;;;;;;;GAYG;AACH,wBAAgB,wBAAwB,CAAC,YAAY,EAAE,YAAY,GAAG,MAAM,CAO3E;AAED;;;;;;;GAOG;AACH,wBAAgB,uBAAuB,CAAC,YAAY,EAAE,YAAY,GAAG,OAAO,CAM3E;AAED;;;;;;;;GAQG;AACH,wBAAgB,yBAAyB,CAAC,YAAY,EAAE,YAAY,GAAG,OAAO,CAM7E;AAED;;;;;GAKG;AACH,wBAAgB,oCAAoC,CACnD,YAAY,EAAE,YAAY,GACxB,MAAM,CAOR;AAED;;;;;;;;;;;;GAYG;AACH,wBAAgB,oCAAoC,CACnD,YAAY,EAAE,YAAY,GACxB,MAAM,CAOR;AAED;;;;;;;;;;;GAWG;AACH,wBAAgB,+BAA+B,CAC9C,YAAY,EAAE,YAAY,GACxB,MAAM,CAOR;AAID;;;;;;;;;;;;GAYG;AACH,wBAAgB,mBAAmB,CAClC,YAAY,EAAE,YAAY,GACxB,SAAS,GAAG,QAAQ,CAOtB;AAID;;;;;;;;;;;;;;;;GAgBG;AACH,wBAAgB,qBAAqB,CACpC,YAAY,EAAE,YAAY,GACxB,QAAQ,GAAG,YAAY,CAOzB;AAuWD,wBAAgB,4BAA4B,IAAI,mBAAmB,CA0BlE"}
|
package/dist/lib/config.js
CHANGED
|
@@ -144,7 +144,11 @@ export const DEFAULT_PLUGIN_CONFIG = {
|
|
|
144
144
|
rateLimitStateResetMs: 120_000,
|
|
145
145
|
rateLimitMaxBackoffMs: 60_000,
|
|
146
146
|
rateLimitShortRetryThresholdMs: 5_000,
|
|
147
|
-
|
|
147
|
+
// Default-on so parallel `codex-multi-auth-codex` processes (e.g. many agents
|
|
148
|
+
// run concurrently) each bias toward a different account, reducing cascading
|
|
149
|
+
// 429s under high parallelism (#628). No-op for single-account pools; a manual
|
|
150
|
+
// pin and health/quota scoring still take precedence over the small offset.
|
|
151
|
+
pidOffsetEnabled: true,
|
|
148
152
|
fetchTimeoutMs: 60_000,
|
|
149
153
|
streamStallTimeoutMs: 45_000,
|
|
150
154
|
liveAccountSync: true,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"quota-probe.d.ts","sourceRoot":"","sources":["../../lib/quota-probe.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"quota-probe.d.ts","sourceRoot":"","sources":["../../lib/quota-probe.ts"],"names":[],"mappings":"AAYA;;;;;GAKG;AACH,eAAO,MAAM,4BAA4B,yCAAyC,CAAC;AAEnF;;;;;;;;;;;;GAYG;AACH,wBAAgB,yBAAyB,CACxC,KAAK,EAAE,OAAO,EACd,SAAS,CAAC,EAAE,CAAC,OAAO,EAAE,MAAM,KAAK,MAAM,GACrC,MAAM,CAMR;AAED,MAAM,WAAW,gBAAgB;IAChC,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,SAAS,CAAC,EAAE,MAAM,CAAC;CACnB;AAED,MAAM,WAAW,kBAAkB;IAClC,MAAM,EAAE,MAAM,CAAC;IACf,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,OAAO,EAAE,gBAAgB,CAAC;IAC1B,SAAS,EAAE,gBAAgB,CAAC;IAC5B,KAAK,EAAE,MAAM,CAAC;CACd;AAiQD;;;;;;;;;GASG;AACH,wBAAgB,uBAAuB,CAAC,QAAQ,EAAE,kBAAkB,GAAG,MAAM,CAa5E;AAED,MAAM,WAAW,sBAAsB;IACtC,SAAS,EAAE,MAAM,CAAC;IAClB,WAAW,EAAE,MAAM,CAAC;IACpB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,cAAc,CAAC,EAAE,SAAS,MAAM,EAAE,CAAC;IACnC,SAAS,CAAC,EAAE,MAAM,CAAC;CACnB;AAED;;;;;;;;;;;;;;;GAeG;AACH,wBAAsB,uBAAuB,CAC5C,OAAO,EAAE,sBAAsB,GAC7B,OAAO,CAAC,kBAAkB,CAAC,CA4G7B"}
|
package/dist/lib/quota-probe.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { CODEX_BASE_URL } from "./constants.js";
|
|
2
2
|
import { createCodexHeaders, getUnsupportedCodexModelInfo } from "./request/fetch-helpers.js";
|
|
3
|
-
import { QUOTA_PROBE_MODEL_CHAIN } from "./request/helpers/model-map.js";
|
|
3
|
+
import { QUOTA_PROBE_MODEL_CHAIN, resolveProbeReasoningEffort, } from "./request/helpers/model-map.js";
|
|
4
4
|
import { CodexUnavailableError, isCodexUnavailableError } from "./errors.js";
|
|
5
5
|
import { getCodexInstructions } from "./prompts/codex.js";
|
|
6
6
|
import { mutateRuntimeObservabilitySnapshot } from "./runtime/runtime-observability.js";
|
|
@@ -338,7 +338,10 @@ export async function fetchCodexQuotaSnapshot(options) {
|
|
|
338
338
|
content: [{ type: "input_text", text: "quota ping" }],
|
|
339
339
|
},
|
|
340
340
|
],
|
|
341
|
-
|
|
341
|
+
// Send the cheapest effort each probe model actually declares (the
|
|
342
|
+
// GPT-5.6 tiers and codex models do not list `none`), keeping the
|
|
343
|
+
// probe consistent with normal request routing (issue #627).
|
|
344
|
+
reasoning: { effort: resolveProbeReasoningEffort(model), summary: "auto" },
|
|
342
345
|
text: { verbosity: "low" },
|
|
343
346
|
};
|
|
344
347
|
const headers = createCodexHeaders(undefined, options.accountId, options.accessToken, {
|
|
@@ -33,7 +33,8 @@ export interface ModelProfile {
|
|
|
33
33
|
}
|
|
34
34
|
export declare const CURRENT_CODEX_MODEL = "gpt-5.3-codex";
|
|
35
35
|
export declare const DEFAULT_MODEL = "gpt-5.5";
|
|
36
|
-
export declare const
|
|
36
|
+
export declare const DEFAULT_PROBE_MODEL = "gpt-5.6-sol";
|
|
37
|
+
export declare const QUOTA_PROBE_MODEL_CHAIN: readonly ["gpt-5.6-sol", "gpt-5.5", "gpt-5.4", "gpt-5.3-codex", "gpt-5.2-codex", "gpt-5-codex"];
|
|
37
38
|
/**
|
|
38
39
|
* Effective model profiles keyed by canonical model name.
|
|
39
40
|
*
|
|
@@ -68,6 +69,19 @@ export declare function getModelProfile(model: string | undefined): ModelProfile
|
|
|
68
69
|
* Expose current tool-surface metadata for diagnostics and capability checks.
|
|
69
70
|
*/
|
|
70
71
|
export declare function getModelCapabilities(model: string | undefined): ModelCapabilities;
|
|
72
|
+
/**
|
|
73
|
+
* Resolve the cheapest reasoning effort a probe model actually supports.
|
|
74
|
+
*
|
|
75
|
+
* A quota probe only needs the response's quota headers, so it wants the
|
|
76
|
+
* lowest-cost effort. Rather than hardcoding `none`, it sends the cheapest
|
|
77
|
+
* effort the probe model actually declares support for, mirroring how
|
|
78
|
+
* `getReasoningConfig` coerces a real request: the GPT-5.6 tiers and the codex
|
|
79
|
+
* models do not list `none`/`minimal` in the upstream catalog, so the probe
|
|
80
|
+
* sends `low` for them and `none` for the pre-5.6 general models that do
|
|
81
|
+
* (issue #627). Keeps the probe's effort consistent with normal routing and
|
|
82
|
+
* within each model's declared range. Never returns `ultra`.
|
|
83
|
+
*/
|
|
84
|
+
export declare function resolveProbeReasoningEffort(model: string | undefined): WireReasoningEffort;
|
|
71
85
|
/**
|
|
72
86
|
* Check if a model ID is in the explicit model map.
|
|
73
87
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"model-map.d.ts","sourceRoot":"","sources":["../../../../lib/request/helpers/model-map.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAKH,OAAO,KAAK,EACX,oBAAoB,EACpB,mBAAmB,EACnB,MAAM,oBAAoB,CAAC;AAE5B,YAAY,EAAE,oBAAoB,EAAE,mBAAmB,EAAE,CAAC;AAE1D,MAAM,MAAM,iBAAiB,GAC1B,aAAa,GACb,WAAW,GACX,OAAO,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C,sBAAsB,EAAE,oBAAoB,CAAC;IAC7C,yBAAyB,EAAE,SAAS,oBAAoB,EAAE,CAAC;IAC3D,YAAY,EAAE,iBAAiB,CAAC;CAChC;AA6CD,eAAO,MAAM,mBAAmB,kBAAkB,CAAC;AACnD,eAAO,MAAM,aAAa,YAAY,CAAC;AAQvC,eAAO,MAAM,mBAAmB,gBAAgB,CAAC;AAOjD,eAAO,MAAM,uBAAuB,iGAO1B,CAAC;AA4EX;;;;;;;GAOG;AACH,eAAO,MAAM,cAAc,EAAE,MAAM,CAAC,MAAM,EAAE,YAAY,CA6G9C,CAAC;AAEX,QAAA,MAAM,SAAS,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAM,CAAC;AAqG7C,OAAO,EAAE,SAAS,EAAE,CAAC;AAoKrB;;;;;GAKG;AACH,wBAAgB,kBAAkB,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,CAQtE;AAED;;;;;;GAMG;AACH,wBAAgB,sBAAsB,CAAC,KAAK,EAAE,MAAM,GAAG,SAAS,GAAG,MAAM,CA2BxE;AAED;;GAEG;AACH,wBAAgB,eAAe,CAAC,KAAK,EAAE,MAAM,GAAG,SAAS,GAAG,YAAY,CAavE;AAED;;GAEG;AACH,wBAAgB,oBAAoB,CAAC,KAAK,EAAE,MAAM,GAAG,SAAS,GAAG,iBAAiB,CAEjF;AAeD;;;;;;;;;;;GAWG;AACH,wBAAgB,2BAA2B,CAC1C,KAAK,EAAE,MAAM,GAAG,SAAS,GACvB,mBAAmB,CASrB;AAED;;;;;GAKG;AACH,wBAAgB,YAAY,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAErD"}
|
|
@@ -54,10 +54,20 @@ const TOOL_CAPABILITIES = {
|
|
|
54
54
|
};
|
|
55
55
|
export const CURRENT_CODEX_MODEL = "gpt-5.3-codex";
|
|
56
56
|
export const DEFAULT_MODEL = "gpt-5.5";
|
|
57
|
+
// Model used for diagnostic live/quota probes (`check`, `report`, `best`).
|
|
58
|
+
// Deliberately distinct from DEFAULT_MODEL: GPT-5.6 is the latest general family
|
|
59
|
+
// (issue #627), so the probe leads with it, while DEFAULT_MODEL stays on 5.5 so
|
|
60
|
+
// actual request routing and the legacy `gpt-5` alias remain opt-in per 2.5.0.
|
|
61
|
+
// Bare `gpt-5.6` aliases to Sol; we pin the canonical id so the probe display
|
|
62
|
+
// and report `modelSelection` read `gpt-5.6-sol` without a remap arrow.
|
|
63
|
+
export const DEFAULT_PROBE_MODEL = "gpt-5.6-sol";
|
|
57
64
|
// Single source of truth for the live/quota probe fallback chain. Both the
|
|
58
65
|
// manager probe (lib/quota-probe.ts) and the runtime probe (lib/runtime/quota-probe.ts)
|
|
59
|
-
// import this so the ordered candidate list cannot drift between them.
|
|
66
|
+
// import this so the ordered candidate list cannot drift between them. It leads
|
|
67
|
+
// with GPT-5.6 and steps down so accounts without 5.6 entitlement still resolve
|
|
68
|
+
// a working probe model.
|
|
60
69
|
export const QUOTA_PROBE_MODEL_CHAIN = [
|
|
70
|
+
DEFAULT_PROBE_MODEL,
|
|
61
71
|
DEFAULT_MODEL,
|
|
62
72
|
"gpt-5.4",
|
|
63
73
|
"gpt-5.3-codex",
|
|
@@ -501,6 +511,40 @@ export function getModelProfile(model) {
|
|
|
501
511
|
export function getModelCapabilities(model) {
|
|
502
512
|
return getModelProfile(model).capabilities;
|
|
503
513
|
}
|
|
514
|
+
// Cheapest-first ordering used to pick a quota-probe reasoning effort. `ultra`
|
|
515
|
+
// is intentionally absent: it never reaches the wire (upstream rewrites it to
|
|
516
|
+
// `max`) and would only ever be a more expensive choice than `max` anyway.
|
|
517
|
+
const PROBE_REASONING_EFFORT_PREFERENCE = [
|
|
518
|
+
"none",
|
|
519
|
+
"minimal",
|
|
520
|
+
"low",
|
|
521
|
+
"medium",
|
|
522
|
+
"high",
|
|
523
|
+
"xhigh",
|
|
524
|
+
"max",
|
|
525
|
+
];
|
|
526
|
+
/**
|
|
527
|
+
* Resolve the cheapest reasoning effort a probe model actually supports.
|
|
528
|
+
*
|
|
529
|
+
* A quota probe only needs the response's quota headers, so it wants the
|
|
530
|
+
* lowest-cost effort. Rather than hardcoding `none`, it sends the cheapest
|
|
531
|
+
* effort the probe model actually declares support for, mirroring how
|
|
532
|
+
* `getReasoningConfig` coerces a real request: the GPT-5.6 tiers and the codex
|
|
533
|
+
* models do not list `none`/`minimal` in the upstream catalog, so the probe
|
|
534
|
+
* sends `low` for them and `none` for the pre-5.6 general models that do
|
|
535
|
+
* (issue #627). Keeps the probe's effort consistent with normal routing and
|
|
536
|
+
* within each model's declared range. Never returns `ultra`.
|
|
537
|
+
*/
|
|
538
|
+
export function resolveProbeReasoningEffort(model) {
|
|
539
|
+
const profile = getModelProfile(model);
|
|
540
|
+
for (const effort of PROBE_REASONING_EFFORT_PREFERENCE) {
|
|
541
|
+
if (profile.supportedReasoningEfforts.includes(effort)) {
|
|
542
|
+
return effort;
|
|
543
|
+
}
|
|
544
|
+
}
|
|
545
|
+
const fallback = profile.defaultReasoningEffort;
|
|
546
|
+
return fallback === "ultra" ? "max" : fallback;
|
|
547
|
+
}
|
|
504
548
|
/**
|
|
505
549
|
* Check if a model ID is in the explicit model map.
|
|
506
550
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"quota-probe.d.ts","sourceRoot":"","sources":["../../../lib/runtime/quota-probe.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,mBAAmB,CAAC;AAC5D,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,oBAAoB,CAAC;
|
|
1
|
+
{"version":3,"file":"quota-probe.d.ts","sourceRoot":"","sources":["../../../lib/runtime/quota-probe.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,mBAAmB,CAAC;AAC5D,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,oBAAoB,CAAC;AAQnE,wBAAsB,8BAA8B,CAAC,MAAM,EAAE;IAC5D,SAAS,EAAE,MAAM,CAAC;IAClB,WAAW,EAAE,MAAM,CAAC;IACpB,OAAO,EAAE,MAAM,CAAC;IAChB,SAAS,EAAE,OAAO,KAAK,CAAC;IACxB,oBAAoB,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,OAAO,CAAC,MAAM,CAAC,CAAC;IACzD,kBAAkB,EAAE,CACnB,IAAI,EAAE,WAAW,GAAG,SAAS,EAC7B,SAAS,EAAE,MAAM,EACjB,WAAW,EAAE,MAAM,EACnB,IAAI,EAAE;QAAE,KAAK,EAAE,MAAM,CAAA;KAAE,KACnB,OAAO,CAAC;IACb,uBAAuB,EAAE,CACxB,OAAO,EAAE,OAAO,EAChB,MAAM,EAAE,MAAM,KACV,wBAAwB,GAAG,IAAI,CAAC;IACrC,4BAA4B,EAAE,CAAC,SAAS,EAAE,OAAO,KAAK;QACrD,aAAa,EAAE,OAAO,CAAC;QACvB,OAAO,CAAC,EAAE,MAAM,CAAC;KACjB,CAAC;CACF,GAAG,OAAO,CAAC,kBAAkB,CAAC,CA8F9B"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { QUOTA_PROBE_MODEL_CHAIN } from "../request/helpers/model-map.js";
|
|
1
|
+
import { QUOTA_PROBE_MODEL_CHAIN, resolveProbeReasoningEffort, } from "../request/helpers/model-map.js";
|
|
2
2
|
const QUOTA_PROBE_MODELS = QUOTA_PROBE_MODEL_CHAIN;
|
|
3
3
|
export async function fetchRuntimeCodexQuotaSnapshot(params) {
|
|
4
4
|
let lastError = null;
|
|
@@ -18,7 +18,10 @@ export async function fetchRuntimeCodexQuotaSnapshot(params) {
|
|
|
18
18
|
content: [{ type: "input_text", text: "quota ping" }],
|
|
19
19
|
},
|
|
20
20
|
],
|
|
21
|
-
|
|
21
|
+
// Send the cheapest effort each probe model actually declares (the
|
|
22
|
+
// GPT-5.6 tiers and codex models do not list `none`), keeping the
|
|
23
|
+
// probe consistent with normal request routing (issue #627).
|
|
24
|
+
reasoning: { effort: resolveProbeReasoningEffort(model), summary: "auto" },
|
|
22
25
|
text: { verbosity: "low" },
|
|
23
26
|
};
|
|
24
27
|
const headers = params.createCodexHeaders(undefined, params.accountId, params.accessToken, { model });
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "codex-multi-auth",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.6.0",
|
|
4
4
|
"description": "Codex CLI multi-account OAuth manager with account switching, health checks, runtime rotation, diagnostics, and recovery tools for @openai/codex",
|
|
5
5
|
"main": "./dist/index.js",
|
|
6
6
|
"types": "./dist/index.d.ts",
|
package/scripts/codex.js
CHANGED
|
@@ -475,6 +475,10 @@ async function applyForcedAccountSelection(rawArgs, env = process.env) {
|
|
|
475
475
|
|
|
476
476
|
function resolveModelFamilyForStatus(model) {
|
|
477
477
|
const normalized = typeof model === "string" ? model.trim().toLowerCase() : "";
|
|
478
|
+
// GPT-5.6 general tiers share the gpt-5.2 prompt family (see
|
|
479
|
+
// lib/request/helpers/model-map.ts MODEL_PROFILES). Check before the generic
|
|
480
|
+
// gpt-5 catch-all, which would otherwise mis-bucket them as codex.
|
|
481
|
+
if (normalized.startsWith("gpt-5.6")) return "gpt-5.2";
|
|
478
482
|
if (normalized.startsWith("gpt-5.2")) return "gpt-5.2";
|
|
479
483
|
if (normalized.startsWith("gpt-5.1")) return "gpt-5.1";
|
|
480
484
|
if (normalized.includes("codex-max")) return "codex-max";
|
|
@@ -1160,7 +1164,7 @@ function canonicalizeRequestedModelName(model) {
|
|
|
1160
1164
|
return "";
|
|
1161
1165
|
}
|
|
1162
1166
|
|
|
1163
|
-
return stripped.replace(/-(none|minimal|low|medium|high|xhigh)$/i, "");
|
|
1167
|
+
return stripped.replace(/-(none|minimal|low|medium|high|xhigh|max|ultra)$/i, "");
|
|
1164
1168
|
}
|
|
1165
1169
|
|
|
1166
1170
|
function canonicalizeUnsupportedModelKey(model) {
|
|
@@ -1169,7 +1173,7 @@ function canonicalizeUnsupportedModelKey(model) {
|
|
|
1169
1173
|
if (!stripped) {
|
|
1170
1174
|
return "";
|
|
1171
1175
|
}
|
|
1172
|
-
return stripped.replace(/-(none|minimal|low|medium|high|xhigh)$/i, "");
|
|
1176
|
+
return stripped.replace(/-(none|minimal|low|medium|high|xhigh|max|ultra)$/i, "");
|
|
1173
1177
|
}
|
|
1174
1178
|
|
|
1175
1179
|
function extractUnsupportedModelFromOutput(output) {
|
|
@@ -1757,6 +1761,9 @@ function hasCliAuthCredentialsStoreOverride(args) {
|
|
|
1757
1761
|
// This wrapper runs before the TypeScript build, so it cannot import that source.
|
|
1758
1762
|
const SUPPORTED_REASONING_EFFORTS_BY_MODEL = {
|
|
1759
1763
|
[CURRENT_CODEX_MODEL]: ["low", "medium", "high", "xhigh"],
|
|
1764
|
+
"gpt-5.6-sol": ["low", "medium", "high", "xhigh", "max", "ultra"],
|
|
1765
|
+
"gpt-5.6-terra": ["low", "medium", "high", "xhigh", "max", "ultra"],
|
|
1766
|
+
"gpt-5.6-luna": ["low", "medium", "high", "xhigh", "max"],
|
|
1760
1767
|
"gpt-5.5": ["none", "low", "medium", "high", "xhigh"],
|
|
1761
1768
|
"gpt-5.5-pro": ["medium", "high", "xhigh"],
|
|
1762
1769
|
"gpt-5.4": ["none", "low", "medium", "high", "xhigh"],
|
|
@@ -1777,9 +1784,26 @@ const REASONING_FALLBACKS = {
|
|
|
1777
1784
|
medium: ["medium", "low", "high", "minimal", "none", "xhigh"],
|
|
1778
1785
|
high: ["high", "medium", "xhigh", "low", "minimal", "none"],
|
|
1779
1786
|
xhigh: ["xhigh", "high", "medium", "low", "minimal", "none"],
|
|
1787
|
+
// `max` and `ultra` arrived with GPT-5.6. Step down one rung at a time so a
|
|
1788
|
+
// request against a pre-5.6 model lands on that model's strongest tier.
|
|
1789
|
+
max: ["max", "xhigh", "high", "medium", "low", "minimal", "none"],
|
|
1790
|
+
ultra: ["ultra", "max", "xhigh", "high", "medium", "low", "minimal", "none"],
|
|
1780
1791
|
};
|
|
1781
1792
|
|
|
1782
1793
|
const KNOWN_REASONING_EFFORTS = new Set(Object.keys(REASONING_FALLBACKS));
|
|
1794
|
+
|
|
1795
|
+
// Effort suffixes generated as model aliases (e.g. `gpt-5.5-high`). This is the
|
|
1796
|
+
// pre-5.6 set only: `max`/`ultra` are NOT auto-aliased onto general models,
|
|
1797
|
+
// matching lib/request/helpers/model-map.ts `REASONING_VARIANTS`. GPT-5.6 tiers
|
|
1798
|
+
// register their own effort aliases explicitly via `addRequestedModelEffortAliases`.
|
|
1799
|
+
const REASONING_ALIAS_VARIANTS = [
|
|
1800
|
+
"none",
|
|
1801
|
+
"minimal",
|
|
1802
|
+
"low",
|
|
1803
|
+
"medium",
|
|
1804
|
+
"high",
|
|
1805
|
+
"xhigh",
|
|
1806
|
+
];
|
|
1783
1807
|
const REQUESTED_MODEL_ALIASES = new Map();
|
|
1784
1808
|
const DEFAULT_GENERAL_GPT5_MODEL = "gpt-5.5";
|
|
1785
1809
|
const GPT_5_5_CANONICAL_MODEL = "gpt-5.5";
|
|
@@ -1788,6 +1812,14 @@ const GPT_5_5_RELEASE_MODEL = "gpt-5.5-2026-04-23";
|
|
|
1788
1812
|
const GPT_5_5_PRO_RELEASE_MODEL = "gpt-5.5-pro-2026-04-23";
|
|
1789
1813
|
const GPT_5_5_RELEASE_COMPAT_MODEL = "gpt-5.5-20260423";
|
|
1790
1814
|
const GPT_5_5_PRO_RELEASE_COMPAT_MODEL = "gpt-5.5-pro-20260423";
|
|
1815
|
+
// GPT-5.6 tiers. Sol and Terra expose `ultra`; Luna stops at `max`. No tier
|
|
1816
|
+
// accepts `none`/`minimal`. Bare `gpt-5.6` aliases to the flagship (Sol).
|
|
1817
|
+
const GPT_5_6_SOL_MODEL = "gpt-5.6-sol";
|
|
1818
|
+
const GPT_5_6_TERRA_MODEL = "gpt-5.6-terra";
|
|
1819
|
+
const GPT_5_6_LUNA_MODEL = "gpt-5.6-luna";
|
|
1820
|
+
const GPT_5_6_FLAGSHIP_ALIAS = "gpt-5.6";
|
|
1821
|
+
const GPT_5_6_SOL_TERRA_EFFORTS = ["low", "medium", "high", "xhigh", "max", "ultra"];
|
|
1822
|
+
const GPT_5_6_LUNA_EFFORTS = ["low", "medium", "high", "xhigh", "max"];
|
|
1791
1823
|
const GENERAL_GPT5_VERSION_CATALOG = {
|
|
1792
1824
|
1: {
|
|
1793
1825
|
base: "gpt-5.1",
|
|
@@ -1823,7 +1855,17 @@ function addRequestedModelAlias(alias, normalizedModel) {
|
|
|
1823
1855
|
|
|
1824
1856
|
function addRequestedModelReasoningAliases(alias, normalizedModel) {
|
|
1825
1857
|
addRequestedModelAlias(alias, normalizedModel);
|
|
1826
|
-
for (const effort of
|
|
1858
|
+
for (const effort of REASONING_ALIAS_VARIANTS) {
|
|
1859
|
+
addRequestedModelAlias(`${alias}-${effort}`, normalizedModel);
|
|
1860
|
+
}
|
|
1861
|
+
}
|
|
1862
|
+
|
|
1863
|
+
// Register a model plus one alias per effort it actually supports. Unlike
|
|
1864
|
+
// `addRequestedModelReasoningAliases`, this does not assume the pre-5.6 variant
|
|
1865
|
+
// list: GPT-5.6 rejects `none`/`minimal` and only Sol/Terra accept `ultra`.
|
|
1866
|
+
function addRequestedModelEffortAliases(alias, normalizedModel, efforts) {
|
|
1867
|
+
addRequestedModelAlias(alias, normalizedModel);
|
|
1868
|
+
for (const effort of efforts) {
|
|
1827
1869
|
addRequestedModelAlias(`${alias}-${effort}`, normalizedModel);
|
|
1828
1870
|
}
|
|
1829
1871
|
}
|
|
@@ -1961,6 +2003,26 @@ function seedRequestedModelAliases() {
|
|
|
1961
2003
|
addRequestedModelReasoningAliases("gpt-5-nano", "gpt-5-nano");
|
|
1962
2004
|
addRequestedModelReasoningAliases("gpt-5.1-chat-latest", "gpt-5.1");
|
|
1963
2005
|
addRequestedModelReasoningAliases("gpt-5-chat-latest", DEFAULT_GENERAL_GPT5_MODEL);
|
|
2006
|
+
addRequestedModelEffortAliases(
|
|
2007
|
+
GPT_5_6_SOL_MODEL,
|
|
2008
|
+
GPT_5_6_SOL_MODEL,
|
|
2009
|
+
GPT_5_6_SOL_TERRA_EFFORTS,
|
|
2010
|
+
);
|
|
2011
|
+
addRequestedModelEffortAliases(
|
|
2012
|
+
GPT_5_6_TERRA_MODEL,
|
|
2013
|
+
GPT_5_6_TERRA_MODEL,
|
|
2014
|
+
GPT_5_6_SOL_TERRA_EFFORTS,
|
|
2015
|
+
);
|
|
2016
|
+
addRequestedModelEffortAliases(
|
|
2017
|
+
GPT_5_6_LUNA_MODEL,
|
|
2018
|
+
GPT_5_6_LUNA_MODEL,
|
|
2019
|
+
GPT_5_6_LUNA_EFFORTS,
|
|
2020
|
+
);
|
|
2021
|
+
addRequestedModelEffortAliases(
|
|
2022
|
+
GPT_5_6_FLAGSHIP_ALIAS,
|
|
2023
|
+
GPT_5_6_SOL_MODEL,
|
|
2024
|
+
GPT_5_6_SOL_TERRA_EFFORTS,
|
|
2025
|
+
);
|
|
1964
2026
|
addRequestedModelReasoningAliases(CURRENT_CODEX_MODEL, CURRENT_CODEX_MODEL);
|
|
1965
2027
|
addRequestedModelReasoningAliases("gpt-5.3-codex-spark", CURRENT_CODEX_MODEL);
|
|
1966
2028
|
addRequestedModelReasoningAliases(LEGACY_CODEX_MODEL, CURRENT_CODEX_MODEL);
|
|
@@ -2052,6 +2114,25 @@ function resolveCodexRequestedModel(normalized) {
|
|
|
2052
2114
|
return "";
|
|
2053
2115
|
}
|
|
2054
2116
|
|
|
2117
|
+
// Resolve GPT-5.6 identifiers, including ones that are not exact aliases (e.g. a
|
|
2118
|
+
// future `gpt-5.6-terra-fast`). Without this the general GPT-5 resolver sees
|
|
2119
|
+
// minor `6`, finds no catalog entry, and silently falls back to 5.5. Unknown
|
|
2120
|
+
// tiers resolve to Sol, matching OpenAI's bare `gpt-5.6` alias.
|
|
2121
|
+
function resolveGpt56RequestedModel(stripped) {
|
|
2122
|
+
const tokens = tokenizeRequestedModel(stripped);
|
|
2123
|
+
const gptIndex = tokens.indexOf("gpt");
|
|
2124
|
+
const isGpt56 =
|
|
2125
|
+
gptIndex !== -1 &&
|
|
2126
|
+
tokens[gptIndex + 1] === "5" &&
|
|
2127
|
+
tokens[gptIndex + 2] === "6";
|
|
2128
|
+
if (!isGpt56 || tokens.includes("codex")) {
|
|
2129
|
+
return "";
|
|
2130
|
+
}
|
|
2131
|
+
if (tokens.includes("terra")) return GPT_5_6_TERRA_MODEL;
|
|
2132
|
+
if (tokens.includes("luna")) return GPT_5_6_LUNA_MODEL;
|
|
2133
|
+
return GPT_5_6_SOL_MODEL;
|
|
2134
|
+
}
|
|
2135
|
+
|
|
2055
2136
|
function resolveGeneralGpt5RequestedModel(stripped) {
|
|
2056
2137
|
const tokens = tokenizeRequestedModel(stripped);
|
|
2057
2138
|
const gptIndex = tokens.indexOf("gpt");
|
|
@@ -2100,6 +2181,11 @@ function normalizeRequestedModel(model) {
|
|
|
2100
2181
|
return codexModel;
|
|
2101
2182
|
}
|
|
2102
2183
|
|
|
2184
|
+
const gpt56Model = resolveGpt56RequestedModel(stripped);
|
|
2185
|
+
if (gpt56Model) {
|
|
2186
|
+
return gpt56Model;
|
|
2187
|
+
}
|
|
2188
|
+
|
|
2103
2189
|
const generalModel = resolveGeneralGpt5RequestedModel(stripped);
|
|
2104
2190
|
if (generalModel) {
|
|
2105
2191
|
return generalModel;
|
|
@@ -2108,16 +2194,7 @@ function normalizeRequestedModel(model) {
|
|
|
2108
2194
|
return "";
|
|
2109
2195
|
}
|
|
2110
2196
|
|
|
2111
|
-
function
|
|
2112
|
-
if (typeof effort !== "string") return effort;
|
|
2113
|
-
const normalizedEffort = effort.trim().toLowerCase();
|
|
2114
|
-
if (!KNOWN_REASONING_EFFORTS.has(normalizedEffort)) {
|
|
2115
|
-
return effort;
|
|
2116
|
-
}
|
|
2117
|
-
|
|
2118
|
-
const normalizedModel = normalizeRequestedModel(model);
|
|
2119
|
-
const supportedEfforts =
|
|
2120
|
-
SUPPORTED_REASONING_EFFORTS_BY_MODEL[normalizedModel] ?? null;
|
|
2197
|
+
function resolveSupportedReasoningEffort(normalizedEffort, supportedEfforts) {
|
|
2121
2198
|
if (!supportedEfforts || supportedEfforts.includes(normalizedEffort)) {
|
|
2122
2199
|
return normalizedEffort;
|
|
2123
2200
|
}
|
|
@@ -2132,6 +2209,27 @@ function coerceReasoningEffortForModel(model, effort) {
|
|
|
2132
2209
|
return normalizedEffort;
|
|
2133
2210
|
}
|
|
2134
2211
|
|
|
2212
|
+
function coerceReasoningEffortForModel(model, effort) {
|
|
2213
|
+
if (typeof effort !== "string") return effort;
|
|
2214
|
+
const normalizedEffort = effort.trim().toLowerCase();
|
|
2215
|
+
if (!KNOWN_REASONING_EFFORTS.has(normalizedEffort)) {
|
|
2216
|
+
return effort;
|
|
2217
|
+
}
|
|
2218
|
+
|
|
2219
|
+
const normalizedModel = normalizeRequestedModel(model);
|
|
2220
|
+
const supportedEfforts =
|
|
2221
|
+
SUPPORTED_REASONING_EFFORTS_BY_MODEL[normalizedModel] ?? null;
|
|
2222
|
+
const resolved = resolveSupportedReasoningEffort(
|
|
2223
|
+
normalizedEffort,
|
|
2224
|
+
supportedEfforts,
|
|
2225
|
+
);
|
|
2226
|
+
|
|
2227
|
+
// `ultra` is a client-side tier: Codex rewrites it to `max` before the
|
|
2228
|
+
// request leaves the client, so it must never reach the wire. Mirror
|
|
2229
|
+
// lib/request/helpers/model-map.ts / request-transformer's getReasoningConfig.
|
|
2230
|
+
return resolved === "ultra" ? "max" : resolved;
|
|
2231
|
+
}
|
|
2232
|
+
|
|
2135
2233
|
function extractRequestedModel(args) {
|
|
2136
2234
|
for (let i = 0; i < args.length; i += 1) {
|
|
2137
2235
|
const arg = args[i];
|
|
@@ -4959,5 +5057,21 @@ async function main() {
|
|
|
4959
5057
|
}
|
|
4960
5058
|
}
|
|
4961
5059
|
|
|
4962
|
-
|
|
4963
|
-
|
|
5060
|
+
// Model-resolution internals, exported for unit tests. Kept in sync with
|
|
5061
|
+
// lib/request/helpers/model-map.ts (see test/codex-model-resolution.test.ts,
|
|
5062
|
+
// which asserts wrapper<->lib parity).
|
|
5063
|
+
export {
|
|
5064
|
+
normalizeRequestedModel,
|
|
5065
|
+
coerceReasoningEffortForModel,
|
|
5066
|
+
resolveModelFamilyForStatus,
|
|
5067
|
+
canonicalizeRequestedModelName,
|
|
5068
|
+
};
|
|
5069
|
+
|
|
5070
|
+
// Run the wrapper only when actually launched (as the `codex-multi-auth-codex`
|
|
5071
|
+
// bin). Tests set CODEX_MULTI_AUTH_WRAPPER_IMPORT_ONLY to import the module for
|
|
5072
|
+
// its exported helpers without forwarding to the real Codex CLI. The flag is
|
|
5073
|
+
// never set in production, so bin launches are unaffected.
|
|
5074
|
+
if (!process.env.CODEX_MULTI_AUTH_WRAPPER_IMPORT_ONLY) {
|
|
5075
|
+
const exitCode = await main();
|
|
5076
|
+
process.exitCode = normalizeExitCode(exitCode);
|
|
5077
|
+
}
|