@henryqw/pi-multi-codex 3.1.3 → 3.2.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/README.md +18 -14
- package/package.json +5 -5
package/README.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# `@henryqw/pi-multi-codex`
|
|
2
2
|
|
|
3
|
-
Add multiple ChatGPT Codex OAuth accounts
|
|
3
|
+
Add multiple ChatGPT Codex OAuth accounts. Start Pi work on the eligible account slot with the most remaining quota. The extension switches away from active five-hour quota blocks and can retry an HTTP 429 on another eligible account slot.
|
|
4
4
|
|
|
5
5
|

|
|
6
6
|

|
|
@@ -11,8 +11,6 @@ Add multiple ChatGPT Codex OAuth accounts and start Pi work on the eligible slot
|
|
|
11
11
|
pi install npm:@henryqw/pi-multi-codex
|
|
12
12
|
```
|
|
13
13
|
|
|
14
|
-
This package requires Pi 1.1.0 or later in the 1.x series.
|
|
15
|
-
|
|
16
14
|
## Works with
|
|
17
15
|
|
|
18
16
|
| Package | Relationship | Purpose |
|
|
@@ -23,7 +21,9 @@ This package requires Pi 1.1.0 or later in the 1.x series.
|
|
|
23
21
|
|
|
24
22
|
## Use
|
|
25
23
|
|
|
26
|
-
|
|
24
|
+
Run `/login`. Authenticate `OpenAI Codex (legacy)` for account slot 1. Run `/codex-add`.
|
|
25
|
+
|
|
26
|
+
Run `/login` again. Select the new `OpenAI Codex #<n>` provider. Restart Pi or update model scope. Then run `/codex-status`. The status lists the new account slot with cached quota when available. It shows `unavailable` until the first successful usage snapshot.
|
|
27
27
|
|
|
28
28
|
| Surface | Type | Purpose |
|
|
29
29
|
| --- | --- | --- |
|
|
@@ -37,16 +37,16 @@ The footer and `/codex-status` show the five-hour reset countdown for Free, Go,
|
|
|
37
37
|
|
|
38
38
|
## Flow
|
|
39
39
|
|
|
40
|
-
- Before the first agent start, only fresh usage snapshots
|
|
40
|
+
- Before the first agent start, ranking uses only fresh usage snapshots. The account slot with the most remaining quota wins.
|
|
41
41
|
- An explicit model selection always wins for the next agent start.
|
|
42
|
-
- Before later agent starts, a known active five-hour quota block switches to the eligible
|
|
43
|
-
- After HTTP 429, failover can use authenticated, registered, scope-allowed
|
|
44
|
-
- Failover skips known active five-hour quota blocks. It ranks fresh known quota first
|
|
42
|
+
- Before later agent starts, the extension checks for a known active five-hour quota block. If it finds one, it switches to the eligible account slot with a fresh usage snapshot and the most remaining quota.
|
|
43
|
+
- After HTTP 429, failover can use authenticated, registered, scope-allowed account slots that it has not tried. These slots can have stale or missing quota.
|
|
44
|
+
- Failover skips known active five-hour quota blocks. It ranks fresh known quota first. Then it ranks the remaining slots by slot number.
|
|
45
45
|
- Routing preserves the model ID.
|
|
46
|
-
- Only physical Codex models are slots.
|
|
47
|
-
- During one agent run, each eligible slot
|
|
48
|
-
- Automatic retry stops when
|
|
49
|
-
- The footer shows the fresh quota or five-hour quota block of the active slot.
|
|
46
|
+
- Only physical Codex models are account slots. The extension never routes a virtual model under `openai-codex`, such as `openai-codex/auto`, to an account slot. It shows no quota status for a virtual model.
|
|
47
|
+
- During one agent run, the extension tries each eligible account slot at most one time after HTTP 429 responses.
|
|
48
|
+
- Automatic retry stops when the extension has tried all eligible account slots.
|
|
49
|
+
- The footer shows the fresh quota or five-hour quota block of the active account slot.
|
|
50
50
|
|
|
51
51
|
## Config
|
|
52
52
|
|
|
@@ -56,7 +56,11 @@ Package-owned: `~/.pi/agent/config/pi-multi-codex/config.json`
|
|
|
56
56
|
| --- | --- | --- | --- |
|
|
57
57
|
| `autoSwitchOn429` | Switches to another eligible slot after an HTTP 429. | Boolean. | `true` |
|
|
58
58
|
|
|
59
|
-
Edit this file yourself. The extension does not create or write it.
|
|
59
|
+
Edit this file yourself. The extension does not create or write it. If the file is missing, the extension uses the default `true`. Config changes take effect at the next session start. Set `autoSwitchOn429` to `false` to disable automatic switching.
|
|
60
|
+
|
|
61
|
+
At session start, the extension warns about unknown keys, malformed JSON, or values that are not booleans. The warning includes the file path. The extension ignores unknown keys.
|
|
62
|
+
|
|
63
|
+
Automatic switching stays off for the session if `autoSwitchOn429` is not a boolean or has incorrect spelling, such as `autoswitchOn429`. Switching also stays off for malformed JSON, invalid UTF-8, files larger than 64 KiB, read errors, or a non-object root. The extension keeps the file unchanged. Fix the file. Then start a new session to recover.
|
|
60
64
|
|
|
61
65
|
## State and storage
|
|
62
66
|
|
|
@@ -64,6 +68,6 @@ The extension keeps a generated, credential-free quota cache at `~/.pi/agent/con
|
|
|
64
68
|
|
|
65
69
|
## Limits and recovery
|
|
66
70
|
|
|
67
|
-
The extension reads `auth.json` to identify account slots
|
|
71
|
+
The extension reads `auth.json` to identify account slots. It does not directly edit credentials. It asks Pi's auth resolver for a token to check quota. Pi can then refresh expired OAuth credentials and update its auth store.
|
|
68
72
|
|
|
69
73
|
Scoped sessions can switch only to exact scoped aliases.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@henryqw/pi-multi-codex",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.2.0",
|
|
4
4
|
"description": "Use multiple ChatGPT Codex OAuth accounts in Pi.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"pi-package",
|
|
@@ -26,8 +26,8 @@
|
|
|
26
26
|
"pack:check": "npm pack --dry-run"
|
|
27
27
|
},
|
|
28
28
|
"peerDependencies": {
|
|
29
|
-
"@earendil-works/pi-ai": "^1.
|
|
30
|
-
"@earendil-works/pi-coding-agent": "^1.
|
|
29
|
+
"@earendil-works/pi-ai": "^1.3.0",
|
|
30
|
+
"@earendil-works/pi-coding-agent": "^1.3.0"
|
|
31
31
|
},
|
|
32
32
|
"repository": {
|
|
33
33
|
"type": "git",
|
|
@@ -51,8 +51,8 @@
|
|
|
51
51
|
"proper-lockfile": "^4.1.2"
|
|
52
52
|
},
|
|
53
53
|
"devDependencies": {
|
|
54
|
-
"@earendil-works/pi-ai": "1.
|
|
55
|
-
"@earendil-works/pi-coding-agent": "1.
|
|
54
|
+
"@earendil-works/pi-ai": "1.3.0",
|
|
55
|
+
"@earendil-works/pi-coding-agent": "1.3.0",
|
|
56
56
|
"@types/proper-lockfile": "^4.1.4"
|
|
57
57
|
}
|
|
58
58
|
}
|