Skip to content

Commit e5ea183

Browse files
authored
Merge pull request #318 from ndycode/release/mainbound-20260323
release: merge current main-target PR set
2 parents 1be5e95 + 16e09d1 commit e5ea183

File tree

316 files changed

+43473
-11894
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

316 files changed

+43473
-11894
lines changed

.github/workflows/pr-ci.yml

Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,3 +49,61 @@ jobs:
4949

5050
- name: Build
5151
run: npm run build
52+
53+
- name: Typecheck scripts
54+
run: npm run typecheck:scripts
55+
56+
- name: Pack budget check
57+
run: npm run pack:check
58+
59+
- name: Verify vendor provenance
60+
run: npm run vendor:verify
61+
62+
node22-smoke:
63+
name: Node 22 Smoke
64+
runs-on: ubuntu-latest
65+
66+
steps:
67+
- name: Checkout code
68+
uses: actions/checkout@v4
69+
70+
- name: Setup Node.js
71+
uses: actions/setup-node@v4
72+
with:
73+
node-version: 22.x
74+
cache: npm
75+
76+
- name: Install dependencies
77+
run: npm ci
78+
79+
- name: Run type check
80+
run: npm run typecheck
81+
82+
- name: Run tests
83+
run: npm test
84+
85+
- name: Security audit (CI policy)
86+
run: npm run audit:ci
87+
88+
- name: Build
89+
run: npm run build
90+
91+
scripts-windows:
92+
name: Script Typecheck (Windows)
93+
runs-on: windows-latest
94+
95+
steps:
96+
- name: Checkout code
97+
uses: actions/checkout@v4
98+
99+
- name: Setup Node.js
100+
uses: actions/setup-node@v4
101+
with:
102+
node-version: 20.x
103+
cache: npm
104+
105+
- name: Install dependencies
106+
run: npm ci
107+
108+
- name: Typecheck scripts
109+
run: npm run typecheck:scripts

README.md

Lines changed: 49 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -62,8 +62,11 @@ npm i -g codex-multi-auth
6262

6363
### Option C: Verify wiring
6464

65+
`codex --version` confirms the official Codex CLI is reachable. `codex-multi-auth --version` confirms the installed wrapper package version.
66+
6567
```bash
6668
codex --version
69+
codex-multi-auth --version
6770
codex auth status
6871
```
6972

@@ -93,54 +96,65 @@ codex auth check
9396

9497
## Quick Start
9598

99+
Install and sign in:
100+
96101
```bash
102+
npm i -g @openai/codex
103+
npm i -g codex-multi-auth
97104
codex auth login
105+
```
106+
107+
Verify the wrapper and the new account:
108+
109+
```bash
98110
codex auth status
99111
codex auth check
100-
codex auth forecast --live
101112
```
102113

103-
Day-1 command set:
114+
Use these next:
104115

105116
```bash
117+
codex auth list
106118
codex auth switch 2
107-
codex auth report --live --json
108-
codex auth fix --dry-run
109-
codex auth doctor --fix
119+
codex auth forecast --live
110120
```
111121

112-
If the shell should not launch a browser, use the manual callback flow:
122+
If browser launch is blocked, use the alternate login paths in [docs/getting-started.md](docs/getting-started.md#alternate-login-paths).
113123

114-
```bash
115-
codex auth login --manual
116-
CODEX_AUTH_NO_BROWSER=1 codex auth login
117-
```
124+
---
118125

119-
In non-TTY/manual shells, provide the full redirect URL on stdin instead of waiting for a browser callback:
126+
## Command Toolkit
120127

121-
```bash
122-
echo "http://127.0.0.1:1455/auth/callback?code=..." | codex auth login --manual
123-
```
128+
### Start here
124129

125-
No new npm scripts or storage migration steps are required for this login-flow update.
130+
| Command | What it answers |
131+
| --- | --- |
132+
| `codex auth login` | How do I add or re-open the account menu? |
133+
| `codex auth status` | Is the wrapper active right now? |
134+
| `codex auth check` | Do my saved accounts look healthy? |
126135

127-
---
136+
### Daily use
128137

129-
## Command Toolkit
138+
| Command | What it answers |
139+
| --- | --- |
140+
| `codex auth list` | Which accounts are saved and which one is active? |
141+
| `codex auth switch <index>` | How do I move to a different saved account? |
142+
| `codex auth forecast --live` | Which account looks best for the next session? |
130143

131-
| Command | What it does |
144+
### Repair
145+
146+
| Command | What it answers |
132147
| --- | --- |
133-
| `codex auth login` | Open interactive account dashboard |
134-
| `codex auth list` | List saved accounts and active account |
135-
| `codex auth status` | Print short runtime/status summary |
136-
| `codex auth switch <index>` | Set active account by index |
137-
| `codex auth check` | Run quick account health checks |
138-
| `codex auth verify-flagged` | Re-test flagged accounts and optionally restore |
139-
| `codex auth forecast --live` | Forecast best next account with live probes |
140-
| `codex auth report --live --json` | Generate machine-readable health report |
141-
| `codex auth fix --dry-run` | Preview safe repairs |
142-
| `codex auth fix --live --model gpt-5-codex` | Run repairs with live probe model |
143-
| `codex auth doctor --fix` | Diagnose and apply safe fixes |
148+
| `codex auth verify-flagged` | Can any previously flagged account be restored? |
149+
| `codex auth fix --dry-run` | What safe storage or account repairs are available? |
150+
| `codex auth doctor --fix` | Can the CLI diagnose and apply the safest fixes now? |
151+
152+
### Advanced
153+
154+
| Command | What it answers |
155+
| --- | --- |
156+
| `codex auth report --live --json` | How do I get the full machine-readable health report? |
157+
| `codex auth fix --live --model gpt-5-codex` | How do I run live repair probes with a chosen model? |
144158

145159
---
146160

@@ -199,6 +213,7 @@ Selected runtime/environment overrides:
199213
| `CODEX_TUI_V2=0/1` | Disable/enable TUI v2 |
200214
| `CODEX_TUI_COLOR_PROFILE=truecolor|ansi256|ansi16` | TUI color profile |
201215
| `CODEX_TUI_GLYPHS=ascii|unicode|auto` | TUI glyph style |
216+
| `CODEX_AUTH_BACKGROUND_RESPONSES=0/1` | Opt in/out of stateful Responses `background: true` compatibility |
202217
| `CODEX_AUTH_FETCH_TIMEOUT_MS=<ms>` | Request timeout override |
203218
| `CODEX_AUTH_STREAM_STALL_TIMEOUT_MS=<ms>` | Stream stall timeout override |
204219

@@ -210,6 +225,8 @@ codex auth check
210225
codex auth forecast --live
211226
```
212227

228+
Responses background mode stays opt-in. Enable `backgroundResponses` in settings or `CODEX_AUTH_BACKGROUND_RESPONSES=1` only for callers that intentionally send `background: true`, because those requests switch from stateless `store=false` routing to stateful `store=true`. See [docs/upgrade.md](docs/upgrade.md) for rollout guidance.
229+
213230
---
214231

215232
## Experimental Settings Highlights
@@ -291,9 +308,9 @@ codex auth doctor --json
291308

292309
## Release Notes
293310

294-
- Current stable: [docs/releases/v1.2.0.md](docs/releases/v1.2.0.md)
295-
- Previous stable: [docs/releases/v1.1.10.md](docs/releases/v1.1.10.md)
296-
- Earlier stable: [docs/releases/v0.1.9.md](docs/releases/v0.1.9.md)
311+
- Current stable: [docs/releases/v1.1.10.md](docs/releases/v1.1.10.md)
312+
- Previous stable: [docs/releases/v0.1.9.md](docs/releases/v0.1.9.md)
313+
- Earlier stable: [docs/releases/v0.1.8.md](docs/releases/v0.1.8.md)
297314
- Archived prerelease: [docs/releases/v0.1.0-beta.0.md](docs/releases/v0.1.0-beta.0.md)
298315

299316
## License

docs/README.md

Lines changed: 25 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -7,35 +7,41 @@ Public documentation for `codex-multi-auth`.
77
## Start Here
88

99
1. [Getting Started](getting-started.md)
10-
2. [FAQ](faq.md)
11-
3. [Architecture](architecture.md)
10+
2. [Daily-use landing page](index.md)
11+
3. [FAQ](faq.md)
1212
4. [Troubleshooting](troubleshooting.md)
1313

1414
---
1515

16-
## User Guides
16+
## Daily Use
1717

1818
| Document | Focus |
1919
| --- | --- |
20-
| [index.md](index.md) | Daily-use landing page for common `codex auth ...` workflows |
21-
| [getting-started.md](getting-started.md) | Install, first login, and first health check |
20+
| [Daily-use landing page](index.md) | Common `codex auth ...` workflows and quick-start guidance |
2221
| [faq.md](faq.md) | Short answers to common adoption questions |
23-
| [architecture.md](architecture.md) | Public system overview of the wrapper, storage, and optional plugin runtime |
2422
| [features.md](features.md) | User-facing capability map |
2523
| [configuration.md](configuration.md) | Stable defaults, precedence, and environment overrides |
26-
| [troubleshooting.md](troubleshooting.md) | Recovery playbooks for install, login, switching, and stale state |
24+
| [architecture.md](architecture.md) | Public system overview of the wrapper, storage, and optional plugin runtime |
2725
| [privacy.md](privacy.md) | Data handling and local storage behavior |
28-
| [upgrade.md](upgrade.md) | Migration from legacy package and path history |
29-
| [releases/v1.2.0.md](releases/v1.2.0.md) | Stable release notes |
30-
| [releases/v1.1.10.md](releases/v1.1.10.md) | Previous stable release notes |
31-
| [releases/v0.1.9.md](releases/v0.1.9.md) | Earlier stable release notes |
26+
| [releases/v1.1.10.md](releases/v1.1.10.md) | Stable release notes |
27+
| [releases/v0.1.9.md](releases/v0.1.9.md) | Previous stable release notes |
28+
| [releases/v0.1.8.md](releases/v0.1.8.md) | Earlier stable release notes |
3229
| [releases/v0.1.7.md](releases/v0.1.7.md) | Archived stable release notes |
3330
| [releases/v0.1.6.md](releases/v0.1.6.md) | Archived stable release notes |
3431
| [releases/v0.1.5.md](releases/v0.1.5.md) | Archived stable release notes |
3532
| [releases/v0.1.0-beta.0.md](releases/v0.1.0-beta.0.md) | Archived prerelease notes |
3633

3734
---
3835

36+
## Repair
37+
38+
| Document | Focus |
39+
| --- | --- |
40+
| [troubleshooting.md](troubleshooting.md) | Recovery playbooks for install, login, switching, and stale state |
41+
| [upgrade.md](upgrade.md) | Migration from legacy package and path history |
42+
43+
---
44+
3945
## Reference
4046

4147
| Document | Focus |
@@ -45,9 +51,9 @@ Public documentation for `codex-multi-auth`.
4551
| [reference/storage-paths.md](reference/storage-paths.md) | Canonical and compatibility storage paths |
4652
| [reference/public-api.md](reference/public-api.md) | Public API stability and semver contract |
4753
| [reference/error-contracts.md](reference/error-contracts.md) | CLI, JSON, and helper error semantics |
48-
| [releases/v1.2.0.md](releases/v1.2.0.md) | Current stable release notes |
54+
| [releases/v1.1.10.md](releases/v1.1.10.md) | Current stable release notes |
4955
| [releases/v0.1.0-beta.0.md](releases/v0.1.0-beta.0.md) | Archived prerelease reference |
50-
| [User Guides release notes](#user-guides) | Stable, previous, and archived release notes |
56+
| [Daily Use release notes](#daily-use) | Stable, previous, and archived release notes |
5157
| [releases/legacy-pre-0.1-history.md](releases/legacy-pre-0.1-history.md) | Archived pre-0.1 changelog history |
5258

5359
---
@@ -62,7 +68,13 @@ Public documentation for `codex-multi-auth`.
6268
| [development/IA_FINDABILITY_AUDIT_2026-03-01.md](development/IA_FINDABILITY_AUDIT_2026-03-01.md) | IA and findability baseline audit |
6369
| [development/CONFIG_FIELDS.md](development/CONFIG_FIELDS.md) | Complete field and environment inventory |
6470
| [development/CONFIG_FLOW.md](development/CONFIG_FLOW.md) | Configuration resolution flow |
71+
| [development/RUNBOOK_ADD_AUTH_COMMAND.md](development/RUNBOOK_ADD_AUTH_COMMAND.md) | Safe workflow for adding a new `codex auth ...` command |
72+
| [development/RUNBOOK_ADD_CONFIG_FIELD.md](development/RUNBOOK_ADD_CONFIG_FIELD.md) | Safe workflow for introducing a new config field |
73+
| [development/RUNBOOK_CHANGE_ROUTING_POLICY.md](development/RUNBOOK_CHANGE_ROUTING_POLICY.md) | Safe workflow for changing routing, retry, or fallback policy |
6574
| [development/REPOSITORY_SCOPE.md](development/REPOSITORY_SCOPE.md) | Ownership map by repository path |
75+
| [development/RUNBOOK_ADD_AUTH_MANAGER_COMMAND.md](development/RUNBOOK_ADD_AUTH_MANAGER_COMMAND.md) | Safe workflow for adding a new `codex auth` command |
76+
| [development/RUNBOOK_ADD_CONFIG_FIELD_SAFELY.md](development/RUNBOOK_ADD_CONFIG_FIELD_SAFELY.md) | Safe workflow for introducing a new config/settings field |
77+
| [development/RUNBOOK_CHANGE_ROUTING_POLICY_SAFELY.md](development/RUNBOOK_CHANGE_ROUTING_POLICY_SAFELY.md) | Safe workflow for changing routing or account-selection policy |
6678
| [development/TESTING.md](development/TESTING.md) | Validation gates and test matrix |
6779
| [development/TUI_PARITY_CHECKLIST.md](development/TUI_PARITY_CHECKLIST.md) | Dashboard UX parity checklist |
6880
| [benchmarks/code-edit-format-benchmark.md](benchmarks/code-edit-format-benchmark.md) | Benchmark methodology and outputs |

docs/development/CONFIG_FIELDS.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ Used only for host plugin mode through the host runtime config file.
3131
| `reasoningEffort` | string | `none\|minimal\|low\|medium\|high\|xhigh` | Reasoning effort hint |
3232
| `reasoningSummary` | string | `auto\|concise\|detailed` | Summary detail hint |
3333
| `textVerbosity` | string | `low\|medium\|high` | Text verbosity target |
34+
| `promptCacheRetention` | string | `5m\|1h\|24h\|7d` | Default server-side prompt cache retention when the request body omits `prompt_cache_retention` |
3435
| `include` | string[] | `reasoning.encrypted_content` | Extra payload include |
3536
| `store` | boolean | `false` | Required for stateless backend mode |
3637

@@ -74,10 +75,19 @@ Used only for host plugin mode through the host runtime config file.
7475
| `tokenRefreshSkewMs` | `60000` |
7576
| `sessionRecovery` | `true` |
7677
| `autoResume` | `true` |
78+
| `responseContinuation` | `false` |
79+
| `backgroundResponses` | `false` |
7780
| `proactiveRefreshGuardian` | `true` |
7881
| `proactiveRefreshIntervalMs` | `60000` |
7982
| `proactiveRefreshBufferMs` | `300000` |
8083

84+
`backgroundResponses` is an opt-in compatibility switch for Responses API `background: true` requests. When enabled, those requests become stateful (`store=true`) instead of following the default stateless Codex routing.
85+
86+
Upgrade note:
87+
- Leave this disabled for existing stateless pipelines that do not intentionally send `background: true`.
88+
- Enable it only for callers that need stateful background responses and can accept forced `store=true`, preserved input item IDs, and the loss of stateless-only defaults such as fast-session trimming.
89+
- After enabling it, test one known `background: true` request end to end before rolling it across shared automation.
90+
8191
### Storage / Sync
8292

8393
| Key | Default |
Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
# Runbook: Add Auth Command
2+
3+
Safe workflow for adding a new `codex auth ...` command without expanding scope or breaking the existing CLI contract.
4+
5+
* * *
6+
7+
## Goal
8+
9+
Add one new command path while keeping:
10+
11+
- `codex auth ...` as the canonical command family
12+
- current help text and aliases aligned with docs
13+
- JSON and human-readable output predictable
14+
- command behavior covered by targeted tests
15+
16+
* * *
17+
18+
## Primary Files
19+
20+
- `lib/codex-manager.ts`
21+
- `docs/reference/commands.md`
22+
- `README.md` when user-visible workflow changes
23+
- `test/codex-manager-cli.test.ts`
24+
- `test/documentation.test.ts`
25+
26+
* * *
27+
28+
## Implementation Steps
29+
30+
1. Add the command logic in `lib/codex-manager.ts` or the current command handler module.
31+
2. Keep usage text literal and copy-pasteable.
32+
3. Reuse existing storage, refresh, and quota helpers instead of adding new command-local state.
33+
4. Add or extend CLI tests in `test/codex-manager-cli.test.ts` for:
34+
- success path
35+
- invalid input or missing args
36+
- JSON mode if supported
37+
- non-interactive behavior if relevant
38+
5. Update `docs/reference/commands.md` with the command and flags.
39+
6. Update `README.md` only when the command changes the recommended user workflow.
40+
7. Update `test/documentation.test.ts` if new command text must stay aligned across docs and runtime usage text.
41+
42+
* * *
43+
44+
## Validation
45+
46+
```bash
47+
npm run lint
48+
npm run typecheck
49+
npm test -- test/codex-manager-cli.test.ts test/documentation.test.ts
50+
npm run build
51+
```
52+
53+
* * *
54+
55+
## Review Checklist
56+
57+
- command name is consistent across runtime and docs
58+
- help text matches actual flags
59+
- no unrelated settings or storage changes were mixed in
60+
- JSON output is stable if exposed
61+
- tests cover failure paths, not only the happy path

0 commit comments

Comments
 (0)