@henryqw/pi-multi-codex 3.1.1 → 3.1.2

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.
Files changed (2) hide show
  1. package/README.md +14 -14
  2. package/package.json +1 -1
package/README.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # `@henryqw/pi-multi-codex`
2
2
 
3
- Add multiple ChatGPT Codex OAuth accounts and start Pi work on the eligible slot with the most weekly quota. The extension switches away from active five-hour blocks and can retry an HTTP 429 on another eligible slot.
3
+ Add multiple ChatGPT Codex OAuth accounts and start Pi work on the eligible 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 slot.
4
4
 
5
5
  ![Pi showing Codex account quotas and the active footer slot](./example.png)
6
6
  ![Flowchart separating fresh-quota startup ranking from broader HTTP 429 failover](./docs/codex-routing-flow.svg)
@@ -11,42 +11,42 @@ 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
- Requires Pi 1.1.0 or later in the 1.x series.
14
+ This package requires Pi 1.1.0 or later in the 1.x series.
15
15
 
16
16
  ## Works with
17
17
 
18
18
  | Package | Relationship | Purpose |
19
19
  | --- | --- | --- |
20
- | [`@henryqw/pi-footer`](https://pi.henry.wang/extensions/pi-footer) | Improves | Shows the active slot's quota or five-hour block in the footer. |
20
+ | [`@henryqw/pi-footer`](https://pi.henry.wang/extensions/pi-footer) | Improves | Shows the remaining quota or five-hour quota block of the active slot in the footer. |
21
21
  | [`@henryqw/pi-subagent`](https://pi.henry.wang/extensions/pi-subagent) | Improves | Isolated children keep Main's active Codex slot. |
22
22
  | [`@henryqw/pi-task-models`](https://pi.henry.wang/extensions/pi-task-models) | Improves | Numbered slots share one profile route. |
23
23
 
24
24
  ## Use
25
25
 
26
- Run `/login` and authenticate `OpenAI Codex (legacy)` for slot 1 first. Run `/codex-add`, then run `/login` and select the new `OpenAI Codex #<n>` provider. Restart Pi or update model scope, then run `/codex-status`. The status lists the new slot with cached quota when available, or `unavailable` until the first successful snapshot.
26
+ First, run `/login` and authenticate `OpenAI Codex (legacy)` for slot 1. Run `/codex-add`. Then run `/login` and select the new `OpenAI Codex #<n>` provider. Restart Pi or update model scope. Then run `/codex-status`. The status lists the new slot with cached quota when available, or `unavailable` until the first successful usage snapshot.
27
27
 
28
28
  | Surface | Type | Purpose |
29
29
  | --- | --- | --- |
30
30
  | `/codex-add` | command | For people: create the next numbered slot, then authenticate that slot. |
31
- | `/codex-status` | command | For people: show shared quota snapshots and five-hour blocks; never waits on network. |
31
+ | `/codex-status` | command | For people: show shared usage snapshots and five-hour quota blocks. It never waits on the network. |
32
32
  | `/codex-switch` | command | For people: select an authenticated, scope-allowed slot for the current Codex model. |
33
33
  | Pi model selector (`OpenAI Codex (legacy)`, `OpenAI Codex #<n>`) | ui | Choose an authenticated account slot. |
34
- | Pi status `pi-multi-codex` | ui | Report the active slot's fresh quota, five-hour limit countdown, or stale/unavailable state; `@henryqw/pi-footer` displays it in the footer. |
34
+ | Pi status `pi-multi-codex` | ui | Report the active slot's fresh quota, five-hour limit countdown, or stale/unavailable state. `@henryqw/pi-footer` displays it in the footer. |
35
35
 
36
36
  The footer and `/codex-status` show the five-hour reset countdown for Free, Go, and Plus tiers. They show the seven-day reset countdown for Pro Lite and other tiers. A numbered slot is one Codex account position in Pi.
37
37
 
38
38
  ## Flow
39
39
 
40
- - Before the first agent start, only fresh quota snapshots enter startup ranking. The slot with the most seven-day quota wins.
40
+ - Before the first agent start, only fresh usage snapshots enter startup ranking. The 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 block switches to the eligible fresh slot with the most seven-day quota.
42
+ - Before later agent starts, a known active five-hour quota block switches to the eligible fresh slot with the most remaining quota.
43
43
  - After HTTP 429, failover can use authenticated, registered, scope-allowed, untried slots with stale or missing quota.
44
- - Failover skips known active five-hour blocks. It ranks fresh known quota first, then unranked slots by slot number.
44
+ - Failover skips known active five-hour quota blocks. It ranks fresh known quota first, then unranked slots by slot number.
45
45
  - Routing preserves the model ID.
46
46
  - Only physical Codex models are slots. A virtual model listed under `openai-codex`, such as `openai-codex/auto`, is never routed to a slot and shows no quota status.
47
- - During one agent run, each eligible slot is tried at most once after HTTP 429 responses.
47
+ - During one agent run, each eligible slot is tried at most one time after HTTP 429 responses.
48
48
  - Automatic retry stops when no untried eligible slot remains.
49
- - The footer shows the active slot's fresh quota or five-hour block.
49
+ - The footer shows the fresh quota or five-hour quota block of the active slot.
50
50
 
51
51
  ## Config
52
52
 
@@ -56,14 +56,14 @@ 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` when the config file is missing |
58
58
 
59
- Edit this file yourself; the extension does not create or write it. A missing file uses the default `true`, and config changes take effect at the next session start. Set `autoSwitchOn429` to `false` to disable automatic switching. A present config must contain only this field as a boolean. Invalid config is preserved, warns, and disables automatic switching for the session. Fix the file and start a new session to recover.
59
+ Edit this file yourself. The extension does not create or write it. A missing file uses the default `true`, and config changes take effect at the next session start. Set `autoSwitchOn429` to `false` to disable automatic switching. A present config must contain only this field as a boolean. If the config is invalid, the extension keeps the file, shows a warning, and disables automatic switching for the session. Fix the file and start a new session to recover.
60
60
 
61
61
  ## State and storage
62
62
 
63
- The extension maintains a generated, credential-free quota cache at `~/.pi/agent/config/pi-multi-codex/usage.json`.
63
+ The extension keeps a generated, credential-free quota cache at `~/.pi/agent/config/pi-multi-codex/usage.json`.
64
64
 
65
65
  ## Limits and recovery
66
66
 
67
- The extension reads `auth.json` to identify account slots but does not directly edit credentials. When it asks Pi's auth resolver for a token to check quota, Pi may refresh expired OAuth credentials and update its auth store.
67
+ The extension reads `auth.json` to identify account slots but does not directly edit credentials. When it asks Pi's auth resolver for a token to check quota, Pi can refresh expired OAuth credentials and update its auth store.
68
68
 
69
69
  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.1.1",
3
+ "version": "3.1.2",
4
4
  "description": "Use multiple ChatGPT Codex OAuth accounts in Pi.",
5
5
  "keywords": [
6
6
  "pi-package",