Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .codex-plugin/plugin.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "codex-multi-auth",
"version": "2.1.12",
"version": "2.1.13-beta.0",
"description": "Install and operate codex-multi-auth for the official @openai/codex CLI with multi-account OAuth rotation, switching, health checks, and recovery tools.",
"interface": {
"composerIcon": "./assets/codex-multi-auth-icon.svg"
Expand Down
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -383,6 +383,7 @@ codex-multi-auth doctor --json

## Release Notes

- Current prerelease: [docs/releases/v2.1.13-beta.0.md](docs/releases/v2.1.13-beta.0.md) — install via `npm i -g codex-multi-auth@beta`
- Current stable: [docs/releases/v2.1.12.md](docs/releases/v2.1.12.md)
- Previous stable: [docs/releases/v2.1.11.md](docs/releases/v2.1.11.md)
- Earlier stable: [docs/releases/v2.1.10.md](docs/releases/v2.1.10.md)
Expand Down
1 change: 1 addition & 0 deletions docs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ Public documentation for the `codex-multi-auth` Codex CLI multi-account OAuth ma

| Document | Focus |
| --- | --- |
| [releases/v2.1.13-beta.0.md](releases/v2.1.13-beta.0.md) | Current prerelease notes (install via `npm i -g codex-multi-auth@beta`) |
| [releases/v2.1.12.md](releases/v2.1.12.md) | Current stable release notes |
| [releases/v2.1.11.md](releases/v2.1.11.md) | Prior stable release notes |
| [releases/v2.1.10.md](releases/v2.1.10.md) | Earlier stable release notes |
Expand Down
42 changes: 42 additions & 0 deletions docs/releases/v2.1.13-beta.0.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
# v2.1.13-beta.0

Beta prerelease that adds a diagnostic surface to the runtime rotation proxy's pinned-account 503 path. Issued so users who hit the recurring 503 reported in issue #486 can install the patched build, reproduce, and return the new structured `reason` field for root-cause analysis.

This is a **prerelease**. Stable `v2.1.13` will land once the underlying forecast-vs-runtime state desync is identified and patched.

## Install

```bash
npm i -g codex-multi-auth@beta
```

## Runtime Rotation

### Fixes

- Pinned-account 503 (`codex_pinned_account_unavailable`) now carries a structured `reason` field and a full `account_skip_reasons` map keyed by account index, mirroring the existing `writePoolExhausted` shape. Consumers can branch on the same payload across both 503 codes.
- Human-readable `message` appends the skip reason in parentheses when present, for example `Pinned account 2 is currently unavailable (rate-limited); run ...`.
- A missing skip reason resolves to explicit `null` in the response body and is recorded in `status.lastError` so a forecast-vs-runtime state desync becomes detectable instead of silently masked as `unknown`.
- Extracted `buildPinnedUnavailableErrorBody` helper so the 503 payload shape is unit-testable in isolation; exported alongside a typed `PinnedUnavailableErrorBody` interface for stable external consumption.

## Release Hygiene

### Tests

- Added end-to-end regression coverage for the pinned-503 rate-limited and cooling-down paths; existing disabled-account case extended to assert the new structured fields.
- Extended `chooseAccount` unit suite to cover every pinned skip reason returned by `AccountManager.getAccountRuntimeSkipReason`: `rate-limited`, `cooling-down:auth-failure`, `disabled`, `workspace-disabled`, `circuit-open`, `policy-blocked`, `missing`, `already-attempted`.
- Added direct unit coverage for `buildPinnedUnavailableErrorBody` across the empty-map (`reason: null`), populated-map, null-`pinnedIndex`, and mismatched-pinned-entry shapes.

## Documentation

- `docs/reference/error-contracts.md` documents the new `reason` and `account_skip_reasons` fields on the pinned-503 payload.

## Known Gaps

- The 503 root cause from issue #486 (doctor reports all green, runtime still returns 503) is **not** fixed by this prerelease. Users who reproduce on this build should set `ENABLE_PLUGIN_REQUEST_LOGGING=1`, repro, and attach the new 503 body plus logs from `~/.codex/multi-auth/logs/codex-plugin/` to issue #486.

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 security the troubleshooting step directs users to enable request logging without warning that CODEX_PLUGIN_LOG_BODIES=1 must not be set alongside it. SECURITY.md classifies body logging as "sensitive" because raw OAuth payloads (including bearer tokens) flow through the proxy; a frustrated user chasing a 503 might add it for more detail and inadvertently persist tokens to disk. also, the log path uses ~/ syntax which doesn't work in cmd.exe — windows users need the %USERPROFILE% equivalent.

Suggested change
- The 503 root cause from issue #486 (doctor reports all green, runtime still returns 503) is **not** fixed by this prerelease. Users who reproduce on this build should set `ENABLE_PLUGIN_REQUEST_LOGGING=1`, repro, and attach the new 503 body plus logs from `~/.codex/multi-auth/logs/codex-plugin/` to issue #486.
- The 503 root cause from issue #486 (doctor reports all green, runtime still returns 503) is **not** fixed by this prerelease. Users who reproduce on this build should set `ENABLE_PLUGIN_REQUEST_LOGGING=1` (**do not also set `CODEX_PLUGIN_LOG_BODIES=1`** — body logs capture raw OAuth payloads and must be treated as sensitive data), repro, and attach the new 503 body plus logs from `~/.codex/multi-auth/logs/codex-plugin/` (`%USERPROFILE%\.codex\multi-auth\logs\codex-plugin\` on Windows) to issue #486.
Prompt To Fix With AI
This is a comment left during a code review.
Path: docs/releases/v2.1.13-beta.0.md
Line: 36

Comment:
the troubleshooting step directs users to enable request logging without warning that `CODEX_PLUGIN_LOG_BODIES=1` must **not** be set alongside it. `SECURITY.md` classifies body logging as "sensitive" because raw OAuth payloads (including bearer tokens) flow through the proxy; a frustrated user chasing a 503 might add it for more detail and inadvertently persist tokens to disk. also, the log path uses `~/` syntax which doesn't work in `cmd.exe` — windows users need the `%USERPROFILE%` equivalent.

```suggestion
- The 503 root cause from issue #486 (doctor reports all green, runtime still returns 503) is **not** fixed by this prerelease. Users who reproduce on this build should set `ENABLE_PLUGIN_REQUEST_LOGGING=1` (**do not also set `CODEX_PLUGIN_LOG_BODIES=1`** — body logs capture raw OAuth payloads and must be treated as sensitive data), repro, and attach the new 503 body plus logs from `~/.codex/multi-auth/logs/codex-plugin/` (`%USERPROFILE%\.codex\multi-auth\logs\codex-plugin\` on Windows) to issue #486.
```

How can I resolve this? If you propose a fix, please make it concise.

Fix in Codex

- Plugins-disabled and per-project history-loss symptoms reported alongside #486 are tracked separately in #488 and #489.

## Refs

- Issue #486 — `[bug] 503 Service Unavailable`
- PR #487 — `fix(runtime): surface skip reason in pinned 503 (#486)`
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "codex-multi-auth",
"version": "2.1.12",
"version": "2.1.13-beta.0",
"description": "Codex CLI multi-account OAuth manager with account switching, health checks, runtime rotation, diagnostics, and recovery tools for @openai/codex",
"main": "./dist/index.js",
"types": "./dist/index.d.ts",
Expand Down