Fix live account checks and default probe model - #506
Conversation
|
Codex usage limits have been reached for code reviews. Please check with the admins of this repo to increase the limits by adding credits. |
|
Note Reviews pausedIt looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the Use the following commands to manage reviews:
Use the checkboxes below for quick actions:
📝 WalkthroughWalkthroughpr centralizes DEFAULT_MODEL across cli and runtime, tightens --model parsing, replaces inline quota-probe lists with a shared chain, extends runHealthCheck with codexAvailable/signedInOnly and tone-aware rendering, adds Changesmodel upgrade and health-check metrics
test coverage and updates
sequence diagram(s)sequenceDiagram
participant cli as cli
participant manager as lib/codex-manager
participant probe as quota-probe
participant runtime as runtime-rotation-proxy
cli->>manager: parse --model (defaults to DEFAULT_MODEL)
manager->>probe: fetchCodexQuotaSnapshot(model=DEFAULT_MODEL)
probe-->>manager: quota snapshot or error
manager->>runtime: use CURRENT_CODEX_MODEL for family fallback when needed
manager->>cli: render per-account rows with healthTone and codexAvailable/signedInOnly counters
estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes possibly related PRs
suggested labels
suggested reviewers
notes and reviewer flags:
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
✨ Simplify code
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Set gpt-5.5 as the default live/quota probe model while keeping legacy Codex fallback compatibility. Report Codex-unavailable accounts as signed-in only instead of working, and package the plugin manifest/icon.
0175d1c to
49857fd
Compare
|
let me handle this real quick, will release on next ver :) |
There was a problem hiding this comment.
Actionable comments posted: 3
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (3)
lib/codex-manager/commands/forecast.ts (1)
175-185:⚠️ Potential issue | 🟠 Major | ⚡ Quick winreject flag-like values after
--model.
lib/codex-manager/commands/forecast.ts:175-185currently accepts the next flag as the model value.codex-multi-auth forecast --model --jsonwill silently consume--json, drop json mode, and then fall back throughresolveNormalizedModel()instead of reporting a missing value. please reject next args that start with-, the same waylib/codex-manager/help.ts:85-104already does for--org, and add a regression for this exact case in the forecast command tests.🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@lib/codex-manager/commands/forecast.ts` around lines 175 - 185, The argument parsing for --model (both short "-m" branch and "--model=" fallback) must reject flag-like values: when handling the "-m" form, check the next token (args[i+1]) and if it is missing or startsWith("-") return { ok: false, message: "Missing value for --model" } instead of consuming it; similarly, for the "--model=" case ensure the extracted value isn't a flag-like string (startsWith("-")) and reject it; mirror the validation behavior used in help.ts for --org and add a unit/integration test reproducing "codex-multi-auth forecast --model --json" to assert it fails with the missing-value error rather than consuming --json.lib/codex-manager.ts (1)
2537-2554:⚠️ Potential issue | 🟠 Major | ⚡ Quick winreject flag-like values after
--model.
lib/codex-manager.ts:2537-2554treats the next token as a model unconditionally.codex-multi-auth best --model --livewill consume--liveas the model and surface the wrong error path instead of reporting a missing value. please reject next args that start with-, matching the stricter handling already used inlib/codex-manager/help.ts:85-104, and cover it through the actualbestcommand path.🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@lib/codex-manager.ts` around lines 2537 - 2554, The parser block handling the "--model" / "-m" flags treats the next token unconditionally as the model and should reject flag-like values; when taking const value = args[i+1] (for "--model" or "-m") verify value exists and does NOT startWith("-") and otherwise return the missing-value error, and for the "--model=" branch also reject values that begin with "-" after trimming; update the logic that sets options.model and options.modelProvided (and increments i) accordingly to mirror the stricter validation used in the help parsing (help.ts lines handling flags) so flag-like tokens like "--live" are not consumed as model names.test/runtime-quota-probe.test.ts (1)
50-95:⚠️ Potential issue | 🟡 Minor | ⚡ Quick winadd a regression assertion for probe model attempt order
this test only checks the final winning model. please also assert the first attempt is
gpt-5.5and fallback isgpt-5.4, so a default-model regression cannot pass silently. seetest/runtime-quota-probe.test.ts:50andtest/runtime-quota-probe.test.ts:93.proposed test hardening
it("falls back to the next model when the first one is unsupported", async () => { + const getCodexInstructions = vi.fn(async (model: string) => `instructions:${model}`); const fetchImpl = vi .fn() .mockResolvedValueOnce( @@ const snapshot = await fetchRuntimeCodexQuotaSnapshot({ @@ - getCodexInstructions: async (model: string) => `instructions:${model}`, + getCodexInstructions, @@ expect(snapshot.model).toBe("gpt-5.4"); expect(fetchImpl).toHaveBeenCalledTimes(2); + expect(getCodexInstructions).toHaveBeenNthCalledWith(1, "gpt-5.5"); + expect(getCodexInstructions).toHaveBeenNthCalledWith(2, "gpt-5.4"); });As per coding guidelines
test/**: tests must stay deterministic and demand regression cases that reproduce behavior changes.🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@test/runtime-quota-probe.test.ts` around lines 50 - 95, The test must also assert the probe attempted gpt-5.5 first and then fell back to gpt-5.4 to prevent silent default-model regressions; update the test around fetchRuntimeCodexQuotaSnapshot to inspect fetchImpl call arguments (or the mocked getCodexInstructions inputs) and add two expectations: that the first fetch/generation used instructions:gpt-5.5 and the second used instructions:gpt-5.4 (i.e., verify fetchImpl.mock.calls[0] includes "instructions:gpt-5.5" and fetchImpl.mock.calls[1] includes "instructions:gpt-5.4" or assert the getCodexInstructions mock was called with "gpt-5.5" then "gpt-5.4"). Ensure you reference the existing fetchImpl and getCodexInstructions used in the fetchRuntimeCodexQuotaSnapshot invocation.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@lib/codex-manager.ts`:
- Around line 2398-2402: When sessionLikelyValid is true and liveProbe is set,
don't increment signedInOnly immediately; first attempt a live probe using
fetchCodexQuotaSnapshot with the existing account.accessToken and only count as
signed-in-only if that probe fails; update the logic around sessionLikelyValid /
liveProbe / signedInOnly to fall back to the current token before treating
refresh failures as unavailable. Also add a regression test covering the
scenario where token refresh fails transiently but the existing accessToken
still allows fetchCodexQuotaSnapshot (i.e., refresh error + usable token + live
probe) to ensure codexAvailable is correctly counted.
In `@scripts/check-pack-budget-lib.js`:
- Around line 16-18: The REQUIRED_PREFIXES array currently mixes exact file
paths with directory prefixes causing validatePackMetadata() to use startsWith
for everything; change the design by splitting REQUIRED_PREFIXES into two
constants (e.g., REQUIRED_FILES for exact paths like ".codex-plugin/plugin.json"
and REQUIRED_PREFIXES for directory prefixes like "dist/"), update
validatePackMetadata() to check equality for items in REQUIRED_FILES and
startsWith for items in REQUIRED_PREFIXES, and add a regression test in
test/check-pack-budget.test.ts (around the existing test at line ~112) that
ensures ".codex-plugin/plugin.json.bak" does not satisfy the exact-file
requirement.
In `@test/codex-manager-help.test.ts`:
- Around line 92-100: The test exercises the helper parseBestArgs but the
shipped "best" command uses a duplicated parser in lib/codex-manager.ts, so
either dedupe by exporting/centralizing parseBestArgs and have the command use
that single implementation (replace the duplicate parser in the command wiring
with a call to parseBestArgs), or add an integration test that exercises the
actual command path (call runBestCommand or invoke the CLI entry that wires the
"best" command) to cover the parser used at runtime; update imports/usages so
parseBestArgs is the single source of truth or add tests invoking
runBestCommand/CLI to prevent future drift.
---
Outside diff comments:
In `@lib/codex-manager.ts`:
- Around line 2537-2554: The parser block handling the "--model" / "-m" flags
treats the next token unconditionally as the model and should reject flag-like
values; when taking const value = args[i+1] (for "--model" or "-m") verify value
exists and does NOT startWith("-") and otherwise return the missing-value error,
and for the "--model=" branch also reject values that begin with "-" after
trimming; update the logic that sets options.model and options.modelProvided
(and increments i) accordingly to mirror the stricter validation used in the
help parsing (help.ts lines handling flags) so flag-like tokens like "--live"
are not consumed as model names.
In `@lib/codex-manager/commands/forecast.ts`:
- Around line 175-185: The argument parsing for --model (both short "-m" branch
and "--model=" fallback) must reject flag-like values: when handling the "-m"
form, check the next token (args[i+1]) and if it is missing or startsWith("-")
return { ok: false, message: "Missing value for --model" } instead of consuming
it; similarly, for the "--model=" case ensure the extracted value isn't a
flag-like string (startsWith("-")) and reject it; mirror the validation behavior
used in help.ts for --org and add a unit/integration test reproducing
"codex-multi-auth forecast --model --json" to assert it fails with the
missing-value error rather than consuming --json.
In `@test/runtime-quota-probe.test.ts`:
- Around line 50-95: The test must also assert the probe attempted gpt-5.5 first
and then fell back to gpt-5.4 to prevent silent default-model regressions;
update the test around fetchRuntimeCodexQuotaSnapshot to inspect fetchImpl call
arguments (or the mocked getCodexInstructions inputs) and add two expectations:
that the first fetch/generation used instructions:gpt-5.5 and the second used
instructions:gpt-5.4 (i.e., verify fetchImpl.mock.calls[0] includes
"instructions:gpt-5.5" and fetchImpl.mock.calls[1] includes
"instructions:gpt-5.4" or assert the getCodexInstructions mock was called with
"gpt-5.5" then "gpt-5.4"). Ensure you reference the existing fetchImpl and
getCodexInstructions used in the fetchRuntimeCodexQuotaSnapshot invocation.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: ASSERTIVE
Plan: Pro
Run ID: bc871d17-1a6b-4d0e-ad4c-7241a8ae9524
📒 Files selected for processing (24)
README.mdlib/codex-manager.tslib/codex-manager/commands/best.tslib/codex-manager/commands/forecast.tslib/codex-manager/commands/report.tslib/codex-manager/forecast-report-commands.tslib/codex-manager/help.tslib/codex-manager/repair-commands.tslib/integration-generators.tslib/prompts/codex.tslib/quota-probe.tslib/runtime-rotation-proxy.tslib/runtime/quota-probe.tspackage.jsonscripts/check-pack-budget-lib.jstest/check-pack-budget.test.tstest/codex-manager-cli.test.tstest/codex-manager-help.test.tstest/codex-manager-integrations-command.test.tstest/codex-prompts.test.tstest/documentation.test.tstest/package-bin.test.tstest/quota-probe.test.tstest/runtime-quota-probe.test.ts
📜 Review details
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
- GitHub Check: Greptile Review
🧰 Additional context used
📓 Path-based instructions (13)
test/**/*.test.ts
📄 CodeRabbit inference engine (test/AGENTS.md)
test/**/*.test.ts: Vitest globals (describe,it,expect) are enabled and should be used without explicit imports
Maintain 80% coverage threshold across statements, branches, functions, and lines
UseremoveWithRetryfor Windows filesystem cleanup instead of barefs.rmto handle EBUSY/EPERM/ENOTEMPTY backoff
Use source files in tests, not compileddist/files; test the source directly
Do not skip tests without justification; include rationale if a test must be skipped
Relax ESLint rules for test files as specified ineslint.config.js
Files:
test/codex-manager-integrations-command.test.tstest/quota-probe.test.tstest/codex-manager-help.test.tstest/documentation.test.tstest/codex-prompts.test.tstest/package-bin.test.tstest/check-pack-budget.test.tstest/codex-manager-cli.test.tstest/runtime-quota-probe.test.ts
**/*.ts
📄 CodeRabbit inference engine (AGENTS.md)
Do not use
as any,@ts-ignore, or@ts-expect-errortype assertions
Files:
test/codex-manager-integrations-command.test.tslib/codex-manager/commands/best.tstest/quota-probe.test.tslib/runtime/quota-probe.tstest/codex-manager-help.test.tslib/runtime-rotation-proxy.tslib/codex-manager/forecast-report-commands.tslib/codex-manager/help.tslib/codex-manager/commands/forecast.tstest/documentation.test.tslib/integration-generators.tslib/codex-manager/commands/report.tslib/codex-manager/repair-commands.tstest/codex-prompts.test.tstest/package-bin.test.tslib/quota-probe.tslib/prompts/codex.tstest/check-pack-budget.test.tstest/codex-manager-cli.test.tstest/runtime-quota-probe.test.tslib/codex-manager.ts
**/*.{ts,js}
📄 CodeRabbit inference engine (AGENTS.md)
Use ESM module syntax exclusively; the project is ESM-only with
"type": "module"
Files:
test/codex-manager-integrations-command.test.tslib/codex-manager/commands/best.tstest/quota-probe.test.tslib/runtime/quota-probe.tstest/codex-manager-help.test.tsscripts/check-pack-budget-lib.jslib/runtime-rotation-proxy.tslib/codex-manager/forecast-report-commands.tslib/codex-manager/help.tslib/codex-manager/commands/forecast.tstest/documentation.test.tslib/integration-generators.tslib/codex-manager/commands/report.tslib/codex-manager/repair-commands.tstest/codex-prompts.test.tstest/package-bin.test.tslib/quota-probe.tslib/prompts/codex.tstest/check-pack-budget.test.tstest/codex-manager-cli.test.tstest/runtime-quota-probe.test.tslib/codex-manager.ts
test/**/*.ts
📄 CodeRabbit inference engine (AGENTS.md)
Windows filesystem operations must include retry handling for transient
EBUSY,EPERM, andENOTEMPTYerrors where tests cover Windows locks
Files:
test/codex-manager-integrations-command.test.tstest/quota-probe.test.tstest/codex-manager-help.test.tstest/documentation.test.tstest/codex-prompts.test.tstest/package-bin.test.tstest/check-pack-budget.test.tstest/codex-manager-cli.test.tstest/runtime-quota-probe.test.ts
**/*.{ts,tsx,js}
📄 CodeRabbit inference engine (README.md)
Implement whole-pool replay as disabled by default when every account is rate-limited
Use bounded outbound request budgets so one prompt cannot walk through the entire account pool indefinitely
Trigger cooldown instead of continuing aggressive rotation when repeated cross-account 5xx bursts occur
Stagger proactive refresh to reduce background refresh bursts across the account pool
Set runtime rotation as enabled by default for request-bearing wrapper-launched Codex sessions
Perform best-effort daily npm version checks during normal forwarded Codex startup, printing manual notices only on interactive TTY or when
CODEX_MULTI_AUTH_DEBUG=1Never run npm install or update commands automatically; only notify users to run
npm install -g codex-multi-auth@latestmanuallyMake non-destructive settings changes in the Experimental section: sync previews before apply, preserve destination-only accounts, and fail safely on filename collisions
Files:
test/codex-manager-integrations-command.test.tslib/codex-manager/commands/best.tstest/quota-probe.test.tslib/runtime/quota-probe.tstest/codex-manager-help.test.tsscripts/check-pack-budget-lib.jslib/runtime-rotation-proxy.tslib/codex-manager/forecast-report-commands.tslib/codex-manager/help.tslib/codex-manager/commands/forecast.tstest/documentation.test.tslib/integration-generators.tslib/codex-manager/commands/report.tslib/codex-manager/repair-commands.tstest/codex-prompts.test.tstest/package-bin.test.tslib/quota-probe.tslib/prompts/codex.tstest/check-pack-budget.test.tstest/codex-manager-cli.test.tstest/runtime-quota-probe.test.tslib/codex-manager.ts
test/**
⚙️ CodeRabbit configuration file
tests must stay deterministic and use vitest. demand regression cases that reproduce concurrency bugs, token refresh races, and windows filesystem behavior. reject changes that mock real secrets or skip assertions.
Files:
test/codex-manager-integrations-command.test.tstest/quota-probe.test.tstest/codex-manager-help.test.tstest/documentation.test.tstest/codex-prompts.test.tstest/package-bin.test.tstest/check-pack-budget.test.tstest/codex-manager-cli.test.tstest/runtime-quota-probe.test.ts
lib/**/*.ts
📄 CodeRabbit inference engine (lib/AGENTS.md)
lib/**/*.ts: All public exports should flow throughlib/index.tsor documented package subpaths
Never import fromdist/in source tests or library code
Never suppress type errors
Files:
lib/codex-manager/commands/best.tslib/runtime/quota-probe.tslib/runtime-rotation-proxy.tslib/codex-manager/forecast-report-commands.tslib/codex-manager/help.tslib/codex-manager/commands/forecast.tslib/integration-generators.tslib/codex-manager/commands/report.tslib/codex-manager/repair-commands.tslib/quota-probe.tslib/prompts/codex.tslib/codex-manager.ts
lib/**
⚙️ CodeRabbit configuration file
focus on auth rotation, windows filesystem IO, and concurrency. verify every change cites affected tests (vitest) and that new queues handle EBUSY/429 scenarios. check for logging that leaks tokens or emails.
Files:
lib/codex-manager/commands/best.tslib/runtime/quota-probe.tslib/runtime-rotation-proxy.tslib/codex-manager/forecast-report-commands.tslib/codex-manager/help.tslib/codex-manager/commands/forecast.tslib/integration-generators.tslib/codex-manager/commands/report.tslib/codex-manager/repair-commands.tslib/quota-probe.tslib/prompts/codex.tslib/codex-manager.ts
scripts/*.js
📄 CodeRabbit inference engine (AGENTS.md)
Windows filesystem operations must include retry handling for transient
EBUSY,EPERM, andENOTEMPTYerrors
Files:
scripts/check-pack-budget-lib.js
lib/runtime-rotation-proxy.ts
📄 CodeRabbit inference engine (lib/AGENTS.md)
lib/runtime-rotation-proxy.ts: Runtime rotation code must preserve pass-through semantics except for auth/provider headers that intentionally change
Runtime proxy client-facing headers must not expose account emails or tokens
Runtime rotation should fail open to normal official Codex forwarding when startup helpers are unavailable
Never add account emails/tokens to runtime proxy client responsesDo not expose account emails or tokens in runtime proxy client response headers or logs
Files:
lib/runtime-rotation-proxy.ts
package.json
📄 CodeRabbit inference engine (SECURITY.md)
package.json: Pinhonoto4.12.18or higher (but below4.12.0-4.12.1) to avoid GHSA-xh87-mx6m-69f3 authentication bypass vulnerability
Pinrollupto^4.59.0or higher to avoid vulnerable versions below4.59.0in Vite and Vitest transitive dependencies
Files:
package.json
test/**/documentation.test.ts
📄 CodeRabbit inference engine (test/AGENTS.md)
Test documentation parity including command flags, config precedence, changelog policy, and governance rules
Files:
test/documentation.test.ts
test/**/codex-manager-cli.test.ts
📄 CodeRabbit inference engine (test/AGENTS.md)
Test CLI settings with question cancellation across all 5 panels and EBUSY/concurrent race conditions
Files:
test/codex-manager-cli.test.ts
🧠 Learnings (34)
📓 Common learnings
Learnt from: CR
Repo: ndycode/codex-multi-auth PR: 0
File: docs/configuration.md:0-0
Timestamp: 2026-05-31T13:20:01.197Z
Learning: Applies to docs/config/codex-modern.json : Configuration shipped templates must expose first-class current OpenAI model aliases, with `config/codex-modern.json` including `gpt-5.5` and `gpt-5.5-pro`
Learnt from: CR
Repo: ndycode/codex-multi-auth PR: 0
File: docs/configuration.md:0-0
Timestamp: 2026-05-31T13:20:01.197Z
Learning: Deprecated Codex selectors such as `gpt-5-codex` and `gpt-5.1-codex*` must be treated as compatibility aliases and retried on current documented Codex models
Learnt from: CR
Repo: ndycode/codex-multi-auth PR: 0
File: docs/releases/v2.2.0.md:0-0
Timestamp: 2026-06-02T12:30:22.264Z
Learning: Applies to docs/releases/**/quota*.{js,ts,tsx} : Detect unsupported Codex model from upstream error `detail` shape and surface a friendly 'Codex unavailable' note across `best` / `forecast` / `report` / live-check surfaces instead of leaking raw upstream text
Learnt from: CR
Repo: ndycode/codex-multi-auth PR: 0
File: docs/troubleshooting.md:0-0
Timestamp: 2026-05-31T13:20:14.049Z
Learning: Run `codex-multi-auth doctor --fix` to automatically repair Codex CLI multi-account install and routing issues
Learnt from: CR
Repo: ndycode/codex-multi-auth
Timestamp: 2026-06-03T06:14:10.413Z
Learning: Validate configuration after making changes to settings with `codex-multi-auth status`, `codex-multi-auth check`, and `codex-multi-auth forecast --live`
Learnt from: CR
Repo: ndycode/codex-multi-auth
Timestamp: 2026-06-03T06:14:10.413Z
Learning: Use `CODEX_MULTI_AUTH_DIR` environment variable to override the default settings and accounts root directory
Learnt from: CR
Repo: ndycode/codex-multi-auth
Timestamp: 2026-06-03T06:14:10.413Z
Learning: Keep OAuth credentials local and only use loopback-only runtime rotation for account switching in forwarded Codex sessions
Learnt from: CR
Repo: ndycode/codex-multi-auth
Timestamp: 2026-06-03T06:14:10.413Z
Learning: Do not patch official Codex app binaries; instead use reversible packaged Codex app bind and user-level launcher routing helpers
Learnt from: CR
Repo: ndycode/codex-multi-auth
Timestamp: 2026-06-03T06:14:10.413Z
Learning: Enable `backgroundResponses` in settings only for callers that intentionally send `background: true` requests
Learnt from: CR
Repo: ndycode/codex-multi-auth
Timestamp: 2026-06-03T06:14:10.413Z
Learning: Keep `codex` command owned by the official OpenAI install path; use `codex-multi-auth-codex` wrapper only when intentionally choosing wrapper-launched sessions
Learnt from: CR
Repo: ndycode/codex-multi-auth
Timestamp: 2026-06-03T06:14:10.413Z
Learning: Maintain session affinity, live account sync, proactive refresh, and preemptive quota deferral controls
Learnt from: CR
Repo: ndycode/codex-multi-auth
Timestamp: 2026-06-03T06:14:10.413Z
Learning: Document error contracts using strict Codex-oriented request/prompt compatibility and runtime handling
Learnt from: CR
Repo: ndycode/codex-multi-auth
Timestamp: 2026-06-03T06:14:10.413Z
Learning: Run `codex-multi-auth doctor --fix` followed by `codex-multi-auth check` and `codex-multi-auth forecast --live` as the primary recovery sequence
Learnt from: CR
Repo: ndycode/codex-multi-auth
Timestamp: 2026-06-03T06:14:10.413Z
Learning: Use `codex-multi-auth login --device-auth` for remote or headless shells instead of browser-based login
📚 Learning: 2026-05-31T14:24:04.131Z
Learnt from: CR
Repo: ndycode/codex-multi-auth PR: 0
File: docs/releases/v2.1.13-beta.2.md:0-0
Timestamp: 2026-05-31T14:24:04.131Z
Learning: Applies to docs/releases/**/*{builder,error,response}*.test.{ts,js} : Write unit tests for invalidation body builder covering all message-extraction branches: top-level message, nested error.message, top-level-wins priority, blank-to-nested fallback, non-JSON body, and no-usable-message fallback
Applied to files:
test/codex-manager-integrations-command.test.tstest/codex-manager-help.test.tstest/codex-prompts.test.tstest/package-bin.test.tstest/check-pack-budget.test.tstest/codex-manager-cli.test.tstest/runtime-quota-probe.test.ts
📚 Learning: 2026-05-31T13:20:01.197Z
Learnt from: CR
Repo: ndycode/codex-multi-auth PR: 0
File: docs/configuration.md:0-0
Timestamp: 2026-05-31T13:20:01.197Z
Learning: Applies to docs/config/codex-modern.json : Configuration shipped templates must expose first-class current OpenAI model aliases, with `config/codex-modern.json` including `gpt-5.5` and `gpt-5.5-pro`
Applied to files:
lib/codex-manager/commands/best.tsREADME.mdlib/runtime/quota-probe.tslib/codex-manager/forecast-report-commands.tslib/codex-manager/help.tslib/codex-manager/commands/forecast.tslib/codex-manager/commands/report.tslib/codex-manager/repair-commands.tslib/quota-probe.tslib/prompts/codex.tstest/codex-manager-cli.test.tstest/runtime-quota-probe.test.tslib/codex-manager.ts
📚 Learning: 2026-05-31T13:20:01.197Z
Learnt from: CR
Repo: ndycode/codex-multi-auth PR: 0
File: docs/configuration.md:0-0
Timestamp: 2026-05-31T13:20:01.197Z
Learning: Deprecated Codex selectors such as `gpt-5-codex` and `gpt-5.1-codex*` must be treated as compatibility aliases and retried on current documented Codex models
Applied to files:
lib/codex-manager/commands/best.tsREADME.mdlib/runtime/quota-probe.tslib/codex-manager/commands/forecast.tslib/codex-manager/commands/report.tslib/codex-manager/repair-commands.tstest/codex-prompts.test.tslib/quota-probe.tslib/prompts/codex.tstest/codex-manager-cli.test.tstest/runtime-quota-probe.test.ts
📚 Learning: 2026-06-02T12:30:22.264Z
Learnt from: CR
Repo: ndycode/codex-multi-auth PR: 0
File: docs/releases/v2.2.0.md:0-0
Timestamp: 2026-06-02T12:30:22.264Z
Learning: Applies to docs/releases/**/quota*.{js,ts,tsx} : Detect unsupported Codex model from upstream error `detail` shape and surface a friendly 'Codex unavailable' note across `best` / `forecast` / `report` / live-check surfaces instead of leaking raw upstream text
Applied to files:
lib/codex-manager/commands/best.tstest/quota-probe.test.tslib/runtime/quota-probe.tslib/codex-manager/forecast-report-commands.tslib/codex-manager/help.tslib/codex-manager/commands/forecast.tstest/documentation.test.tslib/codex-manager/commands/report.tslib/codex-manager/repair-commands.tslib/quota-probe.tslib/prompts/codex.tstest/codex-manager-cli.test.tstest/runtime-quota-probe.test.tslib/codex-manager.ts
📚 Learning: 2026-05-31T13:20:14.049Z
Learnt from: CR
Repo: ndycode/codex-multi-auth PR: 0
File: docs/troubleshooting.md:0-0
Timestamp: 2026-05-31T13:20:14.049Z
Learning: Include outputs from `codex-multi-auth report --json`, `codex-multi-auth doctor --json`, version commands, and full terminal output when opening bug reports for codex-multi-auth issues
Applied to files:
README.md
📚 Learning: 2026-05-31T13:20:14.049Z
Learnt from: CR
Repo: ndycode/codex-multi-auth PR: 0
File: docs/troubleshooting.md:0-0
Timestamp: 2026-05-31T13:20:14.049Z
Learning: Run `codex-multi-auth doctor --fix` to automatically repair Codex CLI multi-account install and routing issues
Applied to files:
README.md
📚 Learning: 2026-06-03T06:06:23.734Z
Learnt from: CR
Repo: ndycode/codex-multi-auth PR: 0
File: README.md:0-0
Timestamp: 2026-06-03T06:06:23.734Z
Learning: Applies to **/runtime-observability.json : Store runtime observability metrics in `~/.codex/multi-auth/runtime-observability.json` and expose them via `codex-multi-auth status` and `codex-multi-auth report --json` commands
Applied to files:
README.md
📚 Learning: 2026-06-03T06:06:23.734Z
Learnt from: CR
Repo: ndycode/codex-multi-auth PR: 0
File: README.md:0-0
Timestamp: 2026-06-03T06:06:23.734Z
Learning: Provide machine-readable JSON output from diagnostic commands via `--json` flags for `status`, `report`, `verify-flagged`, `check`, `doctor`, `monitor`, and `why-selected` to enable automation
Applied to files:
README.md
📚 Learning: 2026-05-31T14:24:04.131Z
Learnt from: CR
Repo: ndycode/codex-multi-auth PR: 0
File: docs/releases/v2.1.13-beta.2.md:0-0
Timestamp: 2026-05-31T14:24:04.131Z
Learning: Applies to docs/releases/**/*{auth,rotation,401}*.test.{ts,js} : Write unit tests covering upstream-401 invalidation path (401 to client, ~5-minute cooldown, clears affinity, no rotation) and regression guard for generic 401 rotation
Applied to files:
test/quota-probe.test.tstest/codex-manager-cli.test.ts
📚 Learning: 2026-06-03T06:06:23.734Z
Learnt from: CR
Repo: ndycode/codex-multi-auth PR: 0
File: README.md:0-0
Timestamp: 2026-06-03T06:06:23.734Z
Learning: Applies to **/quota-cache.json : Implement quota caching in `~/.codex/multi-auth/quota-cache.json` for account quota forecasting and health-aware selection
Applied to files:
test/quota-probe.test.tslib/runtime/quota-probe.tslib/codex-manager.ts
📚 Learning: 2026-06-02T12:29:38.793Z
Learnt from: CR
Repo: ndycode/codex-multi-auth PR: 0
File: AGENTS.md:0-0
Timestamp: 2026-06-02T12:29:38.793Z
Learning: Applies to lib/runtime-constants.ts : Use canonical runtime provider id `codex-multi-auth-runtime-proxy` in runtime constants
Applied to files:
lib/runtime/quota-probe.tslib/runtime-rotation-proxy.tstest/runtime-quota-probe.test.ts
📚 Learning: 2026-06-03T06:06:56.293Z
Learnt from: CR
Repo: ndycode/codex-multi-auth PR: 0
File: docs/releases/v2.2.1.md:0-0
Timestamp: 2026-06-03T06:06:56.293Z
Learning: Applies to docs/releases/**/*resolver*.js : The Codex bin resolver must skip any PATH candidate inside its own wrapper directory
Applied to files:
scripts/check-pack-budget-lib.jstest/package-bin.test.tstest/check-pack-budget.test.ts
📚 Learning: 2026-06-02T12:29:38.793Z
Learnt from: CR
Repo: ndycode/codex-multi-auth PR: 0
File: AGENTS.md:0-0
Timestamp: 2026-06-02T12:29:38.793Z
Learning: Applies to lib/rotation.ts : Runtime rotation is default-on through `codexRuntimeRotationProxy`; respect `CODEX_MULTI_AUTH_RUNTIME_ROTATION_PROXY=0` opt-out
Applied to files:
lib/runtime-rotation-proxy.ts
📚 Learning: 2026-06-02T12:29:38.793Z
Learnt from: CR
Repo: ndycode/codex-multi-auth PR: 0
File: AGENTS.md:0-0
Timestamp: 2026-06-02T12:29:38.793Z
Learning: Applies to lib/runtime-rotation-proxy.ts : Do not expose account emails or tokens in runtime proxy client response headers or logs
Applied to files:
lib/runtime-rotation-proxy.ts
📚 Learning: 2026-06-02T12:30:22.264Z
Learnt from: CR
Repo: ndycode/codex-multi-auth PR: 0
File: docs/releases/v2.2.0.md:0-0
Timestamp: 2026-06-02T12:30:22.264Z
Learning: Applies to docs/releases/**/proxy*.{js,ts,tsx} : Bind runtime rotation proxy and local bridge to loopback-only with no opt-out; never forward inbound client credentials (`authorization`, `x-api-key`, `cookie`, `proxy-authorization`) upstream alongside the managed token
Applied to files:
lib/runtime-rotation-proxy.ts
📚 Learning: 2026-06-02T12:29:38.793Z
Learnt from: CR
Repo: ndycode/codex-multi-auth PR: 0
File: AGENTS.md:0-0
Timestamp: 2026-06-02T12:29:38.793Z
Learning: The runtime rotation proxy is loopback-only, uses per-process client token, and forwards only Responses API and model discovery requests
Applied to files:
lib/runtime-rotation-proxy.ts
📚 Learning: 2026-05-31T13:20:01.197Z
Learnt from: CR
Repo: ndycode/codex-multi-auth PR: 0
File: docs/configuration.md:0-0
Timestamp: 2026-05-31T13:20:01.197Z
Learning: Applies to docs/**/.codex/multi-auth/settings.json : Settings JSON file must conform to the canonical shape including `version`, `dashboardDisplaySettings`, and `pluginConfig` objects
Applied to files:
package.jsontest/check-pack-budget.test.ts
📚 Learning: 2026-06-03T06:06:23.734Z
Learnt from: CR
Repo: ndycode/codex-multi-auth PR: 0
File: README.md:0-0
Timestamp: 2026-06-03T06:06:23.734Z
Learning: Implement three distinct global binaries: `codex-multi-auth` for primary account management, `codex-multi-auth-codex` as optional forwarding wrapper, and `codex-multi-auth-app-launcher` as optional desktop launcher helper
Applied to files:
package.json
📚 Learning: 2026-06-03T06:06:23.734Z
Learnt from: CR
Repo: ndycode/codex-multi-auth PR: 0
File: README.md:0-0
Timestamp: 2026-06-03T06:06:23.734Z
Learning: Applies to **/logs/codex-plugin/** : Store application logs in `~/.codex/multi-auth/logs/codex-plugin/` directory for debugging and diagnostics
Applied to files:
package.json
📚 Learning: 2026-06-02T12:29:38.793Z
Learnt from: CR
Repo: ndycode/codex-multi-auth PR: 0
File: AGENTS.md:0-0
Timestamp: 2026-06-02T12:29:38.793Z
Learning: Canonical package name is `codex-multi-auth` and canonical command family is `codex-multi-auth ...`
Applied to files:
package.json
📚 Learning: 2026-05-31T13:20:14.049Z
Learnt from: CR
Repo: ndycode/codex-multi-auth PR: 0
File: docs/troubleshooting.md:0-0
Timestamp: 2026-05-31T13:20:14.049Z
Learning: Run `codex-multi-auth uninstall` before running `npm uninstall -g codex-multi-auth` to ensure complete cleanup of residual artifacts including plugin entries, cached modules, OS launchers, and app-bind state
Applied to files:
package.json
📚 Learning: 2026-06-03T06:06:38.259Z
Learnt from: CR
Repo: ndycode/codex-multi-auth PR: 0
File: docs/README.md:0-0
Timestamp: 2026-06-03T06:06:38.259Z
Learning: Applies to docs/**/*.md : Documentation files must follow the directory structure and navigation hierarchy defined in the codex-multi-auth documentation portal, with primary sections organized as: Start Here, Daily Use, Release History, Repair, Reference, Maintainer Docs, and Governance
Applied to files:
package.json
📚 Learning: 2026-06-03T06:06:23.734Z
Learnt from: CR
Repo: ndycode/codex-multi-auth PR: 0
File: README.md:0-0
Timestamp: 2026-06-03T06:06:23.734Z
Learning: Applies to docs/**/*.md : Maintain command-line help and documentation in markdown files at `docs/` directory with reference sections for commands, public API, error contracts, settings, and storage paths
Applied to files:
test/documentation.test.ts
📚 Learning: 2026-06-02T12:29:38.793Z
Learnt from: CR
Repo: ndycode/codex-multi-auth PR: 0
File: AGENTS.md:0-0
Timestamp: 2026-06-02T12:29:38.793Z
Learning: Applies to lib/request/request-transformer.ts : Forward non-auth commands to official Codex CLI without reimplementing general Codex commands in the wrapper
Applied to files:
test/documentation.test.ts
📚 Learning: 2026-06-02T12:30:22.264Z
Learnt from: CR
Repo: ndycode/codex-multi-auth PR: 0
File: docs/releases/v2.2.0.md:0-0
Timestamp: 2026-06-02T12:30:22.264Z
Learning: Applies to docs/releases/**/cache*.{js,ts,tsx} : Verify cached Codex instructions with SHA-256 digest; discard tampered cache, treat legacy entries without recorded digest as unverified, and never fast-path serve or drive conditional revalidation on unverified bytes
Applied to files:
test/codex-prompts.test.tstest/package-bin.test.tslib/prompts/codex.tstest/check-pack-budget.test.tstest/codex-manager-cli.test.ts
📚 Learning: 2026-06-03T06:06:56.293Z
Learnt from: CR
Repo: ndycode/codex-multi-auth PR: 0
File: docs/releases/v2.2.1.md:0-0
Timestamp: 2026-06-03T06:06:56.293Z
Learning: Applies to docs/releases/**/*cache*.js : Codex CLI state cache must honor forceRefresh even with a load in flight, guarded by load generation to prevent stale reads from overwriting fresh snapshots
Applied to files:
test/codex-prompts.test.tslib/prompts/codex.tstest/codex-manager-cli.test.ts
📚 Learning: 2026-05-31T14:24:04.131Z
Learnt from: CR
Repo: ndycode/codex-multi-auth PR: 0
File: docs/releases/v2.1.13-beta.2.md:0-0
Timestamp: 2026-05-31T14:24:04.131Z
Learning: Applies to docs/releases/**/*{refresh,error,builder,auth}*.test.{ts,js} : Write unit tests covering refresh-endpoint invalidation returning code: "token_invalidated" routed through shared body builder
Applied to files:
test/codex-prompts.test.tstest/codex-manager-cli.test.tstest/runtime-quota-probe.test.ts
📚 Learning: 2026-05-31T14:24:04.131Z
Learnt from: CR
Repo: ndycode/codex-multi-auth PR: 0
File: docs/releases/v2.1.13-beta.2.md:0-0
Timestamp: 2026-05-31T14:24:04.131Z
Learning: Applies to docs/releases/**/*{config,rotation,schema}*.test.{ts,js} : Write tests for minRotationIntervalMs sliding-anchor and sticky-window coverage; schema and config coverage for new knobs with min(0), allows-zero, rejects-string validation
Applied to files:
test/package-bin.test.tstest/check-pack-budget.test.tstest/runtime-quota-probe.test.ts
📚 Learning: 2026-06-02T12:30:22.264Z
Learnt from: CR
Repo: ndycode/codex-multi-auth PR: 0
File: docs/releases/v2.2.0.md:0-0
Timestamp: 2026-06-02T12:30:22.264Z
Learning: Applies to docs/releases/**/fetch*.{js,ts,tsx} : Bound prompt and release-metadata fetches with connect and body timeouts that actually cancel stalled body reads
Applied to files:
lib/prompts/codex.ts
📚 Learning: 2026-06-03T06:06:56.293Z
Learnt from: CR
Repo: ndycode/codex-multi-auth PR: 0
File: docs/releases/v2.2.1.md:0-0
Timestamp: 2026-06-03T06:06:56.293Z
Learning: Applies to docs/releases/**/*forecast*.js : Forecast recommendations must exclude policy-blocked and token-exhausted accounts, returning no recommendation with a clear reason when none are available
Applied to files:
test/codex-manager-cli.test.ts
📚 Learning: 2026-05-31T13:20:01.197Z
Learnt from: CR
Repo: ndycode/codex-multi-auth PR: 0
File: docs/configuration.md:0-0
Timestamp: 2026-05-31T13:20:01.197Z
Learning: Keep recommended defaults enabled: `menuAutoFetchLimits`, `menuSortEnabled`, `liveAccountSync`, `sessionAffinity`, `proactiveRefreshGuardian`, and `preemptiveQuotaEnabled`
Applied to files:
lib/codex-manager.ts
📚 Learning: 2026-06-03T06:06:56.293Z
Learnt from: CR
Repo: ndycode/codex-multi-auth PR: 0
File: docs/releases/v2.2.1.md:0-0
Timestamp: 2026-06-03T06:06:56.293Z
Learning: Applies to docs/releases/**/*status*.js : Account status tone determination must consider the entire detail string, not just segments within parentheses, to ensure failed health checks always render as failures
Applied to files:
lib/codex-manager.ts
📚 Learning: 2026-06-02T04:49:43.051Z
Learnt from: CR
Repo: ndycode/codex-multi-auth PR: 0
File: SECURITY.md:0-0
Timestamp: 2026-06-02T04:49:43.051Z
Learning: Implement refresh-token lifecycle management and account health isolation in OAuth credential handling
Applied to files:
lib/codex-manager.ts
🔇 Additional comments (12)
lib/codex-manager/commands/report.ts (1)
130-130: LGTM!Also applies to: 144-144, 308-308
lib/codex-manager/forecast-report-commands.ts (1)
106-106: LGTM!Also applies to: 120-120, 130-130, 171-171
lib/codex-manager/repair-commands.ts (1)
145-145: LGTM!Also applies to: 197-197, 1200-1200
README.md (1)
199-199: LGTM!test/documentation.test.ts (1)
339-339: LGTM!test/quota-probe.test.ts (1)
87-101: LGTM!lib/quota-probe.ts (1)
56-62: LGTM!lib/runtime/quota-probe.ts (1)
6-7: LGTM!lib/prompts/codex.ts (1)
8-8: LGTM!Also applies to: 237-242, 469-469
lib/runtime-rotation-proxy.ts (1)
35-35: LGTM!Also applies to: 656-656
test/codex-prompts.test.ts (1)
121-150: LGTM!test/codex-manager-cli.test.ts (1)
748-748: LGTM!Also applies to: 1775-1775, 2972-2972, 3058-3058, 3104-3104, 3248-3250, 3259-3330, 3381-3381, 7129-7129, 7342-7342, 7347-7347, 9909-9917
There was a problem hiding this comment.
Actionable comments posted: 3
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
lib/runtime/quota-probe.ts (1)
5-11: 🧹 Nitpick | 🔵 Trivial | ⚡ Quick winadd the fallback regression for the two new probe models.
lib/runtime/quota-probe.ts:5-11prependsgpt-5.5andgpt-5.4, but the supplied vitest coverage only proves the happy path intest/runtime-quota-probe.test.ts:18. please add a case where both new models return an unsupported-model body and the loop still falls through togpt-5.3-codex; otherwise this retry chain can regress silently. Based on learnings: "Deprecated Codex selectors such asgpt-5-codexandgpt-5.1-codex*must be treated as compatibility aliases and retried on current documented Codex models".🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@lib/runtime/quota-probe.ts` around lines 5 - 11, The QUOTA_PROBE_MODELS array was extended with "gpt-5.5" and "gpt-5.4" but no regression test was added to ensure the probe falls back when those models return an unsupported-model response; add a test in test/runtime-quota-probe.test.ts that stubs the probe responses for "gpt-5.5" and "gpt-5.4" to return an unsupported-model body and asserts the loop continues and ultimately probes "gpt-5.3-codex" (verifying the compatibility alias retry behavior for deprecated codex selectors like gpt-5-codex/gpt-5.1-codex is preserved). Ensure the test targets the probe logic that iterates QUOTA_PROBE_MODELS and verifies fallback behavior rather than only the happy path.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@lib/codex-manager.ts`:
- Around line 701-702: Export a single canonical DEFAULT_LIVE_PROBE_MODEL
constant from the shared codex-manager entry point (or a new codex-manager
constants module) and replace all hard-coded "gpt-5.5" fallbacks with an import
of that constant; specifically change occurrences like cachedEntry?.model ??
"gpt-5.5" and the identical fallbacks in the
best/forecast/report/repair-commands command code to use
DEFAULT_LIVE_PROBE_MODEL so help text, JSON output, and cache fallback behavior
all reference the same exported value.
In `@lib/codex-manager/help.ts`:
- Line 1: Replace the locally defined DEFAULT_LIVE_PROBE_MODEL in
lib/codex-manager/help.ts with the canonical export from the shared model
mapping module: remove the const DEFAULT_LIVE_PROBE_MODEL = "gpt-5.5" and import
the shared DEFAULT_LIVE_PROBE_MODEL (or equivalent exported name) from the
project's model mapping module so help.ts uses that single source of truth;
update any references in help.ts to use the imported symbol.
- Line 152: Add a regression test that ensures printBestUsage prints the same
default model as parseBestArgs: write a unit test that spies on console.log,
calls printBestUsage(), and asserts the logged usage string includes the value
of DEFAULT_LIVE_PROBE_MODEL (the same constant used by parseBestArgs and
exported in lib/codex-manager/help.ts), and also add an assertion that
parseBestArgs([]) yields modelProvided: false and model equal to
DEFAULT_LIVE_PROBE_MODEL to lock the wiring between printing and parsing;
reference the functions printBestUsage and parseBestArgs in the test so future
changes to defaults will fail the test if they drift.
---
Outside diff comments:
In `@lib/runtime/quota-probe.ts`:
- Around line 5-11: The QUOTA_PROBE_MODELS array was extended with "gpt-5.5" and
"gpt-5.4" but no regression test was added to ensure the probe falls back when
those models return an unsupported-model response; add a test in
test/runtime-quota-probe.test.ts that stubs the probe responses for "gpt-5.5"
and "gpt-5.4" to return an unsupported-model body and asserts the loop continues
and ultimately probes "gpt-5.3-codex" (verifying the compatibility alias retry
behavior for deprecated codex selectors like gpt-5-codex/gpt-5.1-codex is
preserved). Ensure the test targets the probe logic that iterates
QUOTA_PROBE_MODELS and verifies fallback behavior rather than only the happy
path.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: ASSERTIVE
Plan: Pro
Run ID: c728be45-25ba-4f98-9998-432a00b0da6e
📒 Files selected for processing (24)
README.mdlib/codex-manager.tslib/codex-manager/commands/best.tslib/codex-manager/commands/forecast.tslib/codex-manager/commands/report.tslib/codex-manager/forecast-report-commands.tslib/codex-manager/help.tslib/codex-manager/repair-commands.tslib/integration-generators.tslib/prompts/codex.tslib/quota-probe.tslib/runtime-rotation-proxy.tslib/runtime/quota-probe.tspackage.jsonscripts/check-pack-budget-lib.jstest/check-pack-budget.test.tstest/codex-manager-cli.test.tstest/codex-manager-help.test.tstest/codex-manager-integrations-command.test.tstest/codex-prompts.test.tstest/documentation.test.tstest/package-bin.test.tstest/quota-probe.test.tstest/runtime-quota-probe.test.ts
📜 Review details
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
- GitHub Check: Greptile Review
🧰 Additional context used
📓 Path-based instructions (12)
package.json
📄 CodeRabbit inference engine (SECURITY.md)
package.json: Pinhonoto4.12.18or higher (but below4.12.0-4.12.1) to avoid GHSA-xh87-mx6m-69f3 authentication bypass vulnerability
Pinrollupto^4.59.0or higher to avoid vulnerable versions below4.59.0in Vite and Vitest transitive dependencies
Files:
package.json
lib/**/*.ts
📄 CodeRabbit inference engine (lib/AGENTS.md)
lib/**/*.ts: All public exports should flow throughlib/index.tsor documented package subpaths
Never import fromdist/in source tests or library code
Never suppress type errors
Files:
lib/codex-manager/commands/best.tslib/integration-generators.tslib/runtime/quota-probe.tslib/codex-manager/forecast-report-commands.tslib/quota-probe.tslib/runtime-rotation-proxy.tslib/codex-manager/repair-commands.tslib/codex-manager/commands/forecast.tslib/codex-manager/commands/report.tslib/prompts/codex.tslib/codex-manager/help.tslib/codex-manager.ts
**/*.ts
📄 CodeRabbit inference engine (AGENTS.md)
Do not use
as any,@ts-ignore, or@ts-expect-errortype assertions
Files:
lib/codex-manager/commands/best.tslib/integration-generators.tslib/runtime/quota-probe.tslib/codex-manager/forecast-report-commands.tslib/quota-probe.tstest/package-bin.test.tslib/runtime-rotation-proxy.tstest/codex-manager-help.test.tslib/codex-manager/repair-commands.tstest/quota-probe.test.tstest/check-pack-budget.test.tstest/codex-manager-integrations-command.test.tslib/codex-manager/commands/forecast.tstest/documentation.test.tslib/codex-manager/commands/report.tstest/codex-prompts.test.tstest/runtime-quota-probe.test.tslib/prompts/codex.tslib/codex-manager/help.tslib/codex-manager.tstest/codex-manager-cli.test.ts
**/*.{ts,js}
📄 CodeRabbit inference engine (AGENTS.md)
Use ESM module syntax exclusively; the project is ESM-only with
"type": "module"
Files:
lib/codex-manager/commands/best.tsscripts/check-pack-budget-lib.jslib/integration-generators.tslib/runtime/quota-probe.tslib/codex-manager/forecast-report-commands.tslib/quota-probe.tstest/package-bin.test.tslib/runtime-rotation-proxy.tstest/codex-manager-help.test.tslib/codex-manager/repair-commands.tstest/quota-probe.test.tstest/check-pack-budget.test.tstest/codex-manager-integrations-command.test.tslib/codex-manager/commands/forecast.tstest/documentation.test.tslib/codex-manager/commands/report.tstest/codex-prompts.test.tstest/runtime-quota-probe.test.tslib/prompts/codex.tslib/codex-manager/help.tslib/codex-manager.tstest/codex-manager-cli.test.ts
lib/**
⚙️ CodeRabbit configuration file
focus on auth rotation, windows filesystem IO, and concurrency. verify every change cites affected tests (vitest) and that new queues handle EBUSY/429 scenarios. check for logging that leaks tokens or emails.
Files:
lib/codex-manager/commands/best.tslib/integration-generators.tslib/runtime/quota-probe.tslib/codex-manager/forecast-report-commands.tslib/quota-probe.tslib/runtime-rotation-proxy.tslib/codex-manager/repair-commands.tslib/codex-manager/commands/forecast.tslib/codex-manager/commands/report.tslib/prompts/codex.tslib/codex-manager/help.tslib/codex-manager.ts
scripts/*.js
📄 CodeRabbit inference engine (AGENTS.md)
Windows filesystem operations must include retry handling for transient
EBUSY,EPERM, andENOTEMPTYerrors
Files:
scripts/check-pack-budget-lib.js
test/**/*.test.ts
📄 CodeRabbit inference engine (test/AGENTS.md)
test/**/*.test.ts: Vitest globals (describe,it,expect) are enabled and should be used without explicit imports
Maintain 80% coverage threshold across statements, branches, functions, and lines
UseremoveWithRetryfor Windows filesystem cleanup instead of barefs.rmto handle EBUSY/EPERM/ENOTEMPTY backoff
Use source files in tests, not compileddist/files; test the source directly
Do not skip tests without justification; include rationale if a test must be skipped
Relax ESLint rules for test files as specified ineslint.config.js
Files:
test/package-bin.test.tstest/codex-manager-help.test.tstest/quota-probe.test.tstest/check-pack-budget.test.tstest/codex-manager-integrations-command.test.tstest/documentation.test.tstest/codex-prompts.test.tstest/runtime-quota-probe.test.tstest/codex-manager-cli.test.ts
test/**/*.ts
📄 CodeRabbit inference engine (AGENTS.md)
Windows filesystem operations must include retry handling for transient
EBUSY,EPERM, andENOTEMPTYerrors where tests cover Windows locks
Files:
test/package-bin.test.tstest/codex-manager-help.test.tstest/quota-probe.test.tstest/check-pack-budget.test.tstest/codex-manager-integrations-command.test.tstest/documentation.test.tstest/codex-prompts.test.tstest/runtime-quota-probe.test.tstest/codex-manager-cli.test.ts
test/**
⚙️ CodeRabbit configuration file
tests must stay deterministic and use vitest. demand regression cases that reproduce concurrency bugs, token refresh races, and windows filesystem behavior. reject changes that mock real secrets or skip assertions.
Files:
test/package-bin.test.tstest/codex-manager-help.test.tstest/quota-probe.test.tstest/check-pack-budget.test.tstest/codex-manager-integrations-command.test.tstest/documentation.test.tstest/codex-prompts.test.tstest/runtime-quota-probe.test.tstest/codex-manager-cli.test.ts
lib/runtime-rotation-proxy.ts
📄 CodeRabbit inference engine (lib/AGENTS.md)
lib/runtime-rotation-proxy.ts: Runtime rotation code must preserve pass-through semantics except for auth/provider headers that intentionally change
Runtime proxy client-facing headers must not expose account emails or tokens
Runtime rotation should fail open to normal official Codex forwarding when startup helpers are unavailable
Never add account emails/tokens to runtime proxy client responsesDo not expose account emails or tokens in runtime proxy client response headers or logs
Files:
lib/runtime-rotation-proxy.ts
test/**/documentation.test.ts
📄 CodeRabbit inference engine (test/AGENTS.md)
Test documentation parity including command flags, config precedence, changelog policy, and governance rules
Files:
test/documentation.test.ts
test/**/codex-manager-cli.test.ts
📄 CodeRabbit inference engine (test/AGENTS.md)
Test CLI settings with question cancellation across all 5 panels and EBUSY/concurrent race conditions
Files:
test/codex-manager-cli.test.ts
🧠 Learnings (60)
📓 Common learnings
Learnt from: CR
Repo: ndycode/codex-multi-auth PR: 0
File: docs/releases/v2.2.0.md:0-0
Timestamp: 2026-06-02T12:30:22.264Z
Learning: Applies to docs/releases/**/quota*.{js,ts,tsx} : Detect unsupported Codex model from upstream error `detail` shape and surface a friendly 'Codex unavailable' note across `best` / `forecast` / `report` / live-check surfaces instead of leaking raw upstream text
Learnt from: CR
Repo: ndycode/codex-multi-auth PR: 0
File: README.md:0-0
Timestamp: 2026-06-03T06:06:23.734Z
Learning: Applies to **/quota-cache.json : Implement quota caching in `~/.codex/multi-auth/quota-cache.json` for account quota forecasting and health-aware selection
Learnt from: CR
Repo: ndycode/codex-multi-auth PR: 0
File: docs/configuration.md:0-0
Timestamp: 2026-05-31T13:20:01.197Z
Learning: Deprecated Codex selectors such as `gpt-5-codex` and `gpt-5.1-codex*` must be treated as compatibility aliases and retried on current documented Codex models
Learnt from: CR
Repo: ndycode/codex-multi-auth
Timestamp: 2026-06-03T06:25:07.919Z
Learning: Installation must support multiple methods: standard npm global install, migration from legacy scoped package `ndycode/codex-multi-auth`, and verification via version commands
Learnt from: CR
Repo: ndycode/codex-multi-auth
Timestamp: 2026-06-03T06:25:07.919Z
Learning: Storage paths should use `~/.codex/multi-auth/` as the root directory, with customization available via `CODEX_MULTI_AUTH_DIR` environment variable
Learnt from: CR
Repo: ndycode/codex-multi-auth
Timestamp: 2026-06-03T06:25:07.919Z
Learning: Runtime environment overrides should be supported via environment variables including `CODEX_MULTI_AUTH_DIR`, `CODEX_MODE`, `CODEX_MULTI_AUTH_RUNTIME_ROTATION_PROXY`, `CODEX_TUI_V2`, and others as documented
Learnt from: CR
Repo: ndycode/codex-multi-auth
Timestamp: 2026-06-03T06:25:07.919Z
Learning: Account storage files must include `openai-codex-accounts.json`, `openai-codex-flagged-accounts.json`, `quota-cache.json`, and `runtime-observability.json` at the configured root path
Learnt from: CR
Repo: ndycode/codex-multi-auth
Timestamp: 2026-06-03T06:25:07.919Z
Learning: Project-scoped accounts must be stored under `~/.codex/multi-auth/projects/<project-key>/openai-codex-accounts.json`
Learnt from: CR
Repo: ndycode/codex-multi-auth
Timestamp: 2026-06-03T06:25:07.919Z
Learning: Commands should be organized into three categories: start-here commands (`login`, `status`, `check`), daily-use commands (`list`, `switch`, `forecast`), and advanced commands (`report`, `fix`, `doctor`, etc.)
Learnt from: CR
Repo: ndycode/codex-multi-auth
Timestamp: 2026-06-03T06:25:07.919Z
Learning: Dashboard hotkeys must include navigation (`Up`/`Down`), selection (`Enter`), quick-switch (`1-9`), search (`/`), help toggle (`?`), and cancel (`Q`)
Learnt from: CR
Repo: ndycode/codex-multi-auth
Timestamp: 2026-06-03T06:25:07.919Z
Learning: Reliability behavior must include: disabled whole-pool replay when all accounts are rate-limited, bounded outbound request budget per prompt, short cooldown on repeated cross-account 5xx bursts, and staggered proactive refresh
Learnt from: CR
Repo: ndycode/codex-multi-auth
Timestamp: 2026-06-03T06:25:07.919Z
Learning: Responses background mode must remain opt-in via `backgroundResponses` setting in configuration or `CODEX_AUTH_BACKGROUND_RESPONSES=1` environment variable
Learnt from: CR
Repo: ndycode/codex-multi-auth
Timestamp: 2026-06-03T06:25:07.919Z
Learning: Runtime rotation must be enabled by default for request-bearing wrapper-launched Codex sessions, with explicit disable via `codex-multi-auth rotation disable` command
Learnt from: CR
Repo: ndycode/codex-multi-auth
Timestamp: 2026-06-03T06:25:07.919Z
Learning: Installed wrappers must perform best-effort daily npm version checks during normal forwarded Codex startup, printing manual notices only on interactive TTY or when `CODEX_MULTI_AUTH_DEBUG=1`, never automatically running npm install
Learnt from: CR
Repo: ndycode/codex-multi-auth
Timestamp: 2026-06-03T06:25:07.919Z
Learning: Experimental features in Settings menu must be non-destructive by default: sync previews before apply, preserve destination-only accounts, and fail safely on backup filename collisions
Learnt from: CR
Repo: ndycode/codex-multi-auth
Timestamp: 2026-06-03T06:25:07.919Z
Learning: Official package documentation must include: getting-started guide, features overview, configuration reference, troubleshooting guide, commands reference, public API contract, error contracts, settings reference, storage paths reference, upgrade guide, and privacy policy
Learnt from: CR
Repo: ndycode/codex-multi-auth
Timestamp: 2026-06-03T06:25:07.919Z
Learning: The package must publish three distinct global binaries: `codex-multi-auth` (primary account manager), `codex-multi-auth-codex` (optional forwarding wrapper), and `codex-multi-auth-app-launcher` (optional desktop launcher helper)
Learnt from: CR
Repo: ndycode/codex-multi-auth
Timestamp: 2026-06-03T06:25:07.919Z
Learning: The package must not publish a global `codex` binary; the official Codex CLI must own the `codex` command
📚 Learning: 2026-06-03T06:06:23.734Z
Learnt from: CR
Repo: ndycode/codex-multi-auth PR: 0
File: README.md:0-0
Timestamp: 2026-06-03T06:06:23.734Z
Learning: Use `npm i -g codex-multi-auth` as the standard installation command; migrate users from legacy scoped prerelease `ndycode/codex-multi-auth` with `npm uninstall -g ndycode/codex-multi-auth && npm i -g codex-multi-auth`
Applied to files:
package.jsonREADME.md
📚 Learning: 2026-06-02T12:29:38.793Z
Learnt from: CR
Repo: ndycode/codex-multi-auth PR: 0
File: AGENTS.md:0-0
Timestamp: 2026-06-02T12:29:38.793Z
Learning: Canonical package name is `codex-multi-auth` and canonical command family is `codex-multi-auth ...`
Applied to files:
package.jsonREADME.mdtest/documentation.test.ts
📚 Learning: 2026-06-02T12:29:38.793Z
Learnt from: CR
Repo: ndycode/codex-multi-auth PR: 0
File: AGENTS.md:0-0
Timestamp: 2026-06-02T12:29:38.793Z
Learning: Applies to lib/runtime-constants.ts : Use canonical runtime provider id `codex-multi-auth-runtime-proxy` in runtime constants
Applied to files:
package.jsonREADME.mdlib/runtime/quota-probe.tslib/runtime-rotation-proxy.tstest/runtime-quota-probe.test.ts
📚 Learning: 2026-06-03T06:06:23.734Z
Learnt from: CR
Repo: ndycode/codex-multi-auth PR: 0
File: README.md:0-0
Timestamp: 2026-06-03T06:06:23.734Z
Learning: Implement three distinct global binaries: `codex-multi-auth` for primary account management, `codex-multi-auth-codex` as optional forwarding wrapper, and `codex-multi-auth-app-launcher` as optional desktop launcher helper
Applied to files:
package.jsonREADME.mdtest/documentation.test.ts
📚 Learning: 2026-06-03T06:06:23.734Z
Learnt from: CR
Repo: ndycode/codex-multi-auth PR: 0
File: README.md:0-0
Timestamp: 2026-06-03T06:06:23.734Z
Learning: Applies to **/openai-codex-accounts.json : Store account credentials in `~/.codex/multi-auth/openai-codex-accounts.json` with support for per-project scoping at `~/.codex/multi-auth/projects/<project-key>/openai-codex-accounts.json`
Applied to files:
package.json
📚 Learning: 2026-05-31T13:20:14.049Z
Learnt from: CR
Repo: ndycode/codex-multi-auth PR: 0
File: docs/troubleshooting.md:0-0
Timestamp: 2026-05-31T13:20:14.049Z
Learning: Run `codex-multi-auth rotation bind-app` to enable multi-account routing in packaged Codex applications
Applied to files:
package.json
📚 Learning: 2026-05-31T13:20:14.049Z
Learnt from: CR
Repo: ndycode/codex-multi-auth PR: 0
File: docs/troubleshooting.md:0-0
Timestamp: 2026-05-31T13:20:14.049Z
Learning: Run `codex-multi-auth uninstall` before running `npm uninstall -g codex-multi-auth` to ensure complete cleanup of residual artifacts including plugin entries, cached modules, OS launchers, and app-bind state
Applied to files:
package.jsonREADME.mdtest/documentation.test.ts
📚 Learning: 2026-05-31T13:20:14.049Z
Learnt from: CR
Repo: ndycode/codex-multi-auth PR: 0
File: docs/troubleshooting.md:0-0
Timestamp: 2026-05-31T13:20:14.049Z
Learning: Run `codex-multi-auth doctor --fix` to automatically repair Codex CLI multi-account install and routing issues
Applied to files:
package.jsonREADME.mdlib/codex-manager/repair-commands.ts
📚 Learning: 2026-06-03T06:06:23.734Z
Learnt from: CR
Repo: ndycode/codex-multi-auth PR: 0
File: README.md:0-0
Timestamp: 2026-06-03T06:06:23.734Z
Learning: Perform best-effort daily npm version checks during normal forwarded Codex startup and print manual notice only on interactive TTY or when `CODEX_MULTI_AUTH_DEBUG=1`, never automatically run npm install commands
Applied to files:
package.jsonREADME.md
📚 Learning: 2026-05-31T13:20:14.049Z
Learnt from: CR
Repo: ndycode/codex-multi-auth PR: 0
File: docs/troubleshooting.md:0-0
Timestamp: 2026-05-31T13:20:14.049Z
Learning: Uninstall old scoped package `ndycode/codex-multi-auth` before installing the new unscoped `codex-multi-auth` package
Applied to files:
package.jsonREADME.mdtest/documentation.test.ts
📚 Learning: 2026-06-03T06:06:56.293Z
Learnt from: CR
Repo: ndycode/codex-multi-auth PR: 0
File: docs/releases/v2.2.1.md:0-0
Timestamp: 2026-06-03T06:06:56.293Z
Learning: Applies to docs/releases/scripts/mcodex.js : The mcodex launcher must be written in Node.js with zero bash dependency to ensure cross-platform compatibility on Windows and WSL environments
Applied to files:
package.jsontest/documentation.test.ts
📚 Learning: 2026-06-03T06:06:56.293Z
Learnt from: CR
Repo: ndycode/codex-multi-auth PR: 0
File: docs/releases/v2.2.1.md:0-0
Timestamp: 2026-06-03T06:06:56.293Z
Learning: Applies to docs/releases/**/*resolver*.js : The Codex bin resolver must skip any PATH candidate inside its own wrapper directory
Applied to files:
package.jsonscripts/check-pack-budget-lib.jstest/package-bin.test.tstest/check-pack-budget.test.tstest/documentation.test.ts
📚 Learning: 2026-06-03T06:06:56.293Z
Learnt from: CR
Repo: ndycode/codex-multi-auth PR: 0
File: docs/releases/v2.2.1.md:0-0
Timestamp: 2026-06-03T06:06:56.293Z
Learning: Applies to docs/releases/scripts/mcodex.js : The launcher must canonicalize symlinks on direct-run to ensure it runs correctly when invoked through an npm-created symlink bin
Applied to files:
package.jsonscripts/check-pack-budget-lib.jstest/documentation.test.ts
📚 Learning: 2026-06-02T12:30:22.264Z
Learnt from: CR
Repo: ndycode/codex-multi-auth PR: 0
File: docs/releases/v2.2.0.md:0-0
Timestamp: 2026-06-02T12:30:22.264Z
Learning: Applies to docs/releases/**/cache*.{js,ts,tsx} : Verify cached Codex instructions with SHA-256 digest; discard tampered cache, treat legacy entries without recorded digest as unverified, and never fast-path serve or drive conditional revalidation on unverified bytes
Applied to files:
package.jsonscripts/check-pack-budget-lib.jstest/package-bin.test.tslib/runtime-rotation-proxy.tstest/check-pack-budget.test.tstest/codex-prompts.test.tslib/prompts/codex.tstest/codex-manager-cli.test.ts
📚 Learning: 2026-06-03T06:06:56.293Z
Learnt from: CR
Repo: ndycode/codex-multi-auth PR: 0
File: docs/releases/v2.2.1.md:0-0
Timestamp: 2026-06-03T06:06:56.293Z
Learning: Applies to docs/releases/scripts/mcodex.js : POSIX tools like tmux and watch must be invoked as argv arrays instead of shell string interpolation to avoid shell dependency issues
Applied to files:
package.json
📚 Learning: 2026-06-02T12:29:38.793Z
Learnt from: CR
Repo: ndycode/codex-multi-auth PR: 0
File: AGENTS.md:0-0
Timestamp: 2026-06-02T12:29:38.793Z
Learning: Applies to scripts/codex.js : Set up runtime rotation proxy through shadow CODEX_HOME and forward non-auth commands to official Codex
Applied to files:
package.json
📚 Learning: 2026-06-02T12:29:38.793Z
Learnt from: CR
Repo: ndycode/codex-multi-auth PR: 0
File: AGENTS.md:0-0
Timestamp: 2026-06-02T12:29:38.793Z
Learning: Applies to scripts/codex-app-launcher.js : App launcher routing must not patch official Codex app binaries; use app bind or launcher helpers instead
Applied to files:
package.jsontest/documentation.test.ts
📚 Learning: 2026-06-02T12:29:38.793Z
Learnt from: CR
Repo: ndycode/codex-multi-auth PR: 0
File: AGENTS.md:0-0
Timestamp: 2026-06-02T12:29:38.793Z
Learning: Applies to scripts/codex.js : Handle shadow CODEX_HOME with temporary provider config, state sync-back, and lock cleanup while preserving official state
Applied to files:
package.json
📚 Learning: 2026-05-31T13:20:01.197Z
Learnt from: CR
Repo: ndycode/codex-multi-auth PR: 0
File: docs/configuration.md:0-0
Timestamp: 2026-05-31T13:20:01.197Z
Learning: Applies to docs/config/codex-modern.json : Configuration shipped templates must expose first-class current OpenAI model aliases, with `config/codex-modern.json` including `gpt-5.5` and `gpt-5.5-pro`
Applied to files:
README.mdlib/codex-manager/commands/best.tslib/runtime/quota-probe.tslib/codex-manager/forecast-report-commands.tslib/quota-probe.tslib/codex-manager/repair-commands.tstest/codex-manager-integrations-command.test.tslib/codex-manager/commands/forecast.tstest/documentation.test.tslib/codex-manager/commands/report.tstest/runtime-quota-probe.test.tslib/prompts/codex.tslib/codex-manager.tstest/codex-manager-cli.test.ts
📚 Learning: 2026-05-31T13:20:01.197Z
Learnt from: CR
Repo: ndycode/codex-multi-auth PR: 0
File: docs/configuration.md:0-0
Timestamp: 2026-05-31T13:20:01.197Z
Learning: Deprecated Codex selectors such as `gpt-5-codex` and `gpt-5.1-codex*` must be treated as compatibility aliases and retried on current documented Codex models
Applied to files:
README.mdlib/codex-manager/commands/best.tslib/runtime/quota-probe.tslib/quota-probe.tslib/codex-manager/repair-commands.tslib/codex-manager/commands/forecast.tslib/codex-manager/commands/report.tstest/codex-prompts.test.tstest/runtime-quota-probe.test.tslib/prompts/codex.tslib/codex-manager.tstest/codex-manager-cli.test.ts
📚 Learning: 2026-05-31T13:20:14.049Z
Learnt from: CR
Repo: ndycode/codex-multi-auth PR: 0
File: docs/troubleshooting.md:0-0
Timestamp: 2026-05-31T13:20:14.049Z
Learning: Include outputs from `codex-multi-auth report --json`, `codex-multi-auth doctor --json`, version commands, and full terminal output when opening bug reports for codex-multi-auth issues
Applied to files:
README.md
📚 Learning: 2026-06-03T06:06:23.734Z
Learnt from: CR
Repo: ndycode/codex-multi-auth PR: 0
File: README.md:0-0
Timestamp: 2026-06-03T06:06:23.734Z
Learning: Applies to **/runtime-observability.json : Store runtime observability metrics in `~/.codex/multi-auth/runtime-observability.json` and expose them via `codex-multi-auth status` and `codex-multi-auth report --json` commands
Applied to files:
README.md
📚 Learning: 2026-06-03T06:06:23.734Z
Learnt from: CR
Repo: ndycode/codex-multi-auth PR: 0
File: README.md:0-0
Timestamp: 2026-06-03T06:06:23.734Z
Learning: Provide machine-readable JSON output from diagnostic commands via `--json` flags for `status`, `report`, `verify-flagged`, `check`, `doctor`, `monitor`, and `why-selected` to enable automation
Applied to files:
README.md
📚 Learning: 2026-06-03T06:06:38.259Z
Learnt from: CR
Repo: ndycode/codex-multi-auth PR: 0
File: docs/README.md:0-0
Timestamp: 2026-06-03T06:06:38.259Z
Learning: Applies to docs/**/*.md : Documentation files must follow the directory structure and navigation hierarchy defined in the codex-multi-auth documentation portal, with primary sections organized as: Start Here, Daily Use, Release History, Repair, Reference, Maintainer Docs, and Governance
Applied to files:
README.md
📚 Learning: 2026-06-02T12:29:38.793Z
Learnt from: CR
Repo: ndycode/codex-multi-auth PR: 0
File: AGENTS.md:0-0
Timestamp: 2026-06-02T12:29:38.793Z
Learning: Local project-owned state defaults to `~/.codex/multi-auth`; official Codex state remains under `~/.codex`
Applied to files:
README.md
📚 Learning: 2026-06-02T12:30:22.264Z
Learnt from: CR
Repo: ndycode/codex-multi-auth PR: 0
File: docs/releases/v2.2.0.md:0-0
Timestamp: 2026-06-02T12:30:22.264Z
Learning: Applies to docs/releases/**/quota*.{js,ts,tsx} : Detect unsupported Codex model from upstream error `detail` shape and surface a friendly 'Codex unavailable' note across `best` / `forecast` / `report` / live-check surfaces instead of leaking raw upstream text
Applied to files:
lib/codex-manager/commands/best.tslib/runtime/quota-probe.tslib/codex-manager/forecast-report-commands.tslib/quota-probe.tslib/codex-manager/repair-commands.tstest/quota-probe.test.tslib/codex-manager/commands/forecast.tstest/documentation.test.tslib/codex-manager/commands/report.tstest/runtime-quota-probe.test.tslib/prompts/codex.tslib/codex-manager/help.tslib/codex-manager.tstest/codex-manager-cli.test.ts
📚 Learning: 2026-06-02T12:30:22.264Z
Learnt from: CR
Repo: ndycode/codex-multi-auth PR: 0
File: docs/releases/v2.2.0.md:0-0
Timestamp: 2026-06-02T12:30:22.264Z
Learning: Applies to docs/releases/**/path*.{js,ts,tsx} : Reject NUL-byte paths in `resolvePath` as a defense-in-depth measure
Applied to files:
scripts/check-pack-budget-lib.js
📚 Learning: 2026-06-03T06:06:23.734Z
Learnt from: CR
Repo: ndycode/codex-multi-auth PR: 0
File: README.md:0-0
Timestamp: 2026-06-03T06:06:23.734Z
Learning: Applies to **/quota-cache.json : Implement quota caching in `~/.codex/multi-auth/quota-cache.json` for account quota forecasting and health-aware selection
Applied to files:
lib/runtime/quota-probe.tstest/quota-probe.test.tslib/codex-manager.ts
📚 Learning: 2026-05-31T14:24:04.131Z
Learnt from: CR
Repo: ndycode/codex-multi-auth PR: 0
File: docs/releases/v2.1.13-beta.2.md:0-0
Timestamp: 2026-05-31T14:24:04.131Z
Learning: Applies to docs/releases/**/*{config,rotation,schema}*.test.{ts,js} : Write tests for minRotationIntervalMs sliding-anchor and sticky-window coverage; schema and config coverage for new knobs with min(0), allows-zero, rejects-string validation
Applied to files:
test/package-bin.test.tstest/check-pack-budget.test.ts
📚 Learning: 2026-05-31T14:24:04.131Z
Learnt from: CR
Repo: ndycode/codex-multi-auth PR: 0
File: docs/releases/v2.1.13-beta.2.md:0-0
Timestamp: 2026-05-31T14:24:04.131Z
Learning: Applies to docs/releases/**/*{builder,error,response}*.test.{ts,js} : Write unit tests for invalidation body builder covering all message-extraction branches: top-level message, nested error.message, top-level-wins priority, blank-to-nested fallback, non-JSON body, and no-usable-message fallback
Applied to files:
test/package-bin.test.tstest/codex-manager-help.test.tstest/check-pack-budget.test.tstest/codex-prompts.test.tstest/codex-manager-cli.test.ts
📚 Learning: 2026-06-02T12:29:38.793Z
Learnt from: CR
Repo: ndycode/codex-multi-auth PR: 0
File: AGENTS.md:0-0
Timestamp: 2026-06-02T12:29:38.793Z
Learning: Applies to lib/rotation.ts : Runtime rotation is default-on through `codexRuntimeRotationProxy`; respect `CODEX_MULTI_AUTH_RUNTIME_ROTATION_PROXY=0` opt-out
Applied to files:
lib/runtime-rotation-proxy.ts
📚 Learning: 2026-06-02T12:29:38.793Z
Learnt from: CR
Repo: ndycode/codex-multi-auth PR: 0
File: AGENTS.md:0-0
Timestamp: 2026-06-02T12:29:38.793Z
Learning: Applies to lib/runtime-rotation-proxy.ts : Do not expose account emails or tokens in runtime proxy client response headers or logs
Applied to files:
lib/runtime-rotation-proxy.ts
📚 Learning: 2026-06-02T12:30:22.264Z
Learnt from: CR
Repo: ndycode/codex-multi-auth PR: 0
File: docs/releases/v2.2.0.md:0-0
Timestamp: 2026-06-02T12:30:22.264Z
Learning: Applies to docs/releases/**/proxy*.{js,ts,tsx} : Bind runtime rotation proxy and local bridge to loopback-only with no opt-out; never forward inbound client credentials (`authorization`, `x-api-key`, `cookie`, `proxy-authorization`) upstream alongside the managed token
Applied to files:
lib/runtime-rotation-proxy.ts
📚 Learning: 2026-06-02T12:29:38.793Z
Learnt from: CR
Repo: ndycode/codex-multi-auth PR: 0
File: AGENTS.md:0-0
Timestamp: 2026-06-02T12:29:38.793Z
Learning: The runtime rotation proxy is loopback-only, uses per-process client token, and forwards only Responses API and model discovery requests
Applied to files:
lib/runtime-rotation-proxy.ts
📚 Learning: 2026-06-02T12:30:22.264Z
Learnt from: CR
Repo: ndycode/codex-multi-auth PR: 0
File: docs/releases/v2.2.0.md:0-0
Timestamp: 2026-06-02T12:30:22.264Z
Learning: Applies to docs/releases/**/account*.{js,ts,tsx} : Implement atomic, self-healing account store with checksummed WAL and temp-and-rename writes that self-heal on read when encountering torn writes
Applied to files:
lib/runtime-rotation-proxy.ts
📚 Learning: 2026-06-03T06:06:56.293Z
Learnt from: CR
Repo: ndycode/codex-multi-auth PR: 0
File: docs/releases/v2.2.1.md:0-0
Timestamp: 2026-06-03T06:06:56.293Z
Learning: Applies to docs/releases/**/*routing*.js : Account selection with routingMutex enabled must run inside a single reentrant mutex acquisition to prevent concurrent requests from reading the same cursor
Applied to files:
lib/runtime-rotation-proxy.ts
📚 Learning: 2026-06-02T12:30:22.264Z
Learnt from: CR
Repo: ndycode/codex-multi-auth PR: 0
File: docs/releases/v2.2.0.md:0-0
Timestamp: 2026-06-02T12:30:22.264Z
Learning: Applies to docs/releases/**/config*.{js,ts,tsx} : Remove synchronous `Atomics.wait` sleeps from config load and logger directory-creation paths; use retry logic without freezing the event loop
Applied to files:
lib/runtime-rotation-proxy.ts
📚 Learning: 2026-06-02T12:30:22.264Z
Learnt from: CR
Repo: ndycode/codex-multi-auth PR: 0
File: docs/releases/v2.2.0.md:0-0
Timestamp: 2026-06-02T12:30:22.264Z
Learning: Applies to docs/releases/**/account*.{js,ts,tsx} : Retry account-store WAL/temp writes, cleanup, backup operations, quota-cache, flagged-store, and export operations using shared transient-lock taxonomy (EBUSY/EPERM/ENOTEMPTY/EACCES/EAGAIN) on Windows
Applied to files:
lib/runtime-rotation-proxy.ts
📚 Learning: 2026-06-02T12:29:38.793Z
Learnt from: CR
Repo: ndycode/codex-multi-auth PR: 0
File: AGENTS.md:0-0
Timestamp: 2026-06-02T12:29:38.793Z
Learning: Applies to index.ts : Export optional plugin-host runtime entry for compatibility; primary product surface is account manager, wrapper, storage, runtime proxy, and repair tooling
Applied to files:
lib/runtime-rotation-proxy.ts
📚 Learning: 2026-06-02T12:30:22.264Z
Learnt from: CR
Repo: ndycode/codex-multi-auth PR: 0
File: docs/releases/v2.2.0.md:0-0
Timestamp: 2026-06-02T12:30:22.264Z
Learning: Applies to docs/releases/**/storage*.{js,ts,tsx} : Validate stored message/part record ids before using them to build filesystem paths; quarantine parseable-but-unsafe ids (e.g., `../poison`) or non-numeric `time.created` values to prevent path-traversal attacks
Applied to files:
lib/runtime-rotation-proxy.ts
📚 Learning: 2026-06-03T06:06:23.734Z
Learnt from: CR
Repo: ndycode/codex-multi-auth PR: 0
File: README.md:0-0
Timestamp: 2026-06-03T06:06:23.734Z
Learning: Maintain session affinity, live account sync, proactive refresh, and preemptive quota deferral controls for reliable multi-account routing
Applied to files:
lib/runtime-rotation-proxy.ts
📚 Learning: 2026-05-31T14:24:04.131Z
Learnt from: CR
Repo: ndycode/codex-multi-auth PR: 0
File: docs/releases/v2.1.13-beta.2.md:0-0
Timestamp: 2026-05-31T14:24:04.131Z
Learning: Applies to docs/releases/**/*{rotation,scheduler,timing,auth}*.{ts,js} : Implement minRotationIntervalMs sticky window (configurable sliding anchor via CODEX_AUTH_MIN_ROTATION_INTERVAL_MS or minRotationIntervalMs, default 60s) to boost the last-served account and reduce presenting different OAuth tokens from the same IP
Applied to files:
lib/runtime-rotation-proxy.tslib/codex-manager.ts
📚 Learning: 2026-06-02T12:29:38.793Z
Learnt from: CR
Repo: ndycode/codex-multi-auth PR: 0
File: AGENTS.md:0-0
Timestamp: 2026-06-02T12:29:38.793Z
Learning: Applies to lib/request/request-transformer.ts : Forward non-auth commands to official Codex CLI without reimplementing general Codex commands in the wrapper
Applied to files:
test/codex-manager-help.test.tstest/documentation.test.ts
📚 Learning: 2026-05-31T14:24:04.131Z
Learnt from: CR
Repo: ndycode/codex-multi-auth PR: 0
File: docs/releases/v2.1.13-beta.2.md:0-0
Timestamp: 2026-05-31T14:24:04.131Z
Learning: Applies to docs/releases/**/*{auth,rotation,401}*.test.{ts,js} : Write unit tests covering upstream-401 invalidation path (401 to client, ~5-minute cooldown, clears affinity, no rotation) and regression guard for generic 401 rotation
Applied to files:
test/quota-probe.test.tslib/codex-manager.tstest/codex-manager-cli.test.ts
📚 Learning: 2026-05-31T13:20:01.197Z
Learnt from: CR
Repo: ndycode/codex-multi-auth PR: 0
File: docs/configuration.md:0-0
Timestamp: 2026-05-31T13:20:01.197Z
Learning: Applies to docs/**/.codex/multi-auth/settings.json : Settings JSON file must conform to the canonical shape including `version`, `dashboardDisplaySettings`, and `pluginConfig` objects
Applied to files:
test/check-pack-budget.test.ts
📚 Learning: 2026-06-03T06:06:23.734Z
Learnt from: CR
Repo: ndycode/codex-multi-auth PR: 0
File: README.md:0-0
Timestamp: 2026-06-03T06:06:23.734Z
Learning: Applies to docs/**/*.md : Maintain command-line help and documentation in markdown files at `docs/` directory with reference sections for commands, public API, error contracts, settings, and storage paths
Applied to files:
test/documentation.test.ts
📚 Learning: 2026-05-31T14:24:04.131Z
Learnt from: CR
Repo: ndycode/codex-multi-auth PR: 0
File: docs/releases/v2.1.13-beta.2.md:0-0
Timestamp: 2026-05-31T14:24:04.131Z
Learning: Applies to docs/releases/**/*{refresh,error,builder,auth}*.test.{ts,js} : Write unit tests covering refresh-endpoint invalidation returning code: "token_invalidated" routed through shared body builder
Applied to files:
test/codex-prompts.test.tslib/codex-manager.tstest/codex-manager-cli.test.ts
📚 Learning: 2026-06-03T06:06:56.293Z
Learnt from: CR
Repo: ndycode/codex-multi-auth PR: 0
File: docs/releases/v2.2.1.md:0-0
Timestamp: 2026-06-03T06:06:56.293Z
Learning: Applies to docs/releases/**/*cache*.js : Codex CLI state cache must honor forceRefresh even with a load in flight, guarded by load generation to prevent stale reads from overwriting fresh snapshots
Applied to files:
test/codex-prompts.test.tslib/prompts/codex.tslib/codex-manager.tstest/codex-manager-cli.test.ts
📚 Learning: 2026-06-02T12:30:22.264Z
Learnt from: CR
Repo: ndycode/codex-multi-auth PR: 0
File: docs/releases/v2.2.0.md:0-0
Timestamp: 2026-06-02T12:30:22.264Z
Learning: Applies to docs/releases/**/fetch*.{js,ts,tsx} : Bound prompt and release-metadata fetches with connect and body timeouts that actually cancel stalled body reads
Applied to files:
lib/prompts/codex.ts
📚 Learning: 2026-05-31T14:24:04.131Z
Learnt from: CR
Repo: ndycode/codex-multi-auth PR: 0
File: docs/releases/v2.1.13-beta.2.md:0-0
Timestamp: 2026-05-31T14:24:04.131Z
Learning: Applies to docs/releases/**/*{401,auth,handler,rotation,oauth}*.{ts,js} : Detect explicit token-invalidation responses in 401 handlers by reading response body and checking for invalidation phrases (e.g., 'invalidated oauth token', 'authentication token has been invalidated')
Applied to files:
lib/codex-manager.ts
📚 Learning: 2026-05-31T14:24:04.131Z
Learnt from: CR
Repo: ndycode/codex-multi-auth PR: 0
File: docs/releases/v2.1.13-beta.2.md:0-0
Timestamp: 2026-05-31T14:24:04.131Z
Learning: Applies to docs/releases/**/*{auth,handler,401,rotation}*.{ts,js} : Distinguish token invalidation 401s from generic expired-token 401s; continue rotating for generic 401s (expired tokens, wrong credentials) but stop on explicit invalidation detection
Applied to files:
lib/codex-manager.ts
📚 Learning: 2026-06-03T06:06:56.293Z
Learnt from: CR
Repo: ndycode/codex-multi-auth PR: 0
File: docs/releases/v2.2.1.md:0-0
Timestamp: 2026-06-03T06:06:56.293Z
Learning: Applies to docs/releases/**/*{verify,bearer}*.js : Bearer token verification hot path writes to lastUsedAt must be debounced to keep steady-state verification in-memory
Applied to files:
lib/codex-manager.ts
📚 Learning: 2026-05-31T14:24:04.131Z
Learnt from: CR
Repo: ndycode/codex-multi-auth PR: 0
File: docs/releases/v2.1.13-beta.2.md:0-0
Timestamp: 2026-05-31T14:24:04.131Z
Learning: Applies to docs/releases/**/*{auth,rotation,config,handler}*.{ts,js} : Apply a long cooldown (5 minutes via CODEX_AUTH_TOKEN_INVALIDATION_COOLDOWN_MS or tokenInvalidationCooldownMs) on invalidated accounts
Applied to files:
lib/codex-manager.ts
📚 Learning: 2026-05-31T14:24:04.131Z
Learnt from: CR
Repo: ndycode/codex-multi-auth PR: 0
File: docs/releases/v2.1.13-beta.2.md:0-0
Timestamp: 2026-05-31T14:24:04.131Z
Learning: Applies to docs/releases/**/*{error,builder,response,auth}*.{ts,js} : Emit consistent client error contract: { error: { message, code: "token_invalidated" } } for both invalidation exit paths (refresh-failure and upstream-401) through a single shared builder
Applied to files:
lib/codex-manager.ts
📚 Learning: 2026-06-03T06:06:56.293Z
Learnt from: CR
Repo: ndycode/codex-multi-auth PR: 0
File: docs/releases/v2.2.1.md:0-0
Timestamp: 2026-06-03T06:06:56.293Z
Learning: Applies to docs/releases/**/*.js : The styleQuotaSummary function must clamp out-of-range percentages to valid bounds
Applied to files:
lib/codex-manager.ts
📚 Learning: 2026-06-03T06:06:56.293Z
Learnt from: CR
Repo: ndycode/codex-multi-auth PR: 0
File: docs/releases/v2.2.1.md:0-0
Timestamp: 2026-06-03T06:06:56.293Z
Learning: Applies to docs/releases/**/*status*.js : Account status tone determination must consider the entire detail string, not just segments within parentheses, to ensure failed health checks always render as failures
Applied to files:
lib/codex-manager.ts
📚 Learning: 2026-05-31T13:20:01.197Z
Learnt from: CR
Repo: ndycode/codex-multi-auth PR: 0
File: docs/configuration.md:0-0
Timestamp: 2026-05-31T13:20:01.197Z
Learning: Keep recommended defaults enabled: `menuAutoFetchLimits`, `menuSortEnabled`, `liveAccountSync`, `sessionAffinity`, `proactiveRefreshGuardian`, and `preemptiveQuotaEnabled`
Applied to files:
lib/codex-manager.ts
📚 Learning: 2026-06-02T04:49:43.051Z
Learnt from: CR
Repo: ndycode/codex-multi-auth PR: 0
File: SECURITY.md:0-0
Timestamp: 2026-06-02T04:49:43.051Z
Learning: Implement refresh-token lifecycle management and account health isolation in OAuth credential handling
Applied to files:
lib/codex-manager.ts
📚 Learning: 2026-06-03T06:06:56.293Z
Learnt from: CR
Repo: ndycode/codex-multi-auth PR: 0
File: docs/releases/v2.2.1.md:0-0
Timestamp: 2026-06-03T06:06:56.293Z
Learning: Applies to docs/releases/**/*forecast*.js : Forecast recommendations must exclude policy-blocked and token-exhausted accounts, returning no recommendation with a clear reason when none are available
Applied to files:
test/codex-manager-cli.test.ts
🔇 Additional comments (19)
scripts/check-pack-budget-lib.js (1)
17-17: duplicate: exact manifest path is still validated as a prefix match.same previously raised issue. this still allows suffix spoof paths to satisfy the check and is not covered by the new regression at test/check-pack-budget.test.ts:112.
Also applies to: 103-106
package.json (1)
3-3: LGTM!Also applies to: 117-117, 123-123, 133-133
test/check-pack-budget.test.ts (1)
99-100: LGTM!Also applies to: 112-128, 135-136, 161-162, 176-177
test/package-bin.test.ts (1)
17-23: LGTM!test/codex-manager-cli.test.ts (1)
748-748: LGTM!Also applies to: 1775-1775, 2972-2972, 3058-3058, 3104-3104, 3248-3250, 3259-3330, 3381-3381, 7129-7129, 7342-7342, 7347-7347, 9909-9917
test/codex-manager-help.test.ts (1)
92-100: LGTM!README.md (2)
199-199: LGTM!
386-387: LGTM!test/codex-manager-integrations-command.test.ts (1)
18-18: LGTM!test/runtime-quota-probe.test.ts (2)
45-45: LGTM!
93-93: LGTM!lib/codex-manager.ts (1)
2406-2410: still skips the live probe after a refresh failure.
lib/codex-manager.ts:2406still incrementssignedInOnlywhensessionLikelyValidis true, so a transient refresh failure can undercountcodexAvailableand overcountsignedInOnlywithout ever probing the current access token. this is the same issue already raised for this path, and it still needs the current-token probe plus a vitest regression intest/codex-manager-cli.test.ts.test/documentation.test.ts (1)
339-339: validated changed expectations are consistent with the new defaults.checked
test/documentation.test.ts:339andtest/documentation.test.ts:582; no blocking issues found.Also applies to: 582-582
lib/quota-probe.ts (1)
56-62: fallback model order change looks safe.checked
lib/quota-probe.ts:56-62; behavior matches the live-probe default rollout with no additional risk introduced.lib/integration-generators.ts (1)
1-1: shared default-model import is the right direction.checked
lib/integration-generators.ts:1; no issues.lib/prompts/codex.ts (1)
8-8: default-model unification and prewarm update look correct.checked
lib/prompts/codex.ts:8,lib/prompts/codex.ts:241, andlib/prompts/codex.ts:469; no blocking concerns.Also applies to: 237-241, 469-469
lib/runtime-rotation-proxy.ts (1)
355-395: concurrency and auth-ordering updates look sound in the touched paths.checked
lib/runtime-rotation-proxy.ts:355-395,lib/runtime-rotation-proxy.ts:560-574,lib/runtime-rotation-proxy.ts:729,lib/runtime-rotation-proxy.ts:1596-1605, andlib/runtime-rotation-proxy.ts:1740-1788; no blocking issues identified.Also applies to: 408-447, 560-574, 729-729, 1596-1605, 1740-1788
test/quota-probe.test.ts (1)
87-101: good regression coverage for default probe model.checked
test/quota-probe.test.ts:87-101; this is deterministic and covers the intended default-model behavior.test/codex-prompts.test.ts (1)
121-150: default prompt-family regression guard is solid.checked
test/codex-prompts.test.ts:121-150; coverage is appropriate for the model-default change.
…nings column, consolidate default model Addresses CodeRabbit + Greptile review of ndycode#506: - --model/-m and --model= now reject a flag-like next token (starts with '-') instead of silently consuming it, across ALL parse sites: best (codex-manager.ts), forecast, report, and forecast-report-commands (x2). 'forecast --model --json' / 'best --model --live' now report "Missing value for --model" instead of eating the next flag. Added regression tests for both. - live-check summary: dropped the 'warnings' column, which is identical to 'signed in only' in live-probe mode (every increment site bumps both), so it added no information. - consolidated the default probe model to the canonical DEFAULT_MODEL export (lib/request/helpers/model-map.ts) instead of scattered hardcoded 'gpt-5.5' literals and local DEFAULT_LIVE_PROBE_MODEL copies in the command layer, so the default has a single source of truth. Value-neutral (DEFAULT_MODEL is 'gpt-5.5'). - updated a stale report-command test asserting the old gpt-5.3-codex default. Full suite: 4352 passed, 3 skipped, 0 failed; typecheck + lint clean. Co-Authored-By: Claude Opus 4.8 <[email protected]>
There was a problem hiding this comment.
Actionable comments posted: 2
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (3)
lib/codex-manager/help.ts (1)
185-210:⚠️ Potential issue | 🔴 Critical | ⚡ Quick winparseBestArgs is missing the flag-like --model value validation.
forecast.ts:177-179 and forecast-report-commands.ts:147,188 both reject values starting with
-to prevent flag-like strings (e.g.,--model --json) from being consumed as the model name. parseBestArgs only checks!valuebut accepts--jsonas a model value when the user typescodex-multi-auth best --model --json.this violates the pr objective "reject flag-like --model values across all parse sites" and creates inconsistent cli behavior across best/forecast/report commands.
🔧 add flag-like value rejection
if (arg === "--model" || arg === "-m") { const value = args[i + 1]; - if (!value) { + if (!value || value.startsWith("-")) { return { ok: false, reason: "error", message: "Missing value for --model", }; } options.model = value; options.modelProvided = true; i += 1; continue; } if (arg.startsWith("--model=")) { const value = arg.slice("--model=".length).trim(); - if (!value) { + if (!value || value.startsWith("-")) { return { ok: false, reason: "error", message: "Missing value for --model", }; } options.model = value; options.modelProvided = true; continue; }also add regression tests in test/codex-manager-help.test.ts mirroring test/codex-manager-forecast-command.test.ts:137-150 to lock this behavior.
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@lib/codex-manager/help.ts` around lines 185 - 210, parseBestArgs currently accepts a value for --model that starts with '-' (e.g., --json) because it only checks for empty value; update the parsing branches that handle "--model" / "-m" and "--model=" in parseBestArgs to reject flag-like values by checking if the resolved value startsWith("-") and, if so, return the same error object used elsewhere ("ok:false, reason:'error', message:'Missing value for --model'") instead of accepting it; also add regression tests in test/codex-manager-help.test.ts that mirror test/codex-manager-forecast-command.test.ts:137-150 to assert that flag-like model values are rejected for the best command.lib/codex-manager/repair-commands.ts (1)
215-230:⚠️ Potential issue | 🔴 Critical | ⚡ Quick winparseFixArgs is missing the flag-like --model value validation.
lib/codex-manager/commands/forecast.ts:177-179 and lib/codex-manager/forecast-report-commands.ts:147,188 both reject
--modelvalues starting with-, but parseFixArgs only checks!value. this letscodex-multi-auth fix --model --jsonconsume--jsonas the model name instead of treating it as a separate flag.the pr objective says "reject flag-like --model values across all parse sites" and the layer description includes the fix command, but this validation is missing here.
🔧 add flag-like value rejection
if (argValue === "--model" || argValue === "-m") { const value = args[i + 1]; - if (!value) { + if (!value || value.startsWith("-")) { return { ok: false, message: "Missing value for --model" }; } options.model = value; i += 1; continue; } if (argValue.startsWith("--model=")) { const value = argValue.slice("--model=".length).trim(); - if (!value) { + if (!value || value.startsWith("-")) { return { ok: false, message: "Missing value for --model" }; } options.model = value; continue; }also add regression tests in the fix command test suite mirroring test/codex-manager-forecast-command.test.ts:137-150.
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@lib/codex-manager/repair-commands.ts` around lines 215 - 230, parseFixArgs currently only checks for a missing value when handling "--model"/"-m" and "--model=" but allows flag-like values (strings starting with "-"), which causes flags like "--json" to be consumed as the model. In parseFixArgs, after computing value (for both the "--model" branch and the "--model=" branch), add a validation that rejects values starting with "-" (e.g., if value.startsWith("-") return { ok: false, message: "Missing value for --model" } or similar consistent error) before setting options.model; reference argValue, parseFixArgs, and options.model to locate the spots. Also add regression tests to the fix command test suite mirroring the existing tests in test/codex-manager-forecast-command.test.ts:137-150 to assert that flag-like values for --model are rejected.lib/codex-manager/commands/report.ts (1)
131-131: 🛠️ Refactor suggestion | 🟠 Major | ⚡ Quick winremove hardcoded default model from help text.
lib/codex-manager/commands/report.ts:131hardcodesgpt-5.5while parse/runtime now useDEFAULT_MODEL. wire help text to the same constant to avoid drift on the next model bump.🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@lib/codex-manager/commands/report.ts` at line 131, The help text in the report command hardcodes "gpt-5.5"; update the option help to reference the shared DEFAULT_MODEL constant instead. In lib/codex-manager/commands/report.ts, replace the literal "gpt-5.5" in the option string (the line that reads like " --model, -m Probe model for live mode (default: gpt-5.5)") to include DEFAULT_MODEL (e.g., build the string with the constant), and if DEFAULT_MODEL is not already imported, import it from the module that defines it so the help stays in sync with runtime defaults.
♻️ Duplicate comments (1)
lib/codex-manager/help.ts (1)
3-3: 🛠️ Refactor suggestion | 🟠 Major | ⚡ Quick winthe local constant creates an unnecessary layer of indirection.
lib/codex-manager/help.ts:3 defines DEFAULT_LIVE_PROBE_MODEL just to assign it DEFAULT_MODEL. past review already flagged this: "use a single source of truth for the live probe default." either use DEFAULT_MODEL directly in lines 154 and 167, or import a canonical DEFAULT_LIVE_PROBE_MODEL from model-map.ts if that distinction matters across the codebase.
♻️ remove the indirection
-import { DEFAULT_MODEL } from "../request/helpers/model-map.js"; - -const DEFAULT_LIVE_PROBE_MODEL = DEFAULT_MODEL; +import { DEFAULT_MODEL } from "../request/helpers/model-map.js"; export function printBestUsage(): void { console.log( [ "Usage:", " codex-multi-auth best [--live] [--json] [--model <model>]", "", "Options:", " --live, -l Probe live quota headers via Codex backend before switching", " --json, -j Print machine-readable JSON output", - ` --model, -m Probe model for live mode (default: ${DEFAULT_LIVE_PROBE_MODEL})`, + ` --model, -m Probe model for live mode (default: ${DEFAULT_MODEL})`, "", "Behavior:", " - Chooses the healthiest account using forecast scoring", " - Switches to the recommended account when it is not already active", ].join("\n"), ); } export function parseBestArgs(args: string[]): ParsedBestArgs { const options: BestCliOptions = { live: false, json: false, - model: DEFAULT_LIVE_PROBE_MODEL, + model: DEFAULT_MODEL, modelProvided: false, };🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@lib/codex-manager/help.ts` at line 3, Remove the unnecessary indirection: delete the local constant DEFAULT_LIVE_PROBE_MODEL and replace its usages with the canonical DEFAULT_MODEL (i.e., use DEFAULT_MODEL directly where DEFAULT_LIVE_PROBE_MODEL is referenced), or if a distinct default is required across the codebase, import the canonical DEFAULT_LIVE_PROBE_MODEL from model-map.ts instead of defining it locally; update all references (places currently referencing DEFAULT_LIVE_PROBE_MODEL) to use the chosen symbol so there is a single source of truth.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@lib/codex-manager/commands/report.ts`:
- Around line 168-174: The parser currently validates the split-arg form for
--model by checking value.startsWith("-") on the raw token, which lets quoted or
whitespace-only tokens slip through; in the argument-parsing loop (the branch
handling arg === "--model" || arg === "-m") trim the token first (const value =
args[i+1].trim()), then validate against empty string and leading "-" and only
after that assign to options.model and increment i; also add regression tests in
test/codex-manager-report-command.test.ts covering --model " " and --model "
-x" to assert deterministic failure handling.
In `@test/codex-manager-report-command.test.ts`:
- Around line 520-524: The test hardcodes "gpt-5.5" when asserting
deps.fetchCodexQuotaSnapshot; instead import and use the shared live-probe
default model constant exported by the codex manager (the same constant
lib/codex-manager uses for its live probe default) and replace the literal model
value in the toHaveBeenCalledWith assertion with that constant (i.e., import the
exported shared default and use model: <LIVE_PROBE_DEFAULT_MODEL_CONSTANT> in
the expectation).
---
Outside diff comments:
In `@lib/codex-manager/commands/report.ts`:
- Line 131: The help text in the report command hardcodes "gpt-5.5"; update the
option help to reference the shared DEFAULT_MODEL constant instead. In
lib/codex-manager/commands/report.ts, replace the literal "gpt-5.5" in the
option string (the line that reads like " --model, -m Probe model for
live mode (default: gpt-5.5)") to include DEFAULT_MODEL (e.g., build the string
with the constant), and if DEFAULT_MODEL is not already imported, import it from
the module that defines it so the help stays in sync with runtime defaults.
In `@lib/codex-manager/help.ts`:
- Around line 185-210: parseBestArgs currently accepts a value for --model that
starts with '-' (e.g., --json) because it only checks for empty value; update
the parsing branches that handle "--model" / "-m" and "--model=" in
parseBestArgs to reject flag-like values by checking if the resolved value
startsWith("-") and, if so, return the same error object used elsewhere
("ok:false, reason:'error', message:'Missing value for --model'") instead of
accepting it; also add regression tests in test/codex-manager-help.test.ts that
mirror test/codex-manager-forecast-command.test.ts:137-150 to assert that
flag-like model values are rejected for the best command.
In `@lib/codex-manager/repair-commands.ts`:
- Around line 215-230: parseFixArgs currently only checks for a missing value
when handling "--model"/"-m" and "--model=" but allows flag-like values (strings
starting with "-"), which causes flags like "--json" to be consumed as the
model. In parseFixArgs, after computing value (for both the "--model" branch and
the "--model=" branch), add a validation that rejects values starting with "-"
(e.g., if value.startsWith("-") return { ok: false, message: "Missing value for
--model" } or similar consistent error) before setting options.model; reference
argValue, parseFixArgs, and options.model to locate the spots. Also add
regression tests to the fix command test suite mirroring the existing tests in
test/codex-manager-forecast-command.test.ts:137-150 to assert that flag-like
values for --model are rejected.
---
Duplicate comments:
In `@lib/codex-manager/help.ts`:
- Line 3: Remove the unnecessary indirection: delete the local constant
DEFAULT_LIVE_PROBE_MODEL and replace its usages with the canonical DEFAULT_MODEL
(i.e., use DEFAULT_MODEL directly where DEFAULT_LIVE_PROBE_MODEL is referenced),
or if a distinct default is required across the codebase, import the canonical
DEFAULT_LIVE_PROBE_MODEL from model-map.ts instead of defining it locally;
update all references (places currently referencing DEFAULT_LIVE_PROBE_MODEL) to
use the chosen symbol so there is a single source of truth.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: ASSERTIVE
Plan: Pro
Run ID: d93205b9-7baa-4e2a-9877-26a45254a44c
📒 Files selected for processing (10)
lib/codex-manager.tslib/codex-manager/commands/best.tslib/codex-manager/commands/forecast.tslib/codex-manager/commands/report.tslib/codex-manager/forecast-report-commands.tslib/codex-manager/help.tslib/codex-manager/repair-commands.tstest/codex-manager-cli.test.tstest/codex-manager-forecast-command.test.tstest/codex-manager-report-command.test.ts
📜 Review details
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
- GitHub Check: Greptile Review
🧰 Additional context used
📓 Path-based instructions (9)
test/**/*.test.ts
📄 CodeRabbit inference engine (test/AGENTS.md)
test/**/*.test.ts: Vitest globals (describe,it,expect) are enabled and should be used without explicit imports
Maintain 80% coverage threshold across statements, branches, functions, and lines
UseremoveWithRetryfor Windows filesystem cleanup instead of barefs.rmto handle EBUSY/EPERM/ENOTEMPTY backoff
Use source files in tests, not compileddist/files; test the source directly
Do not skip tests without justification; include rationale if a test must be skipped
Relax ESLint rules for test files as specified ineslint.config.js
Files:
test/codex-manager-forecast-command.test.tstest/codex-manager-report-command.test.tstest/codex-manager-cli.test.ts
**/*.ts
📄 CodeRabbit inference engine (AGENTS.md)
Do not use
as any,@ts-ignore, or@ts-expect-errortype assertions
Files:
test/codex-manager-forecast-command.test.tstest/codex-manager-report-command.test.tslib/codex-manager/commands/best.tslib/codex-manager/repair-commands.tslib/codex-manager/commands/forecast.tslib/codex-manager/help.tslib/codex-manager/forecast-report-commands.tslib/codex-manager/commands/report.tstest/codex-manager-cli.test.tslib/codex-manager.ts
**/*.{ts,js}
📄 CodeRabbit inference engine (AGENTS.md)
Use ESM module syntax exclusively; the project is ESM-only with
"type": "module"
Files:
test/codex-manager-forecast-command.test.tstest/codex-manager-report-command.test.tslib/codex-manager/commands/best.tslib/codex-manager/repair-commands.tslib/codex-manager/commands/forecast.tslib/codex-manager/help.tslib/codex-manager/forecast-report-commands.tslib/codex-manager/commands/report.tstest/codex-manager-cli.test.tslib/codex-manager.ts
test/**/*.ts
📄 CodeRabbit inference engine (AGENTS.md)
Windows filesystem operations must include retry handling for transient
EBUSY,EPERM, andENOTEMPTYerrors where tests cover Windows locks
Files:
test/codex-manager-forecast-command.test.tstest/codex-manager-report-command.test.tstest/codex-manager-cli.test.ts
**/*.{js,ts,jsx,tsx}
📄 CodeRabbit inference engine (README.md)
Prefer
async/awaitover callback-based promise handling in TypeScript/JavaScript code for better readability and error handlingUse environment variables with
CODEX_prefix for runtime configuration overrides (e.g.,CODEX_MULTI_AUTH_DIR,CODEX_MODE,CODEX_TUI_COLOR_PROFILE)Store user data in
~/.codex/multi-auth/directory structure with support forCODEX_MULTI_AUTH_DIRenvironment variable override for custom pathsUse
--dry-runflag pattern for repair and fix commands to preview changes before applying them (e.g.,codex-multi-auth fix --dry-run)Use JSON format for machine-readable output with
--jsonflag on diagnostic and report commands (e.g.,codex-multi-auth report --json,codex-multi-auth doctor --json)Use opt-in approach for experimental features with non-destructive flows: sync previews before apply, preserve destination-only accounts, and fail safely on filename collisions
All CLI commands should include appropriate help text accessible via
?hotkey in dashboard or--helpflag for command-line usageUse camelCase for all JavaScript/TypeScript variable, function, and property names
Files:
test/codex-manager-forecast-command.test.tstest/codex-manager-report-command.test.tslib/codex-manager/commands/best.tslib/codex-manager/repair-commands.tslib/codex-manager/commands/forecast.tslib/codex-manager/help.tslib/codex-manager/forecast-report-commands.tslib/codex-manager/commands/report.tstest/codex-manager-cli.test.tslib/codex-manager.ts
test/**
⚙️ CodeRabbit configuration file
tests must stay deterministic and use vitest. demand regression cases that reproduce concurrency bugs, token refresh races, and windows filesystem behavior. reject changes that mock real secrets or skip assertions.
Files:
test/codex-manager-forecast-command.test.tstest/codex-manager-report-command.test.tstest/codex-manager-cli.test.ts
lib/**/*.ts
📄 CodeRabbit inference engine (lib/AGENTS.md)
lib/**/*.ts: All public exports should flow throughlib/index.tsor documented package subpaths
Never import fromdist/in source tests or library code
Never suppress type errors
Files:
lib/codex-manager/commands/best.tslib/codex-manager/repair-commands.tslib/codex-manager/commands/forecast.tslib/codex-manager/help.tslib/codex-manager/forecast-report-commands.tslib/codex-manager/commands/report.tslib/codex-manager.ts
lib/**
⚙️ CodeRabbit configuration file
focus on auth rotation, windows filesystem IO, and concurrency. verify every change cites affected tests (vitest) and that new queues handle EBUSY/429 scenarios. check for logging that leaks tokens or emails.
Files:
lib/codex-manager/commands/best.tslib/codex-manager/repair-commands.tslib/codex-manager/commands/forecast.tslib/codex-manager/help.tslib/codex-manager/forecast-report-commands.tslib/codex-manager/commands/report.tslib/codex-manager.ts
test/**/codex-manager-cli.test.ts
📄 CodeRabbit inference engine (test/AGENTS.md)
Test CLI settings with question cancellation across all 5 panels and EBUSY/concurrent race conditions
Files:
test/codex-manager-cli.test.ts
🧠 Learnings (23)
📓 Common learnings
Learnt from: CR
Repo: ndycode/codex-multi-auth PR: 0
File: docs/configuration.md:0-0
Timestamp: 2026-05-31T13:20:01.197Z
Learning: Applies to docs/config/codex-modern.json : Configuration shipped templates must expose first-class current OpenAI model aliases, with `config/codex-modern.json` including `gpt-5.5` and `gpt-5.5-pro`
Learnt from: CR
Repo: ndycode/codex-multi-auth PR: 0
File: docs/configuration.md:0-0
Timestamp: 2026-05-31T13:20:01.197Z
Learning: Deprecated Codex selectors such as `gpt-5-codex` and `gpt-5.1-codex*` must be treated as compatibility aliases and retried on current documented Codex models
Learnt from: CR
Repo: ndycode/codex-multi-auth
Timestamp: 2026-06-03T07:32:49.844Z
Learning: Design the public API contract with documented error contracts covering token expiration, missing fields, and token reuse scenarios
Learnt from: CR
Repo: ndycode/codex-multi-auth
Timestamp: 2026-06-03T07:32:49.844Z
Learning: Never patch official Codex CLI app binaries; use reversible packaged app bind and user-level launcher routing helpers instead
Learnt from: CR
Repo: ndycode/codex-multi-auth
Timestamp: 2026-06-03T07:32:49.844Z
Learning: Keep credentials local in `~/.codex/multi-auth/` directory structure; never transmit or store credentials in remote systems or share them across machines
Learnt from: CR
Repo: ndycode/codex-multi-auth
Timestamp: 2026-06-03T07:32:49.844Z
Learning: Use bounded outbound request budget to prevent a single prompt from walking the entire account pool indefinitely
Learnt from: CR
Repo: ndycode/codex-multi-auth
Timestamp: 2026-06-03T07:32:49.844Z
Learning: Implement session affinity and live account sync to maintain consistent account selection across multiple concurrent requests
📚 Learning: 2026-06-02T12:30:22.264Z
Learnt from: CR
Repo: ndycode/codex-multi-auth PR: 0
File: docs/releases/v2.2.0.md:0-0
Timestamp: 2026-06-02T12:30:22.264Z
Learning: Applies to docs/releases/**/quota*.{js,ts,tsx} : Detect unsupported Codex model from upstream error `detail` shape and surface a friendly 'Codex unavailable' note across `best` / `forecast` / `report` / live-check surfaces instead of leaking raw upstream text
Applied to files:
test/codex-manager-forecast-command.test.tstest/codex-manager-report-command.test.tslib/codex-manager/commands/best.tslib/codex-manager/repair-commands.tslib/codex-manager/commands/forecast.tslib/codex-manager/help.tslib/codex-manager/forecast-report-commands.tslib/codex-manager/commands/report.tstest/codex-manager-cli.test.tslib/codex-manager.ts
📚 Learning: 2026-05-31T14:24:04.131Z
Learnt from: CR
Repo: ndycode/codex-multi-auth PR: 0
File: docs/releases/v2.1.13-beta.2.md:0-0
Timestamp: 2026-05-31T14:24:04.131Z
Learning: Applies to docs/releases/**/*{config,rotation,schema}*.test.{ts,js} : Write tests for minRotationIntervalMs sliding-anchor and sticky-window coverage; schema and config coverage for new knobs with min(0), allows-zero, rejects-string validation
Applied to files:
test/codex-manager-forecast-command.test.tslib/codex-manager/help.ts
📚 Learning: 2026-05-31T14:24:04.131Z
Learnt from: CR
Repo: ndycode/codex-multi-auth PR: 0
File: docs/releases/v2.1.13-beta.2.md:0-0
Timestamp: 2026-05-31T14:24:04.131Z
Learning: Applies to docs/releases/**/*{refresh,error,builder,auth}*.test.{ts,js} : Write unit tests covering refresh-endpoint invalidation returning code: "token_invalidated" routed through shared body builder
Applied to files:
test/codex-manager-report-command.test.tstest/codex-manager-cli.test.tslib/codex-manager.ts
📚 Learning: 2026-05-31T13:20:01.197Z
Learnt from: CR
Repo: ndycode/codex-multi-auth PR: 0
File: docs/configuration.md:0-0
Timestamp: 2026-05-31T13:20:01.197Z
Learning: Applies to docs/config/codex-modern.json : Configuration shipped templates must expose first-class current OpenAI model aliases, with `config/codex-modern.json` including `gpt-5.5` and `gpt-5.5-pro`
Applied to files:
lib/codex-manager/commands/best.tslib/codex-manager/repair-commands.tslib/codex-manager/commands/forecast.tslib/codex-manager/forecast-report-commands.tslib/codex-manager/commands/report.tstest/codex-manager-cli.test.tslib/codex-manager.ts
📚 Learning: 2026-05-31T13:20:01.197Z
Learnt from: CR
Repo: ndycode/codex-multi-auth PR: 0
File: docs/configuration.md:0-0
Timestamp: 2026-05-31T13:20:01.197Z
Learning: Deprecated Codex selectors such as `gpt-5-codex` and `gpt-5.1-codex*` must be treated as compatibility aliases and retried on current documented Codex models
Applied to files:
lib/codex-manager/commands/best.tslib/codex-manager/repair-commands.tslib/codex-manager/commands/forecast.tslib/codex-manager/forecast-report-commands.tslib/codex-manager/commands/report.tstest/codex-manager-cli.test.tslib/codex-manager.ts
📚 Learning: 2026-06-03T06:06:56.293Z
Learnt from: CR
Repo: ndycode/codex-multi-auth PR: 0
File: docs/releases/v2.2.1.md:0-0
Timestamp: 2026-06-03T06:06:56.293Z
Learning: Applies to docs/releases/**/*forecast*.js : Forecast recommendations must exclude policy-blocked and token-exhausted accounts, returning no recommendation with a clear reason when none are available
Applied to files:
lib/codex-manager/commands/best.tslib/codex-manager/commands/forecast.ts
📚 Learning: 2026-06-02T12:30:22.264Z
Learnt from: CR
Repo: ndycode/codex-multi-auth PR: 0
File: docs/releases/v2.2.0.md:0-0
Timestamp: 2026-06-02T12:30:22.264Z
Learning: Applies to docs/releases/**/account*.{js,ts,tsx} : Implement atomic, self-healing account store with checksummed WAL and temp-and-rename writes that self-heal on read when encountering torn writes
Applied to files:
lib/codex-manager/commands/best.ts
📚 Learning: 2026-06-02T12:29:38.793Z
Learnt from: CR
Repo: ndycode/codex-multi-auth PR: 0
File: AGENTS.md:0-0
Timestamp: 2026-06-02T12:29:38.793Z
Learning: Applies to lib/request/request-transformer.ts : Forward non-auth commands to official Codex CLI without reimplementing general Codex commands in the wrapper
Applied to files:
lib/codex-manager/repair-commands.tslib/codex-manager/forecast-report-commands.ts
📚 Learning: 2026-06-03T06:06:23.734Z
Learnt from: CR
Repo: ndycode/codex-multi-auth PR: 0
File: README.md:0-0
Timestamp: 2026-06-03T06:06:23.734Z
Learning: Applies to **/quota-cache.json : Implement quota caching in `~/.codex/multi-auth/quota-cache.json` for account quota forecasting and health-aware selection
Applied to files:
lib/codex-manager/commands/forecast.ts
📚 Learning: 2026-06-02T12:29:38.793Z
Learnt from: CR
Repo: ndycode/codex-multi-auth PR: 0
File: AGENTS.md:0-0
Timestamp: 2026-06-02T12:29:38.793Z
Learning: Applies to lib/runtime-constants.ts : Use canonical runtime provider id `codex-multi-auth-runtime-proxy` in runtime constants
Applied to files:
lib/codex-manager/help.tslib/codex-manager.ts
📚 Learning: 2026-05-31T14:24:04.131Z
Learnt from: CR
Repo: ndycode/codex-multi-auth PR: 0
File: docs/releases/v2.1.13-beta.2.md:0-0
Timestamp: 2026-05-31T14:24:04.131Z
Learning: Applies to docs/releases/**/*{auth,rotation,401}*.test.{ts,js} : Write unit tests covering upstream-401 invalidation path (401 to client, ~5-minute cooldown, clears affinity, no rotation) and regression guard for generic 401 rotation
Applied to files:
lib/codex-manager/help.tstest/codex-manager-cli.test.tslib/codex-manager.ts
📚 Learning: 2026-05-31T14:24:04.131Z
Learnt from: CR
Repo: ndycode/codex-multi-auth PR: 0
File: docs/releases/v2.1.13-beta.2.md:0-0
Timestamp: 2026-05-31T14:24:04.131Z
Learning: Applies to docs/releases/**/*{builder,error,response}*.test.{ts,js} : Write unit tests for invalidation body builder covering all message-extraction branches: top-level message, nested error.message, top-level-wins priority, blank-to-nested fallback, non-JSON body, and no-usable-message fallback
Applied to files:
test/codex-manager-cli.test.ts
📚 Learning: 2026-06-02T12:30:22.264Z
Learnt from: CR
Repo: ndycode/codex-multi-auth PR: 0
File: docs/releases/v2.2.0.md:0-0
Timestamp: 2026-06-02T12:30:22.264Z
Learning: Applies to docs/releases/**/cache*.{js,ts,tsx} : Verify cached Codex instructions with SHA-256 digest; discard tampered cache, treat legacy entries without recorded digest as unverified, and never fast-path serve or drive conditional revalidation on unverified bytes
Applied to files:
test/codex-manager-cli.test.ts
📚 Learning: 2026-05-31T14:24:04.131Z
Learnt from: CR
Repo: ndycode/codex-multi-auth PR: 0
File: docs/releases/v2.1.13-beta.2.md:0-0
Timestamp: 2026-05-31T14:24:04.131Z
Learning: Applies to docs/releases/**/*{401,auth,handler,rotation,oauth}*.{ts,js} : Detect explicit token-invalidation responses in 401 handlers by reading response body and checking for invalidation phrases (e.g., 'invalidated oauth token', 'authentication token has been invalidated')
Applied to files:
lib/codex-manager.ts
📚 Learning: 2026-05-31T14:24:04.131Z
Learnt from: CR
Repo: ndycode/codex-multi-auth PR: 0
File: docs/releases/v2.1.13-beta.2.md:0-0
Timestamp: 2026-05-31T14:24:04.131Z
Learning: Applies to docs/releases/**/*{rotation,scheduler,timing,auth}*.{ts,js} : Implement minRotationIntervalMs sticky window (configurable sliding anchor via CODEX_AUTH_MIN_ROTATION_INTERVAL_MS or minRotationIntervalMs, default 60s) to boost the last-served account and reduce presenting different OAuth tokens from the same IP
Applied to files:
lib/codex-manager.ts
📚 Learning: 2026-05-31T14:24:04.131Z
Learnt from: CR
Repo: ndycode/codex-multi-auth PR: 0
File: docs/releases/v2.1.13-beta.2.md:0-0
Timestamp: 2026-05-31T14:24:04.131Z
Learning: Applies to docs/releases/**/*{auth,handler,401,rotation}*.{ts,js} : Distinguish token invalidation 401s from generic expired-token 401s; continue rotating for generic 401s (expired tokens, wrong credentials) but stop on explicit invalidation detection
Applied to files:
lib/codex-manager.ts
📚 Learning: 2026-06-03T06:06:56.293Z
Learnt from: CR
Repo: ndycode/codex-multi-auth PR: 0
File: docs/releases/v2.2.1.md:0-0
Timestamp: 2026-06-03T06:06:56.293Z
Learning: Applies to docs/releases/**/*{verify,bearer}*.js : Bearer token verification hot path writes to lastUsedAt must be debounced to keep steady-state verification in-memory
Applied to files:
lib/codex-manager.ts
📚 Learning: 2026-05-31T14:24:04.131Z
Learnt from: CR
Repo: ndycode/codex-multi-auth PR: 0
File: docs/releases/v2.1.13-beta.2.md:0-0
Timestamp: 2026-05-31T14:24:04.131Z
Learning: Applies to docs/releases/**/*{auth,rotation,config,handler}*.{ts,js} : Apply a long cooldown (5 minutes via CODEX_AUTH_TOKEN_INVALIDATION_COOLDOWN_MS or tokenInvalidationCooldownMs) on invalidated accounts
Applied to files:
lib/codex-manager.ts
📚 Learning: 2026-05-31T14:24:04.131Z
Learnt from: CR
Repo: ndycode/codex-multi-auth PR: 0
File: docs/releases/v2.1.13-beta.2.md:0-0
Timestamp: 2026-05-31T14:24:04.131Z
Learning: Applies to docs/releases/**/*{error,builder,response,auth}*.{ts,js} : Emit consistent client error contract: { error: { message, code: "token_invalidated" } } for both invalidation exit paths (refresh-failure and upstream-401) through a single shared builder
Applied to files:
lib/codex-manager.ts
📚 Learning: 2026-06-03T06:06:56.293Z
Learnt from: CR
Repo: ndycode/codex-multi-auth PR: 0
File: docs/releases/v2.2.1.md:0-0
Timestamp: 2026-06-03T06:06:56.293Z
Learning: Applies to docs/releases/**/*cache*.js : Codex CLI state cache must honor forceRefresh even with a load in flight, guarded by load generation to prevent stale reads from overwriting fresh snapshots
Applied to files:
lib/codex-manager.ts
📚 Learning: 2026-05-31T13:20:01.197Z
Learnt from: CR
Repo: ndycode/codex-multi-auth PR: 0
File: docs/configuration.md:0-0
Timestamp: 2026-05-31T13:20:01.197Z
Learning: Keep recommended defaults enabled: `menuAutoFetchLimits`, `menuSortEnabled`, `liveAccountSync`, `sessionAffinity`, `proactiveRefreshGuardian`, and `preemptiveQuotaEnabled`
Applied to files:
lib/codex-manager.ts
📚 Learning: 2026-06-03T06:06:56.293Z
Learnt from: CR
Repo: ndycode/codex-multi-auth PR: 0
File: docs/releases/v2.2.1.md:0-0
Timestamp: 2026-06-03T06:06:56.293Z
Learning: Applies to docs/releases/**/*status*.js : Account status tone determination must consider the entire detail string, not just segments within parentheses, to ensure failed health checks always render as failures
Applied to files:
lib/codex-manager.ts
🔇 Additional comments (5)
lib/codex-manager/commands/forecast.ts (1)
1-567: LGTM!lib/codex-manager/forecast-report-commands.ts (1)
1-626: LGTM!test/codex-manager-forecast-command.test.ts (1)
137-150: LGTM!test/codex-manager-cli.test.ts (1)
2009-2027: LGTM!lib/codex-manager.ts (1)
2407-2415: this still skips the live probe after a transient refresh failure.
lib/codex-manager.ts:2407still marks the account assigned in onlyas soon asqueuedRefresh()fails, even whensessionLikelyValidis true. that undercountscodexAvailableand misreports live status if the existingaccount.accessTokenwould still passfetchCodexQuotaSnapshot(). please keep the fallback probe here, and keep the regression intest/codex-manager-cli.test.tsfor refresh failure + usable token + live probe.
…bit round 2)
CodeRabbit found two more --model parsers I missed (separate parse functions):
- help.ts parseBestArgs (the 'best' command's own parser, distinct from the one
in codex-manager.ts) — Critical
- repair-commands.ts parseFixArgs (the 'fix' command) — Critical
Also fixed the same class in two pre-existing parsers not touched by the original
PR, for consistency (flagged by an exhaustive sweep):
- commands/integrations.ts (--model)
- commands/models.ts (--model and --model=)
Every --model/-m and --model= site now rejects a flag-like next token
(startsWith('-')) instead of consuming it. Added regression tests:
parseBestArgs (--model --json/--live/=--json) in codex-manager-help.test.ts and
parseFixArgs in repair-commands.test.ts.
Deep-audit workflow verdict: SAFE TO MERGE — both raised findings REFUTED against
committed code (auditor read origin/main state, not the PR's commits); no v2.2.1
regression in the audited surfaces.
Full suite: 4354 passed, 3 skipped, 0 failed; typecheck + lint clean.
Co-Authored-By: Claude Opus 4.8 <[email protected]>
Co-Authored-By: Claude Opus 4.8 <[email protected]>
|
Addressed the round-2 review in
Every --model parse site is now consistent. Full suite: 4354 passed, 3 skipped, 0 failed; typecheck + lint clean. Deep-audit workflow verdict: SAFE TO MERGE (its 2 findings were refuted against committed code). @coderabbitai full review |
|
User:
✅ Action performedFull review finished. |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@test/codex-manager-help.test.ts`:
- Around line 129-146: Add regression tests for the short alias handled in
lib/codex-manager/help.ts (the -m handling around line 185) by extending the
existing test that covers --model: add a case expect(parseBestArgs(["-m",
"--json"])) to return the same error object as ["--model", "--json"] (ok: false,
reason: "error", message: "Missing value for --model") and add a success case
expect(parseBestArgs(["-m", "gpt-5.5"])) mirroring the valid ["--model",
"gpt-5.5"] behavior so the -m alias contract is locked in.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: ASSERTIVE
Plan: Pro
Run ID: eabc6bf5-74a9-4aa8-a4e9-d7d121e691d2
📒 Files selected for processing (6)
lib/codex-manager/commands/integrations.tslib/codex-manager/commands/models.tslib/codex-manager/help.tslib/codex-manager/repair-commands.tstest/codex-manager-help.test.tstest/repair-commands.test.ts
📜 Review details
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
- GitHub Check: Greptile Review
🧰 Additional context used
📓 Path-based instructions (8)
lib/**/*.ts
📄 CodeRabbit inference engine (lib/AGENTS.md)
lib/**/*.ts: All public exports should flow throughlib/index.tsor documented package subpaths
Never import fromdist/in source tests or library code
Never suppress type errors
Files:
lib/codex-manager/commands/models.tslib/codex-manager/commands/integrations.tslib/codex-manager/repair-commands.tslib/codex-manager/help.ts
**/*.ts
📄 CodeRabbit inference engine (AGENTS.md)
Do not use
as any,@ts-ignore, or@ts-expect-errortype assertions
Files:
lib/codex-manager/commands/models.tslib/codex-manager/commands/integrations.tstest/codex-manager-help.test.tstest/repair-commands.test.tslib/codex-manager/repair-commands.tslib/codex-manager/help.ts
**/*.{ts,js}
📄 CodeRabbit inference engine (AGENTS.md)
Use ESM module syntax exclusively; the project is ESM-only with
"type": "module"
Files:
lib/codex-manager/commands/models.tslib/codex-manager/commands/integrations.tstest/codex-manager-help.test.tstest/repair-commands.test.tslib/codex-manager/repair-commands.tslib/codex-manager/help.ts
**/*.{ts,tsx,js,jsx}
📄 CodeRabbit inference engine (README.md)
Use CODEX_MULTI_AUTH_DIR environment variable to override settings/accounts root directory instead of hardcoding paths
Use CODEX_MODE=0/1 environment variable to disable/enable Codex mode at runtime instead of modifying code
Use CODEX_MULTI_AUTH_RUNTIME_ROTATION_PROXY=0/1 to opt out/in of live Responses proxy rotation for forwarded Codex CLI/app sessions instead of changing defaults in code
Store account credentials and settings in project-scoped paths under ~/.codex/multi-auth/projects// for repo-specific workflows
Implement account selection logic to prefer health-aware selection, quota forecasting, and automatic failover over simple sequential rotation
Ensure credentials stay local and never transmit account state to external services beyond OpenAI API endpoints
Implement bounded outbound request budget so one prompt cannot walk through the full account pool indefinitely
Trigger short cooldown on repeated cross-account 5xx bursts instead of continuing aggressive rotation
Stagger proactive refresh operations to reduce background refresh bursts across multiple accounts
Disable whole-pool replay by default when every account is rate-limited to prevent cascading failures
Implement Responses background mode as opt-in only; callers must intentionally send background: true for stateful store=true routing
Make manual npm version check notices non-intrusive; only print on interactive TTY or when CODEX_MULTI_AUTH_DEBUG=1, never auto-update
Use loopback-only local bridge for /health, /v1/models, and /v1/responses endpoints, protected by hashed local client tokens
Implement session affinity and live account sync to maintain consistent account selection within a single forwarded Codex session
Do not patch official Codex app binaries; use reversible packaged Codex app bind and user-level launcher routing helpers instead
Keep settings, accounts, and configuration files in JSON format under ~/.codex/multi-auth/ with documented default paths for all st...
Files:
lib/codex-manager/commands/models.tslib/codex-manager/commands/integrations.tstest/codex-manager-help.test.tstest/repair-commands.test.tslib/codex-manager/repair-commands.tslib/codex-manager/help.ts
lib/**
⚙️ CodeRabbit configuration file
focus on auth rotation, windows filesystem IO, and concurrency. verify every change cites affected tests (vitest) and that new queues handle EBUSY/429 scenarios. check for logging that leaks tokens or emails.
Files:
lib/codex-manager/commands/models.tslib/codex-manager/commands/integrations.tslib/codex-manager/repair-commands.tslib/codex-manager/help.ts
test/**/*.test.ts
📄 CodeRabbit inference engine (test/AGENTS.md)
test/**/*.test.ts: Vitest globals (describe,it,expect) are enabled and should be used without explicit imports
Maintain 80% coverage threshold across statements, branches, functions, and lines
UseremoveWithRetryfor Windows filesystem cleanup instead of barefs.rmto handle EBUSY/EPERM/ENOTEMPTY backoff
Use source files in tests, not compileddist/files; test the source directly
Do not skip tests without justification; include rationale if a test must be skipped
Relax ESLint rules for test files as specified ineslint.config.js
Files:
test/codex-manager-help.test.tstest/repair-commands.test.ts
test/**/*.ts
📄 CodeRabbit inference engine (AGENTS.md)
Windows filesystem operations must include retry handling for transient
EBUSY,EPERM, andENOTEMPTYerrors where tests cover Windows locks
Files:
test/codex-manager-help.test.tstest/repair-commands.test.ts
test/**
⚙️ CodeRabbit configuration file
tests must stay deterministic and use vitest. demand regression cases that reproduce concurrency bugs, token refresh races, and windows filesystem behavior. reject changes that mock real secrets or skip assertions.
Files:
test/codex-manager-help.test.tstest/repair-commands.test.ts
🧠 Learnings (8)
📓 Common learnings
Learnt from: CR
Repo: ndycode/codex-multi-auth PR: 0
File: docs/releases/v2.2.0.md:0-0
Timestamp: 2026-06-02T12:30:22.264Z
Learning: Applies to docs/releases/**/quota*.{js,ts,tsx} : Detect unsupported Codex model from upstream error `detail` shape and surface a friendly 'Codex unavailable' note across `best` / `forecast` / `report` / live-check surfaces instead of leaking raw upstream text
Learnt from: CR
Repo: ndycode/codex-multi-auth PR: 0
File: docs/configuration.md:0-0
Timestamp: 2026-05-31T13:20:01.197Z
Learning: Applies to docs/config/codex-modern.json : Configuration shipped templates must expose first-class current OpenAI model aliases, with `config/codex-modern.json` including `gpt-5.5` and `gpt-5.5-pro`
Learnt from: CR
Repo: ndycode/codex-multi-auth
Timestamp: 2026-06-03T08:07:30.136Z
Learning: Install official Codex CLI via npm, Homebrew, or release binary before installing codex-multi-auth
Learnt from: CR
Repo: ndycode/codex-multi-auth
Timestamp: 2026-06-03T08:07:30.136Z
Learning: This project is an independent open-source project, not an official OpenAI product; include clear disclaimer in documentation
Learnt from: CR
Repo: ndycode/codex-multi-auth
Timestamp: 2026-06-03T08:07:30.136Z
Learning: Credentials are for personal development use only; include caution notice that production/commercial workloads should use OpenAI Platform API
📚 Learning: 2026-05-31T14:24:04.131Z
Learnt from: CR
Repo: ndycode/codex-multi-auth PR: 0
File: docs/releases/v2.1.13-beta.2.md:0-0
Timestamp: 2026-05-31T14:24:04.131Z
Learning: Applies to docs/releases/**/*{builder,error,response}*.test.{ts,js} : Write unit tests for invalidation body builder covering all message-extraction branches: top-level message, nested error.message, top-level-wins priority, blank-to-nested fallback, non-JSON body, and no-usable-message fallback
Applied to files:
test/codex-manager-help.test.tstest/repair-commands.test.ts
📚 Learning: 2026-05-31T14:24:04.131Z
Learnt from: CR
Repo: ndycode/codex-multi-auth PR: 0
File: docs/releases/v2.1.13-beta.2.md:0-0
Timestamp: 2026-05-31T14:24:04.131Z
Learning: Applies to docs/releases/**/*{config,rotation,schema}*.test.{ts,js} : Write tests for minRotationIntervalMs sliding-anchor and sticky-window coverage; schema and config coverage for new knobs with min(0), allows-zero, rejects-string validation
Applied to files:
test/codex-manager-help.test.tslib/codex-manager/help.ts
📚 Learning: 2026-06-02T12:30:22.264Z
Learnt from: CR
Repo: ndycode/codex-multi-auth PR: 0
File: docs/releases/v2.2.0.md:0-0
Timestamp: 2026-06-02T12:30:22.264Z
Learning: Applies to docs/releases/**/quota*.{js,ts,tsx} : Detect unsupported Codex model from upstream error `detail` shape and surface a friendly 'Codex unavailable' note across `best` / `forecast` / `report` / live-check surfaces instead of leaking raw upstream text
Applied to files:
test/codex-manager-help.test.tslib/codex-manager/repair-commands.tslib/codex-manager/help.ts
📚 Learning: 2026-06-02T12:29:38.793Z
Learnt from: CR
Repo: ndycode/codex-multi-auth PR: 0
File: AGENTS.md:0-0
Timestamp: 2026-06-02T12:29:38.793Z
Learning: Applies to lib/request/request-transformer.ts : Forward non-auth commands to official Codex CLI without reimplementing general Codex commands in the wrapper
Applied to files:
test/codex-manager-help.test.ts
📚 Learning: 2026-05-31T13:20:14.049Z
Learnt from: CR
Repo: ndycode/codex-multi-auth PR: 0
File: docs/troubleshooting.md:0-0
Timestamp: 2026-05-31T13:20:14.049Z
Learning: Run `codex-multi-auth doctor --fix` to automatically repair Codex CLI multi-account install and routing issues
Applied to files:
test/repair-commands.test.ts
📚 Learning: 2026-06-02T12:29:38.793Z
Learnt from: CR
Repo: ndycode/codex-multi-auth PR: 0
File: AGENTS.md:0-0
Timestamp: 2026-06-02T12:29:38.793Z
Learning: Applies to lib/runtime-constants.ts : Use canonical runtime provider id `codex-multi-auth-runtime-proxy` in runtime constants
Applied to files:
lib/codex-manager/help.ts
📚 Learning: 2026-05-31T14:24:04.131Z
Learnt from: CR
Repo: ndycode/codex-multi-auth PR: 0
File: docs/releases/v2.1.13-beta.2.md:0-0
Timestamp: 2026-05-31T14:24:04.131Z
Learning: Applies to docs/releases/**/*{auth,rotation,401}*.test.{ts,js} : Write unit tests covering upstream-401 invalidation path (401 to client, ~5-minute cooldown, clears affinity, no rotation) and regression guard for generic 401 rotation
Applied to files:
lib/codex-manager/help.ts
🔇 Additional comments (1)
test/repair-commands.test.ts (1)
165-182:⚠️ Potential issue | 🟡 Minor | ⚡ Quick winextend parser regression to cover
-malias in fix args.this block validates
--modelpaths only. please addparseFixArgs(["-m", "--json"])=> missing-value error andparseFixArgs(["-m", "gpt-5.5"])=> success, sincelib/codex-manager/repair-commands.ts:215treats-mas first-class.As per coding guidelines, "test/**: tests must stay deterministic and use vitest. demand regression cases that reproduce concurrency bugs, token refresh races, and windows filesystem behavior."
⛔ Skipped due to learnings
Learnt from: CR Repo: ndycode/codex-multi-auth PR: 0 File: docs/releases/v2.1.13-beta.2.md:0-0 Timestamp: 2026-05-31T14:24:04.131Z Learning: Applies to docs/releases/**/*{config,rotation,schema}*.test.{ts,js} : Write tests for minRotationIntervalMs sliding-anchor and sticky-window coverage; schema and config coverage for new knobs with min(0), allows-zero, rejects-string validationLearnt from: CR Repo: ndycode/codex-multi-auth PR: 0 File: docs/releases/v2.1.13-beta.2.md:0-0 Timestamp: 2026-05-31T14:24:04.131Z Learning: Applies to docs/releases/**/*{builder,error,response}*.test.{ts,js} : Write unit tests for invalidation body builder covering all message-extraction branches: top-level message, nested error.message, top-level-wins priority, blank-to-nested fallback, non-JSON body, and no-usable-message fallbackLearnt from: CR Repo: ndycode/codex-multi-auth PR: 0 File: AGENTS.md:0-0 Timestamp: 2026-06-02T12:29:38.793Z Learning: Applies to test/**/*.ts : Windows filesystem operations must include retry handling for transient `EBUSY`, `EPERM`, and `ENOTEMPTY` errors where tests cover Windows locksLearnt from: CR Repo: ndycode/codex-multi-auth PR: 0 File: docs/releases/v2.1.13-beta.2.md:0-0 Timestamp: 2026-05-31T14:24:04.131Z Learning: Applies to docs/releases/**/*{auth,rotation,401}*.test.{ts,js} : Write unit tests covering upstream-401 invalidation path (401 to client, ~5-minute cooldown, clears affinity, no rotation) and regression guard for generic 401 rotationLearnt from: CR Repo: ndycode/codex-multi-auth PR: 0 File: docs/releases/v2.2.0.md:0-0 Timestamp: 2026-06-02T12:30:22.264Z Learning: Applies to docs/releases/**/*.{js,ts,tsx} --mcodex* : Validate `MCODEX_MONITOR_INTERVAL` and `MCODEX_TMUX_HISTORY_LIMIT` environment variables as numeric before interpolating into `watch` or tmux commands to prevent shell injectionLearnt from: CR Repo: ndycode/codex-multi-auth PR: 0 File: docs/releases/v2.1.13-beta.2.md:0-0 Timestamp: 2026-05-31T14:24:04.131Z Learning: Applies to docs/releases/**/*{refresh,error,builder,auth}*.test.{ts,js} : Write unit tests covering refresh-endpoint invalidation returning code: "token_invalidated" routed through shared body builderLearnt from: CR Repo: ndycode/codex-multi-auth PR: 0 File: docs/releases/v2.2.1.md:0-0 Timestamp: 2026-06-03T06:06:56.293Z Learning: Applies to docs/releases/scripts/mcodex.js : POSIX tools like tmux and watch must be invoked as argv arrays instead of shell string interpolation to avoid shell dependency issues
… test
CodeRabbit: the parseFixArgs regression only exercised --model; add -m cases
("-m --json" => missing-value error, "-m gpt-5.5" => success) since repair-commands
treats -m as first-class.
Co-Authored-By: Claude Opus 4.8 <[email protected]>
|
Addressed in All --model parse sites + their short forms are now guarded and covered. Full repair-commands suite: 19 passed; typecheck clean. @coderabbitai full review |
|
🧠 Learnings used✅ Action performedFull review finished. |
There was a problem hiding this comment.
Actionable comments posted: 5
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (3)
lib/codex-manager/forecast-report-commands.ts (1)
98-125: 🛠️ Refactor suggestion | 🟠 Major | ⚡ Quick windrive forecast/report help text from
DEFAULT_MODEL.
printForecastUsage()andprintReportUsage()still hardcodegpt-5.5atlib/codex-manager/forecast-report-commands.ts:107andlib/codex-manager/forecast-report-commands.ts:121, while the actual parser default already comes fromDEFAULT_MODELatlib/codex-manager/forecast-report-commands.ts:131andlib/codex-manager/forecast-report-commands.ts:172. that will drift the next time the default changes. please format the help text from the constant and add a parity assertion intest/codex-manager-help.test.tsortest/documentation.test.ts.suggested fix
export function printForecastUsage(): void { console.log( [ "Usage:", " codex-multi-auth forecast [--live] [--json] [--model <model>]", "", "Options:", " --live, -l Probe live quota headers via Codex backend", " --json, -j Print machine-readable JSON output", - " --model, -m Probe model for live mode (default: gpt-5.5)", + ` --model, -m Probe model for live mode (default: ${DEFAULT_MODEL})`, ].join("\n"), ); } @@ export function printReportUsage(): void { console.log( [ "Usage:", " codex-multi-auth report [--live] [--json] [--model <model>] [--out <path>]", "", "Options:", " --live, -l Probe live quota headers via Codex backend", " --json, -j Print machine-readable JSON output", - " --model, -m Probe model for live mode (default: gpt-5.5)", + ` --model, -m Probe model for live mode (default: ${DEFAULT_MODEL})`, " --out Write JSON report to a file path", ].join("\n"), ); }based on learnings: extend
test/documentation.test.tswhen command text or help changes to ensure docs parity.🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@lib/codex-manager/forecast-report-commands.ts` around lines 98 - 125, The usage strings in printForecastUsage and printReportUsage hardcode "gpt-5.5"; change both help messages to interpolate the DEFAULT_MODEL constant (use DEFAULT_MODEL where the default model text appears in printForecastUsage and printReportUsage) so the help text always matches the parser default, and add a parity assertion in the test suite (extend test/documentation.test.ts or create/extend test/codex-manager-help.test.ts) that loads the generated help text for the forecast/report commands and asserts it contains DEFAULT_MODEL to prevent future drift.lib/codex-manager.ts (1)
2542-2555:⚠️ Potential issue | 🟡 Minor | ⚡ Quick wintrim split-form
--modelvalues before validating them.at
lib/codex-manager.ts:2543,--model " "and--model " -x"still bypass the new guard because this branch checks the raw token. laterlib/codex-manager.ts:2186trims again, which silently falls back to the default or forwards a flag-like value. trim once before the empty/leading--check, and add regressions intest/codex-manager-help.test.ts.proposed patch
if (arg === "--model" || arg === "-m") { - const value = args[i + 1]; + const value = args[i + 1]?.trim(); if (!value || value.startsWith("-")) { return { ok: false, message: "Missing value for --model" }; } options.model = value;🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@lib/codex-manager.ts` around lines 2542 - 2555, The split-form handler for --model/-m currently checks the raw token and lets values like " " or " -x" pass; fix the branch in the if (arg === "--model" || arg === "-m") block to trim the next token before validating (e.g., read args[i+1] into raw, compute value = raw?.trim()), then validate (!value || value.startsWith("-")) and only then assign options.model = value and options.modelProvided = true and increment i; keep the equals-form logic as-is and add regression tests in test/codex-manager-help.test.ts for inputs like --model " " and --model " -x".lib/codex-manager/commands/integrations.ts (1)
70-76:⚠️ Potential issue | 🟡 Minor | ⚡ Quick wintrim split-form
--modelvalues before checking for flags.at
lib/codex-manager/commands/integrations.ts:71,--model " "and--model " -x"still pass this branch because it inspects the raw token. that leaves the command accepting an empty/flag-like model even after this hardening pass. trim before validating, and add a regression intest/codex-manager-integrations-command.test.ts.proposed patch
if (arg === "--model") { - const value = args[i + 1]; + const value = args[i + 1]?.trim(); if (!value || value.startsWith("-")) { logError("Missing value for --model"); return 1; }🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@lib/codex-manager/commands/integrations.ts` around lines 70 - 76, The validation for the split-form --model option currently checks the raw token and allows values like " " or " -x"; update the handler where arg === "--model" to trim the candidate value (use the existing args array and the local value variable) before checking for emptiness or startsWith("-"), assign the trimmed string to model, and add a regression test in test/codex-manager-integrations-command.test.ts that asserts rejected inputs like `--model " "` and `--model " -x"` produce the expected error/exit code.
♻️ Duplicate comments (2)
scripts/check-pack-budget-lib.js (1)
16-18:⚠️ Potential issue | 🟠 Major | ⚡ Quick winsplit exact-file requirements from directory prefixes to prevent lookalike-path bypass.
the
startsWithlogic atscripts/check-pack-budget-lib.js:103-106means.codex-plugin/plugin.json.bakor.codex-plugin/plugin.json~would incorrectly satisfy the pack gate even when the real manifest is missing. this lets broken packages passnpm run pack:check. split exact-path requirements (like the manifest) into a separateREQUIRED_PATHSconstant and check equality for those, keepingstartsWithonly for directory prefixes likedist/andvendor/codex-ai-plugin/. add regression coverage intest/check-pack-budget.test.tsproving lookalike paths are rejected.proposed fix (from previous review)
+export const REQUIRED_PATHS = [".codex-plugin/plugin.json"]; export const REQUIRED_PREFIXES = [ - ".codex-plugin/plugin.json", "dist/", "assets/", "config/", @@ + for (const required of REQUIRED_PATHS) { + if (!paths.includes(required)) { + throw new Error( + `Required package content missing from npm pack output: ${required}`, + ); + } + } + for (const required of REQUIRED_PREFIXES) { const present = paths.some( (path) => path === required || path.startsWith(required), );🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@scripts/check-pack-budget-lib.js` around lines 16 - 18, Split exact-file and directory-prefix requirements: add a new REQUIRED_PATHS array for exact matches (e.g., ".codex-plugin/plugin.json") and keep REQUIRED_PREFIXES for directory prefixes like "dist/" and "vendor/codex-ai-plugin/"; then update the existence-check logic in scripts/check-pack-budget-lib.js to test exact equality against REQUIRED_PATHS (not startsWith) and only use startsWith for items in REQUIRED_PREFIXES so files like ".codex-plugin/plugin.json.bak" no longer pass, and add a regression test in test/check-pack-budget.test.ts that asserts lookalike paths are rejected while valid exact paths and directories pass.test/codex-manager-help.test.ts (1)
129-146:⚠️ Potential issue | 🟡 Minor | ⚡ Quick winstill missing the
-mshort-alias regression.
lib/codex-manager/help.ts:185accepts-mas the alias, but this block only exercises--modeland--model=. addparseBestArgs(["-m", "--json"])(expect theMissing value for --modelerror) andparseBestArgs(["-m", "gpt-5.5"])(expect success) so the alias contract is locked alongside the long forms. drift on the-mbranch would ship green today.💚 proposed regression cases
expect(parseBestArgs(["--model=--json"])).toEqual({ ok: false, reason: "error", message: "Missing value for --model", }); + expect(parseBestArgs(["-m", "--json"])).toEqual({ + ok: false, + reason: "error", + message: "Missing value for --model", + }); + expect(parseBestArgs(["-m", "gpt-5.5"])).toEqual({ + ok: true, + options: { + live: false, + json: false, + model: "gpt-5.5", + modelProvided: true, + }, + }); });as per coding guidelines, "tests must stay deterministic and use vitest. demand regression cases that reproduce concurrency bugs, token refresh races, and windows filesystem behavior."
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@test/codex-manager-help.test.ts` around lines 129 - 146, Add regression tests for the `-m` short alias to the existing suite: extend the `it("rejects a flag-like value after --model ...")` block to call `parseBestArgs(["-m", "--json"])` and assert the same failure object (`ok: false, reason: "error", message: "Missing value for --model"`), and add a success case `parseBestArgs(["-m", "gpt-5.5"])` asserting the expected success result; this ensures the `-m` alias handled in help.ts (alias at line ~185) is exercised alongside `--model` and `--model=` so the alias contract cannot regress.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@lib/codex-manager/commands/forecast.ts`:
- Around line 175-188: In the split-form branch that handles arg === "--model"
|| arg === "-m", trim the next token before validating so tokens like " " or "
-x" are rejected like the --model= branch; specifically, read const raw =
args[i+1], compute const value = raw?.trim(), validate value for emptiness or
leading '-' and only then assign options.model = value and increment i; also add
regression tests in test/codex-manager-forecast-command.test.ts to assert that
`--model " "` and `--model " -x"` produce the same missing/invalid-value
behavior as the equals-form.
- Line 139: The help text is hardcoded to "gpt-5.5" instead of deriving the
default from DEFAULT_MODEL; update the usage/help string in forecast.ts to
interpolate or construct the default from the DEFAULT_MODEL constant (the same
constant used at lines ~152 and ~218) so the displayed default always matches
runtime behavior, and update the relevant test (either
test/codex-manager-forecast-command.test.ts or test/documentation.test.ts) to
assert the help output contains DEFAULT_MODEL rather than a literal version
string.
In `@lib/codex-manager/commands/report.ts`:
- Line 131: Replace the hardcoded "gpt-5.5" help text with the DEFAULT_MODEL
constant so the report command always reflects the configured default; update
the string where the option help is defined (the entry that currently reads "
--model, -m Probe model for live mode (default: gpt-5.5)") to interpolate
or concatenate DEFAULT_MODEL instead, and adjust the corresponding test
expectation in test/codex-manager-report-command.test.ts or
test/documentation.test.ts to assert the rendered usage contains DEFAULT_MODEL
rather than the literal "gpt-5.5". Ensure you reference the existing
DEFAULT_MODEL symbol used elsewhere in this module and do not introduce a new
literal.
In `@lib/codex-manager/repair-commands.ts`:
- Line 145: The usage text currently hardcodes "gpt-5.5" for the --model/-m
flag; replace that literal with the shared DEFAULT_MODEL constant so the CLI
help reflects the actual configured default. Locate the usage/help string that
contains '" --model, -m Probe model for live mode (default: gpt-5.5)"'
in repair-commands.ts and interpolate or concatenate DEFAULT_MODEL (the same
constant referenced at lines around 197 and 1200) into that message so it stays
consistent when DEFAULT_MODEL changes.
In `@test/check-pack-budget.test.ts`:
- Around line 112-128: Update the test to assert lookalike paths are rejected:
in test/check-pack-budget.test.ts add or modify a case using
validatePackMetadata so the paths array contains ".codex-plugin/plugin.json.bak"
(or similar lookalike) instead of the real manifest and assert it still throws
the same /\.codex-plugin\/plugin\.json/ error; this proves the validator
(validatePackMetadata) requires the exact ".codex-plugin/plugin.json" and will
catch the current startsWith-based acceptance in
scripts/check-pack-budget-lib.js.
---
Outside diff comments:
In `@lib/codex-manager.ts`:
- Around line 2542-2555: The split-form handler for --model/-m currently checks
the raw token and lets values like " " or " -x" pass; fix the branch in the
if (arg === "--model" || arg === "-m") block to trim the next token before
validating (e.g., read args[i+1] into raw, compute value = raw?.trim()), then
validate (!value || value.startsWith("-")) and only then assign options.model =
value and options.modelProvided = true and increment i; keep the equals-form
logic as-is and add regression tests in test/codex-manager-help.test.ts for
inputs like --model " " and --model " -x".
In `@lib/codex-manager/commands/integrations.ts`:
- Around line 70-76: The validation for the split-form --model option currently
checks the raw token and allows values like " " or " -x"; update the handler
where arg === "--model" to trim the candidate value (use the existing args array
and the local value variable) before checking for emptiness or startsWith("-"),
assign the trimmed string to model, and add a regression test in
test/codex-manager-integrations-command.test.ts that asserts rejected inputs
like `--model " "` and `--model " -x"` produce the expected error/exit code.
In `@lib/codex-manager/forecast-report-commands.ts`:
- Around line 98-125: The usage strings in printForecastUsage and
printReportUsage hardcode "gpt-5.5"; change both help messages to interpolate
the DEFAULT_MODEL constant (use DEFAULT_MODEL where the default model text
appears in printForecastUsage and printReportUsage) so the help text always
matches the parser default, and add a parity assertion in the test suite (extend
test/documentation.test.ts or create/extend test/codex-manager-help.test.ts)
that loads the generated help text for the forecast/report commands and asserts
it contains DEFAULT_MODEL to prevent future drift.
---
Duplicate comments:
In `@scripts/check-pack-budget-lib.js`:
- Around line 16-18: Split exact-file and directory-prefix requirements: add a
new REQUIRED_PATHS array for exact matches (e.g., ".codex-plugin/plugin.json")
and keep REQUIRED_PREFIXES for directory prefixes like "dist/" and
"vendor/codex-ai-plugin/"; then update the existence-check logic in
scripts/check-pack-budget-lib.js to test exact equality against REQUIRED_PATHS
(not startsWith) and only use startsWith for items in REQUIRED_PREFIXES so files
like ".codex-plugin/plugin.json.bak" no longer pass, and add a regression test
in test/check-pack-budget.test.ts that asserts lookalike paths are rejected
while valid exact paths and directories pass.
In `@test/codex-manager-help.test.ts`:
- Around line 129-146: Add regression tests for the `-m` short alias to the
existing suite: extend the `it("rejects a flag-like value after --model ...")`
block to call `parseBestArgs(["-m", "--json"])` and assert the same failure
object (`ok: false, reason: "error", message: "Missing value for --model"`), and
add a success case `parseBestArgs(["-m", "gpt-5.5"])` asserting the expected
success result; this ensures the `-m` alias handled in help.ts (alias at line
~185) is exercised alongside `--model` and `--model=` so the alias contract
cannot regress.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: ASSERTIVE
Plan: Pro
Run ID: 20a713a7-f8ad-4830-af3b-8fbc8ac4e8d9
📒 Files selected for processing (29)
README.mdlib/codex-manager.tslib/codex-manager/commands/best.tslib/codex-manager/commands/forecast.tslib/codex-manager/commands/integrations.tslib/codex-manager/commands/models.tslib/codex-manager/commands/report.tslib/codex-manager/forecast-report-commands.tslib/codex-manager/help.tslib/codex-manager/repair-commands.tslib/integration-generators.tslib/prompts/codex.tslib/quota-probe.tslib/runtime-rotation-proxy.tslib/runtime/quota-probe.tspackage.jsonscripts/check-pack-budget-lib.jstest/check-pack-budget.test.tstest/codex-manager-cli.test.tstest/codex-manager-forecast-command.test.tstest/codex-manager-help.test.tstest/codex-manager-integrations-command.test.tstest/codex-manager-report-command.test.tstest/codex-prompts.test.tstest/documentation.test.tstest/package-bin.test.tstest/quota-probe.test.tstest/repair-commands.test.tstest/runtime-quota-probe.test.ts
…t coverage
CodeRabbit round 3:
- check-pack-budget: split exact-file requirements (REQUIRED_FILES: plugin.json,
README, LICENSE — matched by full path equality) from directory prefixes
(REQUIRED_PREFIXES), so a sibling like '.codex-plugin/plugin.json.bak' can no
longer satisfy the publish gate while the real manifest is missing. + regression.
- report.ts: trim the split-arg --model value before validating, so a
whitespace-prefixed flag (' -x') or whitespace-only token can't bypass the
startsWith('-') guard and silently fall back to the default. + regression
(--json / ' -x' / ' ').
- tests: added -m short-form cases to parseBestArgs (codex-manager-help.test.ts)
and parseFixArgs, mirroring the long-form coverage.
Full suite: 4356 passed, 3 skipped, 0 failed; typecheck + lint clean.
Co-Authored-By: Claude Opus 4.8 <[email protected]>
|
Round 3 addressed in
Skipped 2 pure nitpicks (printBestUsage display-string assertion; report-test shared-const import) as cosmetic — flag if you want them. Full suite: 4356 passed, 3 skipped, 0 failed; typecheck + lint clean. @coderabbitai full review |
|
Oops, something went wrong! Please try again later. 🐰 💔 |
There was a problem hiding this comment.
♻️ Duplicate comments (2)
lib/codex-manager/commands/report.ts (1)
131-131: 🛠️ Refactor suggestion | 🟠 Major | ⚡ Quick winreplace hardcoded "gpt-5.5" with the shared default constant.
line 131 still hardcodes "gpt-5.5" while lines 145 and 313 correctly use
DEFAULT_MODEL. interpolate the constant so the help text stays synchronized with the next model bump.🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@lib/codex-manager/commands/report.ts` at line 131, Replace the hardcoded "gpt-5.5" in the help string for the --model/-m option with the shared DEFAULT_MODEL constant so the CLI help stays in sync with future model bumps; locate the string in lib/codex-manager/commands/report.ts (the line containing `" --model, -m Probe model for live mode (default: gpt-5.5)"`) and interpolate or concatenate DEFAULT_MODEL (the same constant used elsewhere in this file) into that help text.test/codex-manager-report-command.test.ts (1)
534-534: 🛠️ Refactor suggestion | 🟠 Major | ⚡ Quick winimport the shared default model constant instead of hardcoding the literal.
line 534 still hardcodes
"gpt-5.5"in thefetchCodexQuotaSnapshotassertion. importDEFAULT_MODELfromlib/request/helpers/model-map.jsand use it here so the test stays aligned when the default model changes.🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@test/codex-manager-report-command.test.ts` at line 534, Replace the hardcoded "gpt-5.5" literal in the fetchCodexQuotaSnapshot assertion with the shared DEFAULT_MODEL constant: import DEFAULT_MODEL from lib/request/helpers/model-map.js at the top of the test file and use DEFAULT_MODEL in the assertion that currently references "gpt-5.5" so the test follows the canonical default model; update any nearby test references to the same literal to use DEFAULT_MODEL as well.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Duplicate comments:
In `@lib/codex-manager/commands/report.ts`:
- Line 131: Replace the hardcoded "gpt-5.5" in the help string for the
--model/-m option with the shared DEFAULT_MODEL constant so the CLI help stays
in sync with future model bumps; locate the string in
lib/codex-manager/commands/report.ts (the line containing `" --model, -m
Probe model for live mode (default: gpt-5.5)"`) and interpolate or concatenate
DEFAULT_MODEL (the same constant used elsewhere in this file) into that help
text.
In `@test/codex-manager-report-command.test.ts`:
- Line 534: Replace the hardcoded "gpt-5.5" literal in the
fetchCodexQuotaSnapshot assertion with the shared DEFAULT_MODEL constant: import
DEFAULT_MODEL from lib/request/helpers/model-map.js at the top of the test file
and use DEFAULT_MODEL in the assertion that currently references "gpt-5.5" so
the test follows the canonical default model; update any nearby test references
to the same literal to use DEFAULT_MODEL as well.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: ASSERTIVE
Plan: Pro
Run ID: c867aca9-52d3-4f89-b0a3-554de09292c3
📒 Files selected for processing (6)
lib/codex-manager/commands/report.tsscripts/check-pack-budget-lib.jstest/check-pack-budget.test.tstest/codex-manager-help.test.tstest/codex-manager-report-command.test.tstest/repair-commands.test.ts
📜 Review details
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
- GitHub Check: Greptile Review
🧰 Additional context used
📓 Path-based instructions (8)
test/**/*.test.ts
📄 CodeRabbit inference engine (test/AGENTS.md)
test/**/*.test.ts: Vitest globals (describe,it,expect) are enabled and should be used without explicit imports
Maintain 80% coverage threshold across statements, branches, functions, and lines
UseremoveWithRetryfor Windows filesystem cleanup instead of barefs.rmto handle EBUSY/EPERM/ENOTEMPTY backoff
Use source files in tests, not compileddist/files; test the source directly
Do not skip tests without justification; include rationale if a test must be skipped
Relax ESLint rules for test files as specified ineslint.config.js
Files:
test/repair-commands.test.tstest/codex-manager-report-command.test.tstest/codex-manager-help.test.tstest/check-pack-budget.test.ts
**/*.ts
📄 CodeRabbit inference engine (AGENTS.md)
Do not use
as any,@ts-ignore, or@ts-expect-errortype assertions
Files:
test/repair-commands.test.tstest/codex-manager-report-command.test.tstest/codex-manager-help.test.tslib/codex-manager/commands/report.tstest/check-pack-budget.test.ts
**/*.{ts,js}
📄 CodeRabbit inference engine (AGENTS.md)
Use ESM module syntax exclusively; the project is ESM-only with
"type": "module"
Files:
test/repair-commands.test.tstest/codex-manager-report-command.test.tstest/codex-manager-help.test.tslib/codex-manager/commands/report.tsscripts/check-pack-budget-lib.jstest/check-pack-budget.test.ts
test/**/*.ts
📄 CodeRabbit inference engine (AGENTS.md)
Windows filesystem operations must include retry handling for transient
EBUSY,EPERM, andENOTEMPTYerrors where tests cover Windows locks
Files:
test/repair-commands.test.tstest/codex-manager-report-command.test.tstest/codex-manager-help.test.tstest/check-pack-budget.test.ts
test/**
⚙️ CodeRabbit configuration file
tests must stay deterministic and use vitest. demand regression cases that reproduce concurrency bugs, token refresh races, and windows filesystem behavior. reject changes that mock real secrets or skip assertions.
Files:
test/repair-commands.test.tstest/codex-manager-report-command.test.tstest/codex-manager-help.test.tstest/check-pack-budget.test.ts
lib/**/*.ts
📄 CodeRabbit inference engine (lib/AGENTS.md)
lib/**/*.ts: All public exports should flow throughlib/index.tsor documented package subpaths
Never import fromdist/in source tests or library code
Never suppress type errors
Files:
lib/codex-manager/commands/report.ts
lib/**
⚙️ CodeRabbit configuration file
focus on auth rotation, windows filesystem IO, and concurrency. verify every change cites affected tests (vitest) and that new queues handle EBUSY/429 scenarios. check for logging that leaks tokens or emails.
Files:
lib/codex-manager/commands/report.ts
scripts/*.js
📄 CodeRabbit inference engine (AGENTS.md)
Windows filesystem operations must include retry handling for transient
EBUSY,EPERM, andENOTEMPTYerrors
Files:
scripts/check-pack-budget-lib.js
🧠 Learnings (62)
📓 Common learnings
Learnt from: CR
Repo: ndycode/codex-multi-auth PR: 0
File: docs/releases/v2.1.13-beta.0.md:0-0
Timestamp: 2026-05-27T15:59:46.782Z
Learning: Applies to docs/releases/**/*.{e2e,integration}.test.{ts,js} : Add end-to-end regression coverage for pinned-503 rate-limited and cooling-down paths; extend disabled-account test case to assert new structured fields
Learnt from: CR
Repo: ndycode/codex-multi-auth PR: 0
File: docs/releases/v1.3.1.md:0-0
Timestamp: 2026-05-21T00:32:01.979Z
Learning: Applies to docs/releases/**/model-map*.{js,ts,tsx,jsx} : Support GPT-5.5 and GPT-5.5 Pro as first-attempt models on supported Codex runtimes with deterministic fallback behavior for older runtimes
Learnt from: CR
Repo: ndycode/codex-multi-auth PR: 0
File: docs/development/implementation-plans/subagent-handoffs/pr-07-model-capability-matrix.md:0-0
Timestamp: 2026-05-21T00:25:34.447Z
Learning: Applies to docs/development/implementation-plans/subagent-handoffs/lib/{codex-manager,index}.ts : Update codex-manager exports and main entry points (`lib/codex-manager.ts`, `lib/index.ts`) to include new model capability matrix functionality
Learnt from: CR
Repo: ndycode/codex-multi-auth PR: 0
File: docs/releases/v2.1.2.md:0-0
Timestamp: 2026-05-21T00:32:54.402Z
Learning: Applies to docs/releases/{package.json,bin/**,**/*codex-multi-auth*} : `codex-multi-auth-codex` remains the explicit forwarding wrapper; `codex-multi-auth` remains the account-management command family
Learnt from: CR
Repo: ndycode/codex-multi-auth PR: 0
File: docs/audits/evidence/oracle-verdicts.md:0-0
Timestamp: 2026-05-21T00:20:06.769Z
Learning: Applies to docs/audits/evidence/{package.json,.github/**/*.yml,scripts/*.js,Makefile} : Add explicit gate in CI/build process to verify `pack:check` exits 0 and tarball inspection finds no test fixtures, `.codex/` dirs, `.env` files, or leaked dev artifacts before publishing npm package; block release on failure
Learnt from: CR
Repo: ndycode/codex-multi-auth PR: 0
File: docs/releases/v2.0.1.md:0-0
Timestamp: 2026-05-21T00:32:20.873Z
Learning: Live quota probes and fallback model defaults should use current selectors including `gpt-5.3-codex` and `gpt-5.5`
Learnt from: CR
Repo: ndycode/codex-multi-auth PR: 0
File: docs/development/implementation-plans/subagent-handoffs/pr-09-monitor-command.md:0-0
Timestamp: 2026-05-21T00:25:46.114Z
Learning: Applies to docs/development/implementation-plans/subagent-handoffs/lib/codex-manager/commands/monitor.ts : Add `codex-multi-auth monitor` command to aggregate local runtime observability, usage, account policies, routing profile context, budget guards, model capability matrix summary, quota cache counts, and current project context
Learnt from: CR
Repo: ndycode/codex-multi-auth PR: 0
File: docs/releases/v1.2.1.md:0-0
Timestamp: 2026-05-21T00:31:02.762Z
Learning: Applies to docs/releases/src/wrapper/**/*.{ts,js} : Fix `codex-multi-auth` wrapper version flags handling
Learnt from: CR
Repo: ndycode/codex-multi-auth PR: 0
File: docs/releases/v2.2.0.md:0-0
Timestamp: 2026-06-02T12:30:22.274Z
Learning: Applies to docs/releases/**/quota*.{js,ts,tsx} : Detect unsupported Codex model from upstream error `detail` shape and surface a friendly 'Codex unavailable' note across `best` / `forecast` / `report` / live-check surfaces instead of leaking raw upstream text
Learnt from: CR
Repo: ndycode/codex-multi-auth PR: 0
File: docs/development/implementation-plans/subagent-handoffs/pr-07-model-capability-matrix.md:0-0
Timestamp: 2026-05-21T00:25:34.447Z
Learning: Applies to docs/development/implementation-plans/subagent-handoffs/lib/codex-manager/commands/models.ts : Implement models command integration in `lib/codex-manager/commands/models.ts` for the model capability matrix feature
Learnt from: CR
Repo: ndycode/codex-multi-auth PR: 0
File: docs/configuration.md:0-0
Timestamp: 2026-05-31T13:20:01.206Z
Learning: Applies to docs/config/codex-modern.json : Configuration shipped templates must expose first-class current OpenAI model aliases, with `config/codex-modern.json` including `gpt-5.5` and `gpt-5.5-pro`
Learnt from: CR
Repo: ndycode/codex-multi-auth PR: 0
File: docs/development/IA_FINDABILITY_AUDIT_2026-03-01.md:0-0
Timestamp: 2026-05-21T00:22:26.487Z
Learning: Applies to docs/development/lib/**/*.ts : Canonicalize all runtime usage and error strings in help text to use `codex-multi-auth ...` (not `codex-multi-auth auth ...` or other prefixed forms) in CLI output
Learnt from: CR
Repo: ndycode/codex-multi-auth PR: 0
File: docs/releases/v1.2.1.md:0-0
Timestamp: 2026-05-21T00:31:02.762Z
Learning: Applies to docs/releases/src/**/openai/**/*.{ts,js} : Align GPT-5 model routing with current OpenAI defaults
Learnt from: CR
Repo: ndycode/codex-multi-auth PR: 0
File: docs/development/GITHUB_DISCOVERABILITY.md:0-0
Timestamp: 2026-05-21T00:22:11.873Z
Learning: GitHub repository topics should include: codex, codex-cli, openai, chatgpt, oauth, oauth2, pkce, multi-account, cli, terminal-ui, typescript, nodejs, developer-tools, authentication, account-switching, runtime-rotation, responses-api, diagnostics, recovery-tools, account-health, quota-management, productivity
Learnt from: CR
Repo: ndycode/codex-multi-auth PR: 0
File: docs/development/implementation-plans/subagent-handoffs/pr-07-model-capability-matrix.md:0-0
Timestamp: 2026-05-21T00:25:34.447Z
Learning: Applies to docs/development/implementation-plans/subagent-handoffs/lib/codex-manager/help.ts : Update help documentation (`lib/codex-manager/help.ts`) to document the models command and capability matrix features
Learnt from: CR
Repo: ndycode/codex-multi-auth
Timestamp: 2026-06-03T08:53:41.967Z
Learning: Use `npm i -g codex-multi-auth` for installation of the codex-multi-auth package
Learnt from: CR
Repo: ndycode/codex-multi-auth
Timestamp: 2026-06-03T08:53:41.967Z
Learning: The package exports three global binaries: `codex-multi-auth`, `codex-multi-auth-codex`, and `codex-multi-auth-app-launcher`. Do not create a global `codex` binary; let the official OpenAI install own that command.
Learnt from: CR
Repo: ndycode/codex-multi-auth
Timestamp: 2026-06-03T08:53:41.967Z
Learning: Store account credentials and configuration under `~/.codex/multi-auth/` by default, with support for custom root via `CODEX_MULTI_AUTH_DIR` environment variable
Learnt from: CR
Repo: ndycode/codex-multi-auth
Timestamp: 2026-06-03T08:53:41.967Z
Learning: Support per-project account storage at `~/.codex/multi-auth/projects/<project-key>/openai-codex-accounts.json` for repo-specific workflows
Learnt from: CR
Repo: ndycode/codex-multi-auth
Timestamp: 2026-06-03T08:53:41.967Z
Learning: Implement health-aware account selection with automatic failover, quota forecasting, and flagged-account recovery logic
Learnt from: CR
Repo: ndycode/codex-multi-auth
Timestamp: 2026-06-03T08:53:41.967Z
Learning: Disable whole-pool replay by default when every account is rate-limited, and implement bounded outbound request budgets so one prompt cannot walk the full pool indefinitely
Learnt from: CR
Repo: ndycode/codex-multi-auth
Timestamp: 2026-06-03T08:53:41.967Z
Learning: Trigger a short cooldown instead of continuing aggressive rotation when repeated cross-account 5xx bursts occur
Learnt from: CR
Repo: ndycode/codex-multi-auth
Timestamp: 2026-06-03T08:53:41.967Z
Learning: Keep Responses background mode opt-in via `backgroundResponses` setting or `CODEX_AUTH_BACKGROUND_RESPONSES=1` environment variable, only for callers intentionally sending `background: true`
Learnt from: CR
Repo: ndycode/codex-multi-auth
Timestamp: 2026-06-03T08:53:41.967Z
Learning: Enable runtime rotation by default for request-bearing wrapper-launched Codex sessions, with explicit `codex-multi-auth rotation enable` and `codex-multi-auth rotation disable` repair commands
Learnt from: CR
Repo: ndycode/codex-multi-auth
Timestamp: 2026-06-03T08:53:41.967Z
Learning: Perform best-effort daily npm version check during forwarded Codex startup, printing manual upgrade notice only on interactive TTY or when `CODEX_MULTI_AUTH_DEBUG=1`. Never automatically run npm install or update.
Learnt from: CR
Repo: ndycode/codex-multi-auth
Timestamp: 2026-06-03T08:53:41.967Z
Learning: Make experimental features non-destructive by default: sync previews before apply, preserve destination-only accounts, and fail safely on backup filename collisions
Learnt from: CR
Repo: ndycode/codex-multi-auth
Timestamp: 2026-06-03T08:53:41.967Z
Learning: Use staggered proactive refresh to reduce background refresh bursts and prevent overloading the system
Learnt from: CR
Repo: ndycode/codex-multi-auth
Timestamp: 2026-06-03T08:53:41.967Z
Learning: Credentials and OAuth tokens should stay local; runtime rotation should be loopback-only for security
Learnt from: CR
Repo: ndycode/codex-multi-auth
Timestamp: 2026-06-03T08:53:41.967Z
Learning: This is an independent open-source project, not an official OpenAI product. For production/commercial workloads, use the OpenAI Platform API instead
📚 Learning: 2026-05-21T00:22:26.487Z
Learnt from: CR
Repo: ndycode/codex-multi-auth PR: 0
File: docs/development/IA_FINDABILITY_AUDIT_2026-03-01.md:0-0
Timestamp: 2026-05-21T00:22:26.487Z
Learning: Applies to docs/development/test/documentation.test.ts : Maintain deterministic regression test in `test/documentation.test.ts` that verifies fix command flag documentation is aligned consistently across README.md, docs/reference/commands.md, and CLI runtime usage text
Applied to files:
test/repair-commands.test.tstest/codex-manager-report-command.test.tstest/codex-manager-help.test.tslib/codex-manager/commands/report.ts
📚 Learning: 2026-05-21T00:22:54.020Z
Learnt from: CR
Repo: ndycode/codex-multi-auth PR: 0
File: docs/development/RUNBOOK_ADD_AUTH_COMMAND.md:0-0
Timestamp: 2026-05-21T00:22:54.020Z
Learning: Applies to docs/development/test/documentation.test.ts : Update `test/documentation.test.ts` if new command text must stay aligned across docs and runtime usage text
Applied to files:
test/repair-commands.test.tstest/codex-manager-report-command.test.tstest/codex-manager-help.test.tslib/codex-manager/commands/report.ts
📚 Learning: 2026-05-21T00:23:03.577Z
Learnt from: CR
Repo: ndycode/codex-multi-auth PR: 0
File: docs/development/RUNBOOK_ADD_AUTH_MANAGER_COMMAND.md:0-0
Timestamp: 2026-05-21T00:23:03.577Z
Learning: Applies to docs/development/test/documentation.test.ts : Extend `test/documentation.test.ts` when command text or help changes to ensure docs parity
Applied to files:
test/repair-commands.test.tstest/codex-manager-help.test.tslib/codex-manager/commands/report.ts
📚 Learning: 2026-05-21T00:34:47.250Z
Learnt from: CR
Repo: ndycode/codex-multi-auth PR: 0
File: test/AGENTS.md:0-0
Timestamp: 2026-05-21T00:34:47.250Z
Learning: Applies to test/**/documentation.test.ts : Test documentation parity including command flags, config precedence, changelog policy, and governance rules
Applied to files:
test/repair-commands.test.tstest/codex-manager-report-command.test.tstest/codex-manager-help.test.ts
📚 Learning: 2026-05-21T00:22:54.020Z
Learnt from: CR
Repo: ndycode/codex-multi-auth PR: 0
File: docs/development/RUNBOOK_ADD_AUTH_COMMAND.md:0-0
Timestamp: 2026-05-21T00:22:54.020Z
Learning: Applies to docs/development/test/codex-manager-cli.test.ts : Add or extend CLI tests covering success path, invalid input or missing args, JSON mode if supported, and non-interactive behavior in `test/codex-manager-cli.test.ts`
Applied to files:
test/repair-commands.test.tstest/codex-manager-report-command.test.tstest/codex-manager-help.test.tslib/codex-manager/commands/report.tstest/check-pack-budget.test.ts
📚 Learning: 2026-05-21T00:22:26.487Z
Learnt from: CR
Repo: ndycode/codex-multi-auth PR: 0
File: docs/development/IA_FINDABILITY_AUDIT_2026-03-01.md:0-0
Timestamp: 2026-05-21T00:22:26.487Z
Learning: Applies to docs/development/test/documentation.test.ts : Maintain deterministic regression test in `test/documentation.test.ts` that verifies compatibility command aliases are scoped to reference, troubleshooting, and migration documentation with explicit allowlist enforcement
Applied to files:
test/repair-commands.test.tstest/codex-manager-report-command.test.tstest/codex-manager-help.test.ts
📚 Learning: 2026-05-21T00:23:03.577Z
Learnt from: CR
Repo: ndycode/codex-multi-auth PR: 0
File: docs/development/RUNBOOK_ADD_AUTH_MANAGER_COMMAND.md:0-0
Timestamp: 2026-05-21T00:23:03.577Z
Learning: Applies to docs/development/test/codex-manager-cli.test.ts : Add or extend `test/codex-manager-cli.test.ts` with test coverage for new command paths
Applied to files:
test/repair-commands.test.tstest/codex-manager-report-command.test.tstest/codex-manager-help.test.tslib/codex-manager/commands/report.ts
📚 Learning: 2026-05-21T00:32:08.338Z
Learnt from: CR
Repo: ndycode/codex-multi-auth PR: 0
File: docs/releases/v1.3.2.md:0-0
Timestamp: 2026-05-21T00:32:08.338Z
Learning: Applies to docs/releases/**/*.test.{js,ts} : Add regression coverage for explicit no-capture forwarding, explicit capture forwarding, unsupported-model retries, and fixture-pinned `CODEX_HOME` isolation in test suite
Applied to files:
test/repair-commands.test.tstest/codex-manager-report-command.test.tstest/codex-manager-help.test.tstest/check-pack-budget.test.ts
📚 Learning: 2026-05-21T00:30:00.875Z
Learnt from: CR
Repo: ndycode/codex-multi-auth PR: 0
File: docs/releases/v0.1.2.md:0-0
Timestamp: 2026-05-21T00:30:00.875Z
Learning: Applies to docs/releases/**/*.test.{js,ts,mjs,cjs} : Expand regression coverage for backup-depth recovery, staged rename retries, and parallel-save ordering guarantees in test suites
Applied to files:
test/repair-commands.test.tstest/check-pack-budget.test.ts
📚 Learning: 2026-05-21T00:30:21.731Z
Learnt from: CR
Repo: ndycode/codex-multi-auth PR: 0
File: docs/releases/v0.1.5.md:0-0
Timestamp: 2026-05-21T00:30:21.731Z
Learning: Run `npx vitest run test/test-model-matrix-script.test.ts` as part of release validation
Applied to files:
test/repair-commands.test.tstest/codex-manager-report-command.test.ts
📚 Learning: 2026-05-21T00:27:54.022Z
Learnt from: CR
Repo: ndycode/codex-multi-auth PR: 0
File: docs/reference/commands.md:0-0
Timestamp: 2026-05-21T00:27:54.022Z
Learning: codex-multi-auth verify runs self-tests for storage paths (process.cwd, findProjectRoot, resolveProjectStorageIdentityRoot, getProjectStorageKey, getProjectConfigDir, getProjectGlobalConfigDir) and sandbox probes that reject escape candidates; modes include --paths, --flagged, or --all
Applied to files:
test/repair-commands.test.ts
📚 Learning: 2026-05-21T00:19:02.858Z
Learnt from: CR
Repo: ndycode/codex-multi-auth PR: 0
File: docs/audits/evidence/dim-K-tests.md:0-0
Timestamp: 2026-05-21T00:19:02.858Z
Learning: Applies to docs/audits/evidence/test/flagged-storage-io.test.ts : Add regression test for storage recovery non-atomicity issue (E-03) in flagged-storage-io tests
Applied to files:
test/repair-commands.test.ts
📚 Learning: 2026-05-21T00:27:54.022Z
Learnt from: CR
Repo: ndycode/codex-multi-auth PR: 0
File: docs/reference/commands.md:0-0
Timestamp: 2026-05-21T00:27:54.022Z
Learning: Use --dry-run flag with verify-flagged, verify (with --flagged or --all), fix, and doctor to preview changes without writing storage
Applied to files:
test/repair-commands.test.ts
📚 Learning: 2026-05-21T00:15:46.683Z
Learnt from: CR
Repo: ndycode/codex-multi-auth PR: 0
File: docs/DOCUMENTATION.md:0-0
Timestamp: 2026-05-21T00:15:46.683Z
Learning: Applies to docs/reference/commands.md : Verify CLI flags documented in references match runtime parser/usage output
Applied to files:
test/repair-commands.test.ts
📚 Learning: 2026-05-21T00:26:08.267Z
Learnt from: CR
Repo: ndycode/codex-multi-auth PR: 0
File: docs/development/implementation-plans/subagent-handoffs/pr-12-integration-generators.md:0-0
Timestamp: 2026-05-21T00:26:08.267Z
Learning: Applies to docs/development/implementation-plans/subagent-handoffs/test/codex-manager-integrations-command.test.ts : Add tests for the codex-manager integrations command
Applied to files:
test/codex-manager-report-command.test.tstest/codex-manager-help.test.ts
📚 Learning: 2026-05-21T00:21:13.269Z
Learnt from: CR
Repo: ndycode/codex-multi-auth PR: 0
File: docs/development/CLI_UI_DEEPSEARCH_AUDIT.md:0-0
Timestamp: 2026-05-21T00:21:13.269Z
Learning: Applies to docs/development/test/codex-manager-cli.test.ts : Ensure regression test coverage proving `Q` cancel discards modified drafts across account-list, summary-fields, behavior, theme, and backend flows
Applied to files:
test/codex-manager-report-command.test.tstest/codex-manager-help.test.tslib/codex-manager/commands/report.ts
📚 Learning: 2026-05-21T00:25:34.447Z
Learnt from: CR
Repo: ndycode/codex-multi-auth PR: 0
File: docs/development/implementation-plans/subagent-handoffs/pr-07-model-capability-matrix.md:0-0
Timestamp: 2026-05-21T00:25:34.447Z
Learning: Applies to docs/development/implementation-plans/subagent-handoffs/test/{model-capability-matrix,codex-manager-models-command,test-model-matrix-script}.test.ts : Ensure test coverage for model capability matrix with test files `test/model-capability-matrix.test.ts`, `test/codex-manager-models-command.test.ts`, and `test/test-model-matrix-script.test.ts`
Applied to files:
test/codex-manager-report-command.test.ts
📚 Learning: 2026-05-21T00:25:34.447Z
Learnt from: CR
Repo: ndycode/codex-multi-auth PR: 0
File: docs/development/implementation-plans/subagent-handoffs/pr-07-model-capability-matrix.md:0-0
Timestamp: 2026-05-21T00:25:34.447Z
Learning: Applies to docs/development/implementation-plans/subagent-handoffs/lib/codex-manager/commands/models.ts : Implement models command integration in `lib/codex-manager/commands/models.ts` for the model capability matrix feature
Applied to files:
test/codex-manager-report-command.test.tstest/codex-manager-help.test.tslib/codex-manager/commands/report.ts
📚 Learning: 2026-05-21T00:30:28.313Z
Learnt from: CR
Repo: ndycode/codex-multi-auth PR: 0
File: docs/releases/v0.1.6.md:0-0
Timestamp: 2026-05-21T00:30:28.313Z
Learning: Applies to docs/releases/test/codex-cli-state.test.ts : Run tests for Codex CLI state validation: `npm test -- test/codex-cli-state.test.ts`
Applied to files:
test/codex-manager-report-command.test.ts
📚 Learning: 2026-05-21T00:25:34.447Z
Learnt from: CR
Repo: ndycode/codex-multi-auth PR: 0
File: docs/development/implementation-plans/subagent-handoffs/pr-07-model-capability-matrix.md:0-0
Timestamp: 2026-05-21T00:25:34.447Z
Learning: Applies to docs/development/implementation-plans/subagent-handoffs/lib/{codex-manager,index}.ts : Update codex-manager exports and main entry points (`lib/codex-manager.ts`, `lib/index.ts`) to include new model capability matrix functionality
Applied to files:
test/codex-manager-report-command.test.tslib/codex-manager/commands/report.ts
📚 Learning: 2026-05-21T00:32:01.979Z
Learnt from: CR
Repo: ndycode/codex-multi-auth PR: 0
File: docs/releases/v1.3.1.md:0-0
Timestamp: 2026-05-21T00:32:01.979Z
Learning: Applies to docs/releases/**/model-map*.{js,ts,tsx,jsx} : Support GPT-5.5 and GPT-5.5 Pro as first-attempt models on supported Codex runtimes with deterministic fallback behavior for older runtimes
Applied to files:
test/codex-manager-report-command.test.tstest/codex-manager-help.test.tslib/codex-manager/commands/report.ts
📚 Learning: 2026-05-21T00:32:20.873Z
Learnt from: CR
Repo: ndycode/codex-multi-auth PR: 0
File: docs/releases/v2.0.1.md:0-0
Timestamp: 2026-05-21T00:32:20.873Z
Learning: Live quota probes and fallback model defaults should use current selectors including `gpt-5.3-codex` and `gpt-5.5`
Applied to files:
test/codex-manager-report-command.test.tslib/codex-manager/commands/report.ts
📚 Learning: 2026-06-02T12:30:22.274Z
Learnt from: CR
Repo: ndycode/codex-multi-auth PR: 0
File: docs/releases/v2.2.0.md:0-0
Timestamp: 2026-06-02T12:30:22.274Z
Learning: Applies to docs/releases/**/quota*.{js,ts,tsx} : Detect unsupported Codex model from upstream error `detail` shape and surface a friendly 'Codex unavailable' note across `best` / `forecast` / `report` / live-check surfaces instead of leaking raw upstream text
Applied to files:
test/codex-manager-report-command.test.ts
📚 Learning: 2026-05-21T00:25:34.447Z
Learnt from: CR
Repo: ndycode/codex-multi-auth PR: 0
File: docs/development/implementation-plans/subagent-handoffs/pr-07-model-capability-matrix.md:0-0
Timestamp: 2026-05-21T00:25:34.447Z
Learning: Applies to docs/development/implementation-plans/subagent-handoffs/lib/codex-manager/help.ts : Update help documentation (`lib/codex-manager/help.ts`) to document the models command and capability matrix features
Applied to files:
test/codex-manager-report-command.test.tstest/codex-manager-help.test.tslib/codex-manager/commands/report.ts
📚 Learning: 2026-05-21T00:34:47.250Z
Learnt from: CR
Repo: ndycode/codex-multi-auth PR: 0
File: test/AGENTS.md:0-0
Timestamp: 2026-05-21T00:34:47.250Z
Learning: Applies to test/**/codex-manager-cli.test.ts : Test CLI settings with question cancellation across all 5 panels and EBUSY/concurrent race conditions
Applied to files:
test/codex-manager-report-command.test.ts
📚 Learning: 2026-05-21T00:25:46.114Z
Learnt from: CR
Repo: ndycode/codex-multi-auth PR: 0
File: docs/development/implementation-plans/subagent-handoffs/pr-09-monitor-command.md:0-0
Timestamp: 2026-05-21T00:25:46.114Z
Learning: Applies to docs/development/implementation-plans/subagent-handoffs/test/codex-manager-monitor-command.test.ts : Create comprehensive test coverage for the monitor command including runtime policy validation
Applied to files:
test/codex-manager-report-command.test.ts
📚 Learning: 2026-05-21T00:30:54.269Z
Learnt from: CR
Repo: ndycode/codex-multi-auth PR: 0
File: docs/releases/v1.1.10.md:0-0
Timestamp: 2026-05-21T00:30:54.269Z
Learning: Include comprehensive validation and JSON output coverage for auth CLI commands, including help, malformed flags, null storage, concurrency, and sync-state edge cases
Applied to files:
test/codex-manager-report-command.test.ts
📚 Learning: 2026-05-21T00:18:12.895Z
Learnt from: CR
Repo: ndycode/codex-multi-auth PR: 0
File: docs/audits/evidence/dim-G-cli.md:0-0
Timestamp: 2026-05-21T00:18:12.895Z
Learning: Applies to docs/audits/evidence/lib/codex-manager/cli-commands/**/*.ts : Standardize `--json` flag support across all subcommands (`list`, `switch`, `check`, `forecast`, `fix`, `report`, `doctor`, `verify-flagged`) to ensure uniform JSON output capability
Applied to files:
test/codex-manager-report-command.test.tstest/codex-manager-help.test.tslib/codex-manager/commands/report.ts
📚 Learning: 2026-05-21T00:30:44.991Z
Learnt from: CR
Repo: ndycode/codex-multi-auth PR: 0
File: docs/releases/v0.1.8.md:0-0
Timestamp: 2026-05-21T00:30:44.991Z
Learning: Applies to docs/releases/**/*{dashboard,cli}*.{test,spec}.{ts,tsx,js,jsx} : Dashboard and CLI test harness coverage must be expanded to cover experimental settings and wrapper behavior
Applied to files:
test/codex-manager-report-command.test.ts
📚 Learning: 2026-05-21T00:18:12.895Z
Learnt from: CR
Repo: ndycode/codex-multi-auth PR: 0
File: docs/audits/evidence/dim-G-cli.md:0-0
Timestamp: 2026-05-21T00:18:12.895Z
Learning: Applies to docs/audits/evidence/lib/codex-manager/cli-commands/**/*.ts : Verify and document `codex --help` output parity with README subcommand enumeration to ensure help discoverability
Applied to files:
test/codex-manager-help.test.tslib/codex-manager/commands/report.ts
📚 Learning: 2026-05-21T00:30:10.391Z
Learnt from: CR
Repo: ndycode/codex-multi-auth PR: 0
File: docs/releases/v0.1.3.md:0-0
Timestamp: 2026-05-21T00:30:10.391Z
Learning: Applies to docs/releases/test/**/*.test.ts : Validate releases by running `npm run test -- test/codex-manager-cli.test.ts` to ensure regression coverage
Applied to files:
test/codex-manager-help.test.tstest/check-pack-budget.test.ts
📚 Learning: 2026-05-21T00:23:03.577Z
Learnt from: CR
Repo: ndycode/codex-multi-auth PR: 0
File: docs/development/RUNBOOK_ADD_AUTH_MANAGER_COMMAND.md:0-0
Timestamp: 2026-05-21T00:23:03.577Z
Learning: Applies to docs/development/lib/codex-manager.ts : Add the smallest possible parsing/dispatch change in `lib/codex-manager.ts` when adding a new `codex-multi-auth` command
Applied to files:
test/codex-manager-help.test.tslib/codex-manager/commands/report.ts
📚 Learning: 2026-05-21T00:23:03.577Z
Learnt from: CR
Repo: ndycode/codex-multi-auth PR: 0
File: docs/development/RUNBOOK_ADD_AUTH_MANAGER_COMMAND.md:0-0
Timestamp: 2026-05-21T00:23:03.577Z
Learning: Applies to docs/development/lib/codex-manager/**/*.ts : Extract command helpers under `lib/codex-manager/` when a command has more than one logical branch instead of growing the main file
Applied to files:
test/codex-manager-help.test.ts
📚 Learning: 2026-05-27T15:54:51.791Z
Learnt from: CR
Repo: ndycode/codex-multi-auth PR: 0
File: docs/releases/v2.1.12.md:0-0
Timestamp: 2026-05-27T15:54:51.791Z
Learning: Applies to docs/releases/**/*.test.{js,ts,py} : Add regression coverage for literal TOML keys, CRLF preservation, table-like content inside strings and arrays, alternate hook paths, long hook keys, shadow `hooks.json` visibility, and concurrent runtime shadow launches
Applied to files:
test/codex-manager-help.test.tstest/check-pack-budget.test.ts
📚 Learning: 2026-05-21T00:17:08.066Z
Learnt from: CR
Repo: ndycode/codex-multi-auth PR: 0
File: docs/audits/MASTER_AUDIT.md:0-0
Timestamp: 2026-05-21T00:17:08.066Z
Learning: Applies to docs/audits/lib/codex-manager.ts : Standardize `--json` output format across all `codex auth` subcommands (status, check, list, forecast, report, verify-flagged, doctor, fix) with consistent schema versioning
Applied to files:
lib/codex-manager/commands/report.ts
📚 Learning: 2026-05-21T00:22:26.487Z
Learnt from: CR
Repo: ndycode/codex-multi-auth PR: 0
File: docs/development/IA_FINDABILITY_AUDIT_2026-03-01.md:0-0
Timestamp: 2026-05-21T00:22:26.487Z
Learning: Applies to docs/development/lib/**/*.ts : Canonicalize all runtime usage and error strings in help text to use `codex-multi-auth ...` (not `codex-multi-auth auth ...` or other prefixed forms) in CLI output
Applied to files:
lib/codex-manager/commands/report.ts
📚 Learning: 2026-05-21T00:22:26.487Z
Learnt from: CR
Repo: ndycode/codex-multi-auth PR: 0
File: docs/development/IA_FINDABILITY_AUDIT_2026-03-01.md:0-0
Timestamp: 2026-05-21T00:22:26.487Z
Learning: Applies to docs/development/test/documentation.test.ts : Extend Windows cross-platform verification patterns in `test/documentation.test.ts` to include explicit `codex-multi-auth` output-escaping checks for cmd.exe and PowerShell whenever new shell-sensitive command rendering is introduced
Applied to files:
lib/codex-manager/commands/report.ts
📚 Learning: 2026-05-21T00:31:02.762Z
Learnt from: CR
Repo: ndycode/codex-multi-auth PR: 0
File: docs/releases/v1.2.1.md:0-0
Timestamp: 2026-05-21T00:31:02.762Z
Learning: Applies to docs/releases/src/**/openai/**/*.{ts,js} : Align GPT-5 model routing with current OpenAI defaults
Applied to files:
lib/codex-manager/commands/report.ts
📚 Learning: 2026-05-21T00:19:18.672Z
Learnt from: CR
Repo: ndycode/codex-multi-auth PR: 0
File: docs/audits/evidence/dim-LM-release-docs.md:0-0
Timestamp: 2026-05-21T00:19:18.672Z
Learning: Applies to docs/audits/evidence/{package.json,.npmignore,scripts/build.js} : Fix `npm run pack:check` failure — required package content missing from npm pack output: `dist/` directory must be included in published tarball
Applied to files:
scripts/check-pack-budget-lib.jstest/check-pack-budget.test.ts
📚 Learning: 2026-05-21T00:20:06.769Z
Learnt from: CR
Repo: ndycode/codex-multi-auth PR: 0
File: docs/audits/evidence/oracle-verdicts.md:0-0
Timestamp: 2026-05-21T00:20:06.769Z
Learning: Applies to docs/audits/evidence/{package.json,scripts/*.js,dist/**} : Ensure `pack:check` gate passes on all build artifacts; inspect tarball manifest to verify no `.env`, test fixtures, `.codex/`, or dev-only artifacts containing tokens/credentials are included in npm package
Applied to files:
scripts/check-pack-budget-lib.jstest/check-pack-budget.test.ts
📚 Learning: 2026-05-21T00:20:06.769Z
Learnt from: CR
Repo: ndycode/codex-multi-auth PR: 0
File: docs/audits/evidence/oracle-verdicts.md:0-0
Timestamp: 2026-05-21T00:20:06.769Z
Learning: Applies to docs/audits/evidence/{package.json,.github/**/*.yml,scripts/*.js,Makefile} : Add explicit gate in CI/build process to verify `pack:check` exits 0 and tarball inspection finds no test fixtures, `.codex/` dirs, `.env` files, or leaked dev artifacts before publishing npm package; block release on failure
Applied to files:
scripts/check-pack-budget-lib.jstest/check-pack-budget.test.ts
📚 Learning: 2026-05-21T00:31:50.443Z
Learnt from: CR
Repo: ndycode/codex-multi-auth PR: 0
File: docs/releases/v1.3.0.md:0-0
Timestamp: 2026-05-21T00:31:50.443Z
Learning: Applies to docs/releases/**/{package.json,build.ts,scripts/*.ts} : Run `pack:check` build before running tests to ensure package integrity
Applied to files:
scripts/check-pack-budget-lib.jstest/check-pack-budget.test.ts
📚 Learning: 2026-05-21T00:52:04.720Z
Learnt from: CR
Repo: ndycode/codex-multi-auth PR: 0
File: docs/releases/v2.1.11.md:0-0
Timestamp: 2026-05-21T00:52:04.720Z
Learning: Applies to docs/releases/**/*.{test,spec}.{js,ts} : Implement a plugin manifest integrity test that validates JSON parsing, package-version parity between package.json and plugin.json, and icon path resolution
Applied to files:
scripts/check-pack-budget-lib.jstest/check-pack-budget.test.ts
📚 Learning: 2026-05-21T00:30:44.991Z
Learnt from: CR
Repo: ndycode/codex-multi-auth PR: 0
File: docs/releases/v0.1.8.md:0-0
Timestamp: 2026-05-21T00:30:44.991Z
Learning: Applies to docs/releases/**/{package.json,package-lock.json,yarn.lock,pnpm-lock.yaml,Gemfile,requirements.txt,go.mod,Cargo.lock} : Ensure dependencies are maintained for audit compliance (e.g., hono library versions)
Applied to files:
scripts/check-pack-budget-lib.js
📚 Learning: 2026-05-21T00:25:04.938Z
Learnt from: CR
Repo: ndycode/codex-multi-auth PR: 0
File: docs/development/implementation-plans/subagent-handoffs/pr-03-usage-command.md:0-0
Timestamp: 2026-05-21T00:25:04.938Z
Learning: All code changes must pass `npm run build` validation
Applied to files:
scripts/check-pack-budget-lib.js
📚 Learning: 2026-05-21T00:17:08.066Z
Learnt from: CR
Repo: ndycode/codex-multi-auth PR: 0
File: docs/audits/MASTER_AUDIT.md:0-0
Timestamp: 2026-05-21T00:17:08.066Z
Learning: Applies to docs/audits/.github/workflows/*.yml : Add CI gate that runs `npm run pack:check` and fails PR on tarball size regression to prevent unintended files in npm distribution
Applied to files:
scripts/check-pack-budget-lib.jstest/check-pack-budget.test.ts
📚 Learning: 2026-05-21T00:25:04.938Z
Learnt from: CR
Repo: ndycode/codex-multi-auth PR: 0
File: docs/development/implementation-plans/subagent-handoffs/pr-03-usage-command.md:0-0
Timestamp: 2026-05-21T00:25:04.938Z
Learning: All code changes must pass `npm test` with relevant test files
Applied to files:
scripts/check-pack-budget-lib.js
📚 Learning: 2026-05-21T00:33:34.237Z
Learnt from: CR
Repo: ndycode/codex-multi-auth PR: 0
File: docs/releases/v2.1.6.md:0-0
Timestamp: 2026-05-21T00:33:34.237Z
Learning: Applies to docs/releases/**/scripts/{install,uninstall}*.js : Pre-filter falsy entries with `list.filter(Boolean)` in `removePluginFromList` to match `scripts/install-codex-auth-utils.js` behavior
Applied to files:
scripts/check-pack-budget-lib.js
📚 Learning: 2026-05-21T00:17:54.509Z
Learnt from: CR
Repo: ndycode/codex-multi-auth PR: 0
File: docs/audits/evidence/dim-E-storage.md:0-0
Timestamp: 2026-05-21T00:17:54.509Z
Learning: Applies to docs/audits/evidence/lib/storage/paths.ts : Fix the known regression in `resolvePath()` that fails to reliably reject lookalike-prefix paths on current HEAD. Harden `isWithinDirectory()` to guard import/export paths against sibling lookalike paths outside approved home/project/tmp roots.
Applied to files:
scripts/check-pack-budget-lib.jstest/check-pack-budget.test.ts
📚 Learning: 2026-05-21T00:19:02.858Z
Learnt from: CR
Repo: ndycode/codex-multi-auth PR: 0
File: docs/audits/evidence/dim-K-tests.md:0-0
Timestamp: 2026-05-21T00:19:02.858Z
Learning: Applies to docs/audits/evidence/test/paths.test.ts : Add regression test for resolvePath() lookalike prefix validation in test/paths.test.ts (currently failing at line 846)
Applied to files:
scripts/check-pack-budget-lib.jstest/check-pack-budget.test.ts
📚 Learning: 2026-05-21T00:20:06.769Z
Learnt from: CR
Repo: ndycode/codex-multi-auth PR: 0
File: docs/audits/evidence/oracle-verdicts.md:0-0
Timestamp: 2026-05-21T00:20:06.769Z
Learning: Applies to docs/audits/evidence/{lib/storage/paths.ts,test/paths.test.ts} : Harden `isWithinDirectory()` in `lib/storage/paths.ts` to reject lookalike-prefix paths that bypass `resolvePath()` guard; add regression tests matching `test/paths.test.ts:842-846` failure case
Applied to files:
scripts/check-pack-budget-lib.jstest/check-pack-budget.test.ts
📚 Learning: 2026-05-21T00:31:37.957Z
Learnt from: CR
Repo: ndycode/codex-multi-auth PR: 0
File: docs/releases/v1.2.7.md:0-0
Timestamp: 2026-05-21T00:31:37.957Z
Learning: Applies to docs/releases/**/*.test.{ts,js},**/*.spec.{ts,js},**/tests/**,**/__tests__/** : Harden native resolver edge cases and validate stale test expectations around native Codex path handling
Applied to files:
scripts/check-pack-budget-lib.jstest/check-pack-budget.test.ts
📚 Learning: 2026-05-21T00:19:02.858Z
Learnt from: CR
Repo: ndycode/codex-multi-auth PR: 0
File: docs/audits/evidence/dim-K-tests.md:0-0
Timestamp: 2026-05-21T00:19:02.858Z
Learning: Applies to docs/audits/evidence/test/plugin-config.test.ts : Update test/plugin-config.test.ts:417 to verify correct CONFIG_PATH precedence behavior
Applied to files:
scripts/check-pack-budget-lib.js
📚 Learning: 2026-05-21T00:32:54.402Z
Learnt from: CR
Repo: ndycode/codex-multi-auth PR: 0
File: docs/releases/v2.1.2.md:0-0
Timestamp: 2026-05-21T00:32:54.402Z
Learning: Applies to docs/releases/{package.json,bin/**} : Drop the global `codex` bin to avoid npm bin collisions with official Codex npm, native, and Homebrew distributions
Applied to files:
scripts/check-pack-budget-lib.js
📚 Learning: 2026-05-21T00:29:48.217Z
Learnt from: CR
Repo: ndycode/codex-multi-auth PR: 0
File: docs/releases/v0.1.1.md:0-0
Timestamp: 2026-05-21T00:29:48.217Z
Learning: Applies to docs/releases/bin/codex{,.js,.ts} : The `codex` bin wrapper must lazy-load auth runtime to prevent early module-load failures in clean/global installs
Applied to files:
scripts/check-pack-budget-lib.js
📚 Learning: 2026-06-03T06:06:56.303Z
Learnt from: CR
Repo: ndycode/codex-multi-auth PR: 0
File: docs/releases/v2.2.1.md:0-0
Timestamp: 2026-06-03T06:06:56.303Z
Learning: Applies to docs/releases/**/*resolver*.js : The Codex bin resolver must skip any PATH candidate inside its own wrapper directory
Applied to files:
scripts/check-pack-budget-lib.js
📚 Learning: 2026-05-21T00:31:37.957Z
Learnt from: CR
Repo: ndycode/codex-multi-auth PR: 0
File: docs/releases/v1.2.7.md:0-0
Timestamp: 2026-05-21T00:31:37.957Z
Learning: Applies to docs/releases/**/wrapper/**,**/launcher/**,**/*wrapper*.{sh,bat,cmd,js,ts},**/*launcher*.{sh,bat,cmd,js,ts},**/bin/**,**/scripts/** : Support native Codex CLI installs alongside npm launcher flow by discovering Codex CLI on PATH for Homebrew and release-binary installs
Applied to files:
scripts/check-pack-budget-lib.js
📚 Learning: 2026-05-21T00:19:18.672Z
Learnt from: CR
Repo: ndycode/codex-multi-auth PR: 0
File: docs/audits/evidence/dim-LM-release-docs.md:0-0
Timestamp: 2026-05-21T00:19:18.672Z
Learning: Applies to docs/audits/evidence/scripts/codex.js : Ensure `npm run build` completes successfully before auth commands in CLI: build artifacts in `dist/lib/codex-manager.js` are required for auth-related operations
Applied to files:
scripts/check-pack-budget-lib.js
📚 Learning: 2026-05-21T00:17:08.066Z
Learnt from: CR
Repo: ndycode/codex-multi-auth PR: 0
File: docs/audits/MASTER_AUDIT.md:0-0
Timestamp: 2026-05-21T00:17:08.066Z
Learning: Applies to docs/audits/test/paths.test.ts : Add regression test for `resolvePath()` lookalike-prefix rejection covering home-directory siblings, project-directory siblings, and tmp-directory siblings on Windows and POSIX systems
Applied to files:
scripts/check-pack-budget-lib.jstest/check-pack-budget.test.ts
📚 Learning: 2026-05-21T00:22:26.487Z
Learnt from: CR
Repo: ndycode/codex-multi-auth PR: 0
File: docs/development/IA_FINDABILITY_AUDIT_2026-03-01.md:0-0
Timestamp: 2026-05-21T00:22:26.487Z
Learning: Applies to docs/development/test/documentation.test.ts : Maintain deterministic regression test in `test/documentation.test.ts` that verifies scoped package references appear only in explicit legacy migration documentation contexts
Applied to files:
test/check-pack-budget.test.ts
📚 Learning: 2026-05-21T00:31:02.762Z
Learnt from: CR
Repo: ndycode/codex-multi-auth PR: 0
File: docs/releases/v1.2.1.md:0-0
Timestamp: 2026-05-21T00:31:02.762Z
Learning: Applies to docs/releases/src/**/*.test.{ts,js} : Validate shipped config templates in test coverage
Applied to files:
test/check-pack-budget.test.ts
🔇 Additional comments (6)
scripts/check-pack-budget-lib.js (1)
16-24: LGTM!Also applies to: 108-114
test/check-pack-budget.test.ts (1)
130-149: LGTM!lib/codex-manager/commands/report.ts (1)
169-169: LGTM!test/codex-manager-help.test.ts (1)
146-152: LGTM!test/codex-manager-report-command.test.ts (1)
95-104: LGTM!test/repair-commands.test.ts (1)
179-187: LGTM!
… assertion CodeRabbit (non-blocking): the report --model help text and the live-probe test assertion still hardcoded 'gpt-5.5'. Reference the shared DEFAULT_MODEL constant so CLI help and the regression stay aligned with the next model bump. Full suite: 4356 passed, 3 skipped, 0 failed; typecheck + lint clean. Co-Authored-By: Claude Opus 4.8 <[email protected]>
|
Cleared the last 2 (non-blocking) items in Every actionable finding across all review rounds is now resolved (--model flag-guard on all 9 sites + short forms + trim, exact-file pack gate, warnings column, DEFAULT_MODEL consolidation, all regressions). Full suite: 4356 passed, 0 failed; typecheck + lint clean; Greptile pass. @coderabbitai full review |
|
✏️ Learnings added
✅ Action performedFull review finished. |
There was a problem hiding this comment.
Actionable comments posted: 10
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (8)
lib/codex-manager.ts (2)
2542-2548:⚠️ Potential issue | 🟠 Major | ⚡ Quick wintrim split-arg
--modelvalues before validating.at
lib/codex-manager.ts:2542-2548, the split-arg path still checks the raw token.best --model " "andbest -m " --json"both bypass the missing/flag-like guard, setmodelProvided = true, and then quietly fall back later vialib/codex-manager.ts:2186. trim before the empty/startsWith("-")checks so this matches the new cli contract.proposed fix
if (arg === "--model" || arg === "-m") { - const value = args[i + 1]; + const value = args[i + 1]?.trim(); if (!value || value.startsWith("-")) { return { ok: false, message: "Missing value for --model" }; } options.model = value;🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@lib/codex-manager.ts` around lines 2542 - 2548, When parsing the --model / -m split-arg in the argument loop, trim the extracted value before performing the empty and startsWith("-") checks and before assigning to options.model; i.e., replace checks against the raw value with checks against value.trim() and set options.model to the trimmed string and options.modelProvided only when the trimmed value is non-empty and not flag-like. This affects the branch handling arg === "--model" || arg === "-m" where options.model and options.modelProvided are set.
2407-2415: 🛠️ Refactor suggestion | 🟠 Major | ⚡ Quick winadd the missing refresh-fail live-probe regression.
lib/codex-manager.ts:2407-2415is now the user-visiblesigned in onlypath forforceRefresh + liveProbe + queuedRefreshfailure with a still-valid session, but this review cohort does not include the matching vitest intest/codex-manager-cli.test.ts. add a deterministic case that asserts both the per-account warning row and the finalcodex available | signed in only | need re-loginsummary so this token-refresh race does not drift silently.as per coding guidelines,
test/**: tests must stay deterministic and use vitest. demand regression cases that reproduce concurrency bugs, token refresh races, and windows filesystem behavior.🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@lib/codex-manager.ts` around lines 2407 - 2415, Add a deterministic vitest regression in test/codex-manager-cli.test.ts that reproduces the forceRefresh + liveProbe + queuedRefresh failure while sessionLikelyValid is true: stub/mocking the refresh path (queuedRefresh/forceRefresh) to throw/return failure, mock liveProbe to fail, and ensure the session validity flag remains true; then run the CLI/manager routine that emits the per-account row (the code path using sessionLikelyValid, liveProbe, signedInOnly, display.showPerAccountRows, stylePromptText, labelText) and assert the console output contains the per-account warning row and the final summary line including "codex available | signed in only | need re-login"; use vitest timers/mocks to keep the test deterministic and avoid real concurrency/file IO.lib/codex-manager/commands/integrations.ts (1)
70-78:⚠️ Potential issue | 🟡 Minor | ⚡ Quick wintrim
--modelvalue before validation.
lib/codex-manager/commands/integrations.ts:71readsargs[i + 1]without trimming before the guard at line 72. tokens like" "will pass the!valuecheck (non-empty string) and the.startsWith("-")check (no leading dash), but represent a missing value. trim before validating to match the equals-form pattern atlib/codex-manager/commands/models.ts:56and reject whitespace-only tokens.proposed fix
if (arg === "--model") { - const value = args[i + 1]; - if (!value || value.startsWith("-")) { + const raw = args[i + 1]; + const value = raw?.trim(); + if (!value || value.startsWith("-")) { logError("Missing value for --model"); return 1; } model = value;🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@lib/codex-manager/commands/integrations.ts` around lines 70 - 78, The --model argument handling reads args[i + 1] into value without trimming, so whitespace-only tokens like " " bypass the existing checks; update the parsing in the integrations command to trim the token first (e.g., const raw = args[i + 1]; const value = raw?.trim()), then validate that value is non-empty and does not start with "-" before assigning to model and advancing i, ensuring you store the trimmed value into model; refer to the same argument parsing block that checks arg === "--model" and the variables args, i, value, and model.test/codex-manager-integrations-command.test.ts (1)
4-31:⚠️ Potential issue | 🟡 Minor | ⚡ Quick winmissing regression tests for --model flag-like rejection.
test/codex-manager-integrations-command.test.tscovers the invalid--kindpath at lines 22-30, but the new guard atlib/codex-manager/commands/integrations.ts:72that rejects--model -xand--model ""has no corresponding regression coverage. add test cases asserting thatrunIntegrationsCommand(["--model", "-x"], deps)andrunIntegrationsCommand(["--model", " "], deps)both return exit code1with error message"Missing value for --model".🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@test/codex-manager-integrations-command.test.ts` around lines 4 - 31, Add two regression tests to test/codex-manager-integrations-command.test.ts that assert the new --model guard in integrations.ts returns a failure: call runIntegrationsCommand(["--model","-x"], { logInfo: vi.fn(), logError }) and runIntegrationsCommand(["--model"," "], { logInfo: vi.fn(), logError }) (where logError = vi.fn()), expect each exit code toBe(1) and expect String(logError.mock.calls[0]?.[0]) toContain "Missing value for --model"; place them alongside the existing "rejects invalid kinds" test and reuse the same runIntegrationsCommand helper so the tests exercise the guard at integrations.ts:72.lib/codex-manager/commands/models.ts (1)
45-53:⚠️ Potential issue | 🟡 Minor | ⚡ Quick wintrim
--modelvalue before validation.
lib/codex-manager/commands/models.ts:46readsargs[i + 1]without trimming before the guard at line 47. tokens like" "will pass the!valuecheck (non-empty string) and the.startsWith("-")check, but represent a missing value. trim before validating to match the equals-form behavior at line 56 and reject whitespace-only tokens consistently.proposed fix
if (arg === "--model") { - const value = args[i + 1]; - if (!value || value.startsWith("-")) { + const raw = args[i + 1]; + const value = raw?.trim(); + if (!value || value.startsWith("-")) { logError("Missing value for --model"); return 1; } models.push(value);🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@lib/codex-manager/commands/models.ts` around lines 45 - 53, In the argument parsing branch that handles the "--model" flag (the block that reads const value = args[i + 1] and pushes into models), trim the retrieved value first (e.g., const raw = args[i + 1]; const value = raw && raw.trim()) and then perform the existing guards (check for falsy/empty after trim and startsWith("-")) so whitespace-only tokens are rejected the same way as the equals-form handling; update the push to use the trimmed value and keep the index increment and continue behavior unchanged.lib/codex-manager/forecast-report-commands.ts (1)
145-151:⚠️ Potential issue | 🟠 Major | ⚡ Quick wintrim split
--modelvalues before validating them.
lib/codex-manager/forecast-report-commands.ts:145andlib/codex-manager/forecast-report-commands.ts:186still validate the raw argv token.--model " --json"bypasses the new flag-like guard, and--model " gpt-5.5 "keeps the surrounding spaces while the--model=path trims them. trim first, then run the missing/flag check in both parsers.suggested fix
if (arg === "--model" || arg === "-m") { - const value = args[i + 1]; + const value = args[i + 1]?.trim(); if (!value || value.startsWith("-")) { return { ok: false, message: "Missing value for --model" }; } options.model = value; i += 1; continue; }Also applies to: 186-192
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@lib/codex-manager/forecast-report-commands.ts` around lines 145 - 151, The --model parsing branches validate the raw argv token so values like '" --json"' or '" gpt-5.5 "' bypass checks or keep surrounding spaces; fix both places that handle --model (the branch checking arg === "--model" || arg === "-m" where value is taken as args[i+1], and the branch that parses "--model=...") by trimming the extracted value (e.g., value = value.trim()) before performing the missing/flag check (value === "" or value.startsWith("-")) and before assigning to options.model, and ensure you still increment i in the positional form.lib/codex-manager/help.ts (1)
185-195:⚠️ Potential issue | 🟠 Major | ⚡ Quick wintrim split-arg
--modelbefore validating it.at
lib/codex-manager/help.ts:186, the parser checks the raw token. values like" "or" --json"bypass this guard and get accepted as a model. trim first, then validate.proposed patch
if (arg === "--model" || arg === "-m") { - const value = args[i + 1]; + const value = args[i + 1]?.trim(); if (!value || value.startsWith("-")) { return { ok: false, reason: "error", message: "Missing value for --model", }; } options.model = value;🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@lib/codex-manager/help.ts` around lines 185 - 195, The parser currently validates the raw token for the --model/-m flag (variables arg, value, options.model, options.modelProvided) which accepts whitespace-only or leading-whitespace tokens; fix by trimming the next token before validation (e.g., compute a trimmedValue from args[i+1] safely), then check trimmedValue for falsiness or trimmedValue.startsWith("-") and assign options.model = trimmedValue and options.modelProvided = true only after passing validation.lib/codex-manager/repair-commands.ts (1)
215-221:⚠️ Potential issue | 🟠 Major | ⚡ Quick wintrim split-arg
--modelinparseFixArgsbefore validation.at
lib/codex-manager/repair-commands.ts:216, raw token validation allows" "or" --json"through. normalize with.trim()first, then apply the missing/flag-like checks.proposed patch
if (argValue === "--model" || argValue === "-m") { - const value = args[i + 1]; + const value = args[i + 1]?.trim(); if (!value || value.startsWith("-")) { return { ok: false, message: "Missing value for --model" }; } options.model = value;🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@lib/codex-manager/repair-commands.ts` around lines 215 - 221, In parseFixArgs, the validation for the --model/-m token uses the raw next token without trimming, so whitespace-only values like " " or tokens with leading spaces pass validation; update the logic in parseFixArgs (the branch handling argValue === "--model" || argValue === "-m") to call .trim() on the candidate value before checking for falsiness or whether it startsWith("-"), then assign the trimmed value to options.model and increment i as before.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@lib/codex-manager/forecast-report-commands.ts`:
- Line 107: The help text for the probe model flags currently hardcodes
"gpt-5.5"; update the two help strings (the ones that read "Probe model for live
mode (default: gpt-5.5)" and its quota/probe counterpart) to reference the
single source-of-truth DEFAULT_MODEL constant instead of the literal, e.g. build
the string using DEFAULT_MODEL so the help text always reflects the real
default; also ensure DEFAULT_MODEL is imported/available in
forecast-report-commands.ts (the same constant used at the other default
usages).
In `@lib/quota-probe.ts`:
- Around line 56-62: DEFAULT_QUOTA_PROBE_MODELS currently hardcodes "gpt-5.5" as
the first probe candidate causing split-brain when the canonical default_model
changes; update the probe stacks to use the runtime canonical default_model as
the first element instead of a hardcoded string. Replace the first entry in
DEFAULT_QUOTA_PROBE_MODELS (and the analogous array in
lib/runtime/quota-probe.ts) to insert the exported default_model (or read the
same default_model constant/value) as the first probe candidate, keeping the
remaining fallback model names in the same order so both quota-probe.ts and
runtime/quota-probe.ts share the same source-of-truth for the initial probe
target.
In `@lib/runtime-rotation-proxy.ts`:
- Around line 729-730: The code currently remaps missing request model into
DEFAULT_MODEL by calling getModelFamily(model ?? DEFAULT_MODEL), which causes
pass-through /codex/responses requests to be classified as gpt-5.2; change this
to preserve pass-through semantics by only calling getModelFamily when a model
is provided (e.g., use getModelFamily(model) or conditional logic that leaves
family undefined/null when model is absent) so that codex requests without an
explicit model remain in the neutral codex bucket; update the logic around
parsedBody?.stream and any downstream usage that expects a family to handle an
undefined family value and add tests covering the no-model codex path.
In `@test/codex-manager-cli.test.ts`:
- Around line 3279-3350: Add a deterministic test near the existing case that
exercises the refresh-fail + still-valid session branch: create an account whose
expiresAt is in the future (so session is still valid), mock queuedRefreshMock
to reject (simulate refresh failure) and ensure fetchCodexQuotaSnapshotMock is
either not called for that account or rejects with CodexUnavailableError as
appropriate, then call runCodexMultiAuthCli(["auth","check"]) and assert the
output increments the "signed in only" count (and includes
CODEX_UNAVAILABLE_PROBE_NOTE_LITERAL on that row) while not counting it as
"working" or incrementing codexAvailable; reference runCodexMultiAuthCli,
queuedRefreshMock, fetchCodexQuotaSnapshotMock and
CODEX_UNAVAILABLE_PROBE_NOTE_LITERAL when locating where to add the test.
In `@test/codex-manager-help.test.ts`:
- Around line 129-153: Add deterministic regression tests for whitespace and
leading-space flag-like model values in parseBestArgs: add assertions that
parseBestArgs(["--model", " "]) and parseBestArgs(["--model", " --json"])
both return { ok: false, reason: "error", message: "Missing value for --model" }
(and mirror for the short alias -m if appropriate), so the split-arg parsing
treats pure-whitespace or leading-space flag-like tokens as missing values
rather than valid model names; update test/codex-manager-help.test.ts around the
existing flag-like cases to include these two new expectations referencing
parseBestArgs.
- Around line 92-99: The test currently hardcodes "gpt-5.5" in the expected
payload for parseBestArgs; change it to import and use DEFAULT_MODEL instead so
the assertion follows the single source of truth. Update
test/codex-manager-help.test.ts to import DEFAULT_MODEL from its module and
replace the literal "gpt-5.5" in the expect(...) object with DEFAULT_MODEL,
keeping the rest of the expected shape (ok: true, options: { live:false,
json:false, modelProvided:false }) unchanged.
In `@test/codex-manager-integrations-command.test.ts`:
- Line 18: The test currently asserts a hardcoded string 'model="gpt-5.5"'
against payload.snippets[0]?.body which will break when the default model
changes; import DEFAULT_MODEL from lib/request/helpers/model-map.js at the top
of the test file and replace the literal expectation with a derived one that
asserts payload.snippets[0]?.body contains `model="${DEFAULT_MODEL}"`, keeping
the test in sync with runtime; ensure the import is added and the assertion uses
the DEFAULT_MODEL symbol rather than a hardcoded string.
In `@test/documentation.test.ts`:
- Line 339: The test is hardcoding the default model string in the docs parity
assertion; import and use the single source of truth DEFAULT_MODEL instead of
the literal "gpt-5.5" so the test follows future default-model changes—update
the assertion in test/documentation.test.ts (the expect(readme).toContain(...)
line) to import DEFAULT_MODEL from its module and assert
expect(readme).toContain(`codex-multi-auth fix --live --model ${DEFAULT_MODEL}`)
(or equivalent string concatenation), ensuring any needed export/import path and
type/string conversion are handled.
In `@test/quota-probe.test.ts`:
- Around line 87-101: Add a deterministic regression test that simulates gpt-5.5
failing and verifies the fallback to gpt-5.4: call fetchCodexQuotaSnapshot (the
function under test) with vi.stubGlobal("fetch") returning a first Response
representing gpt-5.5 unsupported (e.g., 404/empty headers) and a second Response
with successful quota headers for gpt-5.4, then assert snapshot.model ===
"gpt-5.4", that getCodexInstructionsMock was invoked with "gpt-5.4", and that
the fetch mock was called twice; this ensures the reordered candidate chain in
quota-probe (the probe logic that tries "gpt-5.5" then "gpt-5.4") correctly
falls back rather than skipping gpt-5.4 under failure.
In `@test/repair-commands.test.ts`:
- Around line 165-187: Update the "parseFixArgs rejects a flag-like value after
--model instead of consuming it" test to include edge-case assertions for
whitespace-only model tokens: call parseFixArgs(["--model", " "]) and
parseFixArgs(["--model", " --json"]) (and their short-form counterparts like
["-m", " "] if desired) and assert they return { ok: false, message: "Missing
value for --model" }, so parseFixArgs correctly rejects whitespace-only or
whitespace-prefixed flag-looking values instead of treating them as valid model
names.
---
Outside diff comments:
In `@lib/codex-manager.ts`:
- Around line 2542-2548: When parsing the --model / -m split-arg in the argument
loop, trim the extracted value before performing the empty and startsWith("-")
checks and before assigning to options.model; i.e., replace checks against the
raw value with checks against value.trim() and set options.model to the trimmed
string and options.modelProvided only when the trimmed value is non-empty and
not flag-like. This affects the branch handling arg === "--model" || arg ===
"-m" where options.model and options.modelProvided are set.
- Around line 2407-2415: Add a deterministic vitest regression in
test/codex-manager-cli.test.ts that reproduces the forceRefresh + liveProbe +
queuedRefresh failure while sessionLikelyValid is true: stub/mocking the refresh
path (queuedRefresh/forceRefresh) to throw/return failure, mock liveProbe to
fail, and ensure the session validity flag remains true; then run the
CLI/manager routine that emits the per-account row (the code path using
sessionLikelyValid, liveProbe, signedInOnly, display.showPerAccountRows,
stylePromptText, labelText) and assert the console output contains the
per-account warning row and the final summary line including "codex available |
signed in only | need re-login"; use vitest timers/mocks to keep the test
deterministic and avoid real concurrency/file IO.
In `@lib/codex-manager/commands/integrations.ts`:
- Around line 70-78: The --model argument handling reads args[i + 1] into value
without trimming, so whitespace-only tokens like " " bypass the existing
checks; update the parsing in the integrations command to trim the token first
(e.g., const raw = args[i + 1]; const value = raw?.trim()), then validate that
value is non-empty and does not start with "-" before assigning to model and
advancing i, ensuring you store the trimmed value into model; refer to the same
argument parsing block that checks arg === "--model" and the variables args, i,
value, and model.
In `@lib/codex-manager/commands/models.ts`:
- Around line 45-53: In the argument parsing branch that handles the "--model"
flag (the block that reads const value = args[i + 1] and pushes into models),
trim the retrieved value first (e.g., const raw = args[i + 1]; const value = raw
&& raw.trim()) and then perform the existing guards (check for falsy/empty after
trim and startsWith("-")) so whitespace-only tokens are rejected the same way as
the equals-form handling; update the push to use the trimmed value and keep the
index increment and continue behavior unchanged.
In `@lib/codex-manager/forecast-report-commands.ts`:
- Around line 145-151: The --model parsing branches validate the raw argv token
so values like '" --json"' or '" gpt-5.5 "' bypass checks or keep surrounding
spaces; fix both places that handle --model (the branch checking arg ===
"--model" || arg === "-m" where value is taken as args[i+1], and the branch that
parses "--model=...") by trimming the extracted value (e.g., value =
value.trim()) before performing the missing/flag check (value === "" or
value.startsWith("-")) and before assigning to options.model, and ensure you
still increment i in the positional form.
In `@lib/codex-manager/help.ts`:
- Around line 185-195: The parser currently validates the raw token for the
--model/-m flag (variables arg, value, options.model, options.modelProvided)
which accepts whitespace-only or leading-whitespace tokens; fix by trimming the
next token before validation (e.g., compute a trimmedValue from args[i+1]
safely), then check trimmedValue for falsiness or trimmedValue.startsWith("-")
and assign options.model = trimmedValue and options.modelProvided = true only
after passing validation.
In `@lib/codex-manager/repair-commands.ts`:
- Around line 215-221: In parseFixArgs, the validation for the --model/-m token
uses the raw next token without trimming, so whitespace-only values like " "
or tokens with leading spaces pass validation; update the logic in parseFixArgs
(the branch handling argValue === "--model" || argValue === "-m") to call
.trim() on the candidate value before checking for falsiness or whether it
startsWith("-"), then assign the trimmed value to options.model and increment i
as before.
In `@test/codex-manager-integrations-command.test.ts`:
- Around line 4-31: Add two regression tests to
test/codex-manager-integrations-command.test.ts that assert the new --model
guard in integrations.ts returns a failure: call
runIntegrationsCommand(["--model","-x"], { logInfo: vi.fn(), logError }) and
runIntegrationsCommand(["--model"," "], { logInfo: vi.fn(), logError }) (where
logError = vi.fn()), expect each exit code toBe(1) and expect
String(logError.mock.calls[0]?.[0]) toContain "Missing value for --model"; place
them alongside the existing "rejects invalid kinds" test and reuse the same
runIntegrationsCommand helper so the tests exercise the guard at
integrations.ts:72.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: ASSERTIVE
Plan: Pro
Run ID: dddc0240-a025-4d41-830f-8edb654a06a2
📒 Files selected for processing (29)
README.mdlib/codex-manager.tslib/codex-manager/commands/best.tslib/codex-manager/commands/forecast.tslib/codex-manager/commands/integrations.tslib/codex-manager/commands/models.tslib/codex-manager/commands/report.tslib/codex-manager/forecast-report-commands.tslib/codex-manager/help.tslib/codex-manager/repair-commands.tslib/integration-generators.tslib/prompts/codex.tslib/quota-probe.tslib/runtime-rotation-proxy.tslib/runtime/quota-probe.tspackage.jsonscripts/check-pack-budget-lib.jstest/check-pack-budget.test.tstest/codex-manager-cli.test.tstest/codex-manager-forecast-command.test.tstest/codex-manager-help.test.tstest/codex-manager-integrations-command.test.tstest/codex-manager-report-command.test.tstest/codex-prompts.test.tstest/documentation.test.tstest/package-bin.test.tstest/quota-probe.test.tstest/repair-commands.test.tstest/runtime-quota-probe.test.ts
…nly regression
CodeRabbit round 4:
- consistency: every split-arg --model/-m parser now trims (args[i+1]?.trim())
before the missing/flag-like guard, matching the already-trimmed --model= forms.
Whitespace-only (' ') and leading-space flags (' --json') no longer slip
through and silently fall back to the default. Sites: codex-manager.ts
(parseBestArgs), forecast.ts, forecast-report-commands.ts (x2), help.ts
(parseBestArgs), repair-commands.ts (parseFixArgs), integrations.ts, models.ts.
report.ts was already trimmed.
- tests: added whitespace-only rejection cases (parseBestArgs/parseFixArgs/forecast)
+ integrations --model -x / ' ' coverage + a deep-check regression asserting a
transient refresh failure with a still-valid session lands as 'signed in only'
(not 'need re-login') with the per-account warning row.
Full suite: 4360 passed, 3 skipped, 0 failed; typecheck + lint clean.
Co-Authored-By: Claude Opus 4.8 <[email protected]>
|
Round 4 addressed in
Full suite: 4360 passed, 3 skipped, 0 failed; typecheck + lint clean. @coderabbitai full review |
|
✏️ Learnings added
🧠 Learnings used✅ Action performedFull review finished. |
There was a problem hiding this comment.
Actionable comments posted: 3
♻️ Duplicate comments (2)
lib/quota-probe.ts (1)
56-62: 🛠️ Refactor suggestion | 🟠 Major | ⚡ Quick winsource the probe fallback list from
default_model.
lib/quota-probe.ts:56andlib/runtime/quota-probe.ts:5still hardcode the first probe candidate, so the next default bump will desync probe order from the cli/help/cache path again. please derive both lists fromDEFAULT_MODELand pin it withtest/quota-probe.test.tsandtest/runtime-quota-probe.test.ts. based on learnings the canonical default live/quota probe model isDEFAULT_MODEL, the single source of truth across parse sites, help strings, and test assertions.🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@lib/quota-probe.ts` around lines 56 - 62, The hardcoded probe candidate array DEFAULT_QUOTA_PROBE_MODELS should be derived from the single source of truth DEFAULT_MODEL: replace the literal first entry (and any duplicates) by building DEFAULT_QUOTA_PROBE_MODELS so its first element equals DEFAULT_MODEL and the rest remain the current fallbacks; update the equivalent list in runtime code to reference the same DEFAULT_MODEL-derived list (use the same symbol name or export/import to avoid duplication), and update/pin the tests test/quota-probe.test.ts and test/runtime-quota-probe.test.ts to assert against DEFAULT_MODEL as the canonical first probe candidate so future default bumps stay in sync.lib/codex-manager/commands/forecast.ts (1)
139-139: 🛠️ Refactor suggestion | 🟠 Major | ⚡ Quick winderive the forecast help default from
default_model.
lib/codex-manager/commands/forecast.ts:139still printsgpt-5.5literally whilelib/codex-manager/commands/forecast.ts:152andlib/codex-manager/commands/forecast.ts:218already source the runtime default fromDEFAULT_MODEL. that will drift on the next model change. please render this line from the constant and cover it intest/codex-manager-forecast-command.test.tsortest/documentation.test.ts. based on learnings the canonical default live/quota probe model isDEFAULT_MODEL, the single source of truth across parse sites, help strings, and test assertions.🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@lib/codex-manager/commands/forecast.ts` at line 139, The help string in forecast.ts currently hardcodes "gpt-5.5"; change it to interpolate the DEFAULT_MODEL constant so the displayed default comes from the single source of truth (DEFAULT_MODEL) used elsewhere (e.g., where DEFAULT_MODEL is referenced at lines around 152 and 218). Update the help definition for the "--model, -m" flag in the forecast command to render DEFAULT_MODEL instead of the literal, and add or update a test (in test/codex-manager-forecast-command.test.ts or test/documentation.test.ts) that asserts the generated help output contains the DEFAULT_MODEL value to prevent future drift.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@test/codex-manager-cli.test.ts`:
- Line 748: Replace hardcoded "gpt-5.5" usages in the test suite with the
canonical constant: import DEFAULT_MODEL from "lib/request/helpers/model-map.ts"
at the top of test/codex-manager-cli.test.ts and update every occurrence where a
test constructs or asserts the model (e.g., the object key model: "gpt-5.5" and
any assertions comparing strings) to reference DEFAULT_MODEL instead; ensure all
listed spots (around the occurrences near the model property and related
assertions) use DEFAULT_MODEL so tests rely on the single source of truth rather
than a literal string.
- Around line 7023-7070: The test currently returns a queuedRefreshMock result
with { type: "error", ... } but lib/codex-manager.ts (around the refresh
handling that reads queuedRefresh results) and lib/refresh-queue.ts use a
different TokenResult discriminator; update the test's mocked result to use the
same discriminator value and shape used by TokenResult in lib/refresh-queue.ts
(e.g., change queuedRefreshMock.mockResolvedValueOnce to return the actual
non-success discriminator and expected fields), so the mock matches
queuedRefresh and the runCodexMultiAuthCli auth flow (referencing
queuedRefreshMock and the refresh handling in lib/codex-manager.ts).
In `@test/runtime-quota-probe.test.ts`:
- Line 45: The test currently hardcodes "gpt-5.5" for the default model; instead
import the canonical DEFAULT_MODEL constant and use it in the assertion so the
test follows the single source of truth. Replace the literal in the assertion
that checks snapshot.model with DEFAULT_MODEL, and add the appropriate import
for DEFAULT_MODEL at the top of the test file so the assertion reads
expect(snapshot.model).toBe(DEFAULT_MODEL).
---
Duplicate comments:
In `@lib/codex-manager/commands/forecast.ts`:
- Line 139: The help string in forecast.ts currently hardcodes "gpt-5.5"; change
it to interpolate the DEFAULT_MODEL constant so the displayed default comes from
the single source of truth (DEFAULT_MODEL) used elsewhere (e.g., where
DEFAULT_MODEL is referenced at lines around 152 and 218). Update the help
definition for the "--model, -m" flag in the forecast command to render
DEFAULT_MODEL instead of the literal, and add or update a test (in
test/codex-manager-forecast-command.test.ts or test/documentation.test.ts) that
asserts the generated help output contains the DEFAULT_MODEL value to prevent
future drift.
In `@lib/quota-probe.ts`:
- Around line 56-62: The hardcoded probe candidate array
DEFAULT_QUOTA_PROBE_MODELS should be derived from the single source of truth
DEFAULT_MODEL: replace the literal first entry (and any duplicates) by building
DEFAULT_QUOTA_PROBE_MODELS so its first element equals DEFAULT_MODEL and the
rest remain the current fallbacks; update the equivalent list in runtime code to
reference the same DEFAULT_MODEL-derived list (use the same symbol name or
export/import to avoid duplication), and update/pin the tests
test/quota-probe.test.ts and test/runtime-quota-probe.test.ts to assert against
DEFAULT_MODEL as the canonical first probe candidate so future default bumps
stay in sync.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: ASSERTIVE
Plan: Pro
Run ID: dfbee02f-8a4b-43e8-bd3a-8310ad6421ab
📒 Files selected for processing (29)
README.mdlib/codex-manager.tslib/codex-manager/commands/best.tslib/codex-manager/commands/forecast.tslib/codex-manager/commands/integrations.tslib/codex-manager/commands/models.tslib/codex-manager/commands/report.tslib/codex-manager/forecast-report-commands.tslib/codex-manager/help.tslib/codex-manager/repair-commands.tslib/integration-generators.tslib/prompts/codex.tslib/quota-probe.tslib/runtime-rotation-proxy.tslib/runtime/quota-probe.tspackage.jsonscripts/check-pack-budget-lib.jstest/check-pack-budget.test.tstest/codex-manager-cli.test.tstest/codex-manager-forecast-command.test.tstest/codex-manager-help.test.tstest/codex-manager-integrations-command.test.tstest/codex-manager-report-command.test.tstest/codex-prompts.test.tstest/documentation.test.tstest/package-bin.test.tstest/quota-probe.test.tstest/repair-commands.test.tstest/runtime-quota-probe.test.ts
…gle-source CodeRabbit round 5 (all 10 unresolved threads): Behavioral (Major): - runtime-rotation-proxy: a model-less /codex/responses request fell back to DEFAULT_MODEL (gpt-5.5 -> family gpt-5.2), mis-bucketing a codex pass-through into the wrong rotation/cooldown/budget family. Restore codex-family bucketing via CURRENT_CODEX_MODEL (gpt-5.3-codex -> gpt-5-codex), the prior behavior, now named instead of a bare literal. Consistency / drift (help text, probe candidates, tests now derive from the single source DEFAULT_MODEL instead of a hardcoded 'gpt-5.5'): - forecast / fix / forecast-report usage strings - lib/quota-probe.ts + lib/runtime/quota-probe.ts first probe candidate - test assertions: help (parseBestArgs + new printBestUsage regression), integrations, documentation parity, runtime-quota-probe, forecast help - new quota-probe regression for the default -> gpt-5.4 fallback chain Value-neutral (DEFAULT_MODEL is still 'gpt-5.5'); only removes literal drift. Full suite: 4362 passed, 3 skipped, 0 failed; typecheck + lint clean. Co-Authored-By: Claude Opus 4.8 <[email protected]>
|
Round 5 — all 10 unresolved threads addressed in Behavioral (Major): runtime-rotation-proxy — a model-less Consistency (single-source DEFAULT_MODEL, no more hardcoded 'gpt-5.5'): forecast/fix/forecast-report usage strings; quota-probe + runtime/quota-probe first candidate; test assertions (parseBestArgs + new printBestUsage regression, integrations, documentation parity, runtime-quota-probe, forecast help); + new quota-probe regression for the default→gpt-5.4 fallback chain. Value-neutral (DEFAULT_MODEL still 'gpt-5.5'). Full suite: 4362 passed, 0 failed; typecheck + lint clean; Greptile pass. @coderabbitai full review |
|
✏️ Learnings added
🧠 Learnings used✅ Action performedFull review finished. |
There was a problem hiding this comment.
Actionable comments posted: 1
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (2)
lib/codex-manager/commands/report.ts (1)
403-427:⚠️ Potential issue | 🟡 Minor | ⚡ Quick winuse the patched identity in the change detector.
at
lib/codex-manager/commands/report.ts:403, the gate still comparespreviousEmail/previousAccountIdagainst the pre-patchaccountobject. if a refresh only changes derived identity fields carried inrefreshPatch, this path skips bothpersistRefreshedAccountPatch()andapplyRefreshedAccountPatch(), so the report keeps stale identity data for the rest of the command.proposed fix
+ const nextEmail = refreshPatch.email ?? account.email; + const nextAccountId = refreshPatch.accountId ?? account.accountId; if ( previousRefreshToken !== refreshPatch.refreshToken || previousAccessToken !== refreshPatch.accessToken || previousExpiresAt !== refreshPatch.expiresAt || - previousEmail !== account.email || - previousAccountId !== account.accountId + previousEmail !== nextEmail || + previousAccountId !== nextAccountId ) { try { await persistRefreshedAccountPatch( storage, accountMatch, refreshPatch, deps.loadAccounts, deps.saveAccounts, ); } catch (error) { const message = deps.normalizeFailureDetail( error instanceof Error ? error.message : String(error), undefined, ); probeErrors.push(`${formatAccountLabel(account, i)}: ${message}`); continue; } applyRefreshedAccountPatch(account, refreshPatch); }please add a vitest regression in
test/codex-manager-report-command.test.tsthat reproduces the identity-only patch case, so this does not drift again. as per coding guidelines, "lib/**: focus on auth rotation, windows filesystem io, and concurrency. verify every change cites affected tests (vitest)".🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@lib/codex-manager/commands/report.ts` around lines 403 - 427, The change-detection gate compares previousEmail/previousAccountId against the pre-patch account and therefore ignores identity-only patches carried in refreshPatch; update the condition so it compares previousEmail and previousAccountId against the post-patch identity (i.e. the values in refreshPatch when present) before skipping persistence, ensuring persistRefreshedAccountPatch and applyRefreshedAccountPatch run for identity-only updates; then add a vitest regression in test/codex-manager-report-command.test.ts that simulates a refreshPatch containing only email/accountId changes and asserts the report reflects the patched identity after the command completes.lib/codex-manager/forecast-report-commands.ts (1)
145-160: 🛠️ Refactor suggestion | 🟠 Major | ⚡ Quick winpull the
--modelvalidation into one helper.
lib/codex-manager/forecast-report-commands.ts:145-160andlib/codex-manager/forecast-report-commands.ts:186-201now duplicate the same trim + flag-like guard. this exact parsing contract already drifted across commands in earlier rounds, so keeping two copies here makes the next change easy to miss. a small shared helper in this file would keep forecast/report locked to the same behavior thattest/codex-manager-forecast-command.test.ts:141-161andtest/codex-manager-report-command.test.ts:96-105are asserting.Also applies to: 186-201
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@lib/codex-manager/forecast-report-commands.ts` around lines 145 - 160, There are two duplicated validation blocks for the --model flag in forecast-report-commands.ts; create a small helper like getModelValue(arg: string, next?: string) (or parseModelFlag) that accepts either the current arg and optional next arg, performs trim() and the startsWith("-") guard, and returns a normalized { ok, value?, message? } result; then replace both the "--model"/"-m" branch and the "--model=" branch to call this helper, set options.model on success, and return the helper's error message on failure so both parsing paths share identical validation behavior used by the tests.
♻️ Duplicate comments (1)
test/repair-commands.test.ts (1)
165-192:⚠️ Potential issue | 🟡 Minor | ⚡ Quick wincover the trimmed short-form
-mregressions too.test/repair-commands.test.ts:165 still does not exercise the short-form branch with trimmed-empty or whitespace-prefixed flag-like values, so a regression in
lib/codex-manager/repair-commands.ts:216-218could slip through while this suite stays green. add["-m", " "]and["-m", " --json"]next to the existing long-form cases.suggested additions
expect(parseFixArgs(["-m", "--json"])).toEqual({ ok: false, message: "Missing value for --model", }); + expect(parseFixArgs(["-m", " "])).toEqual({ + ok: false, + message: "Missing value for --model", + }); + expect(parseFixArgs(["-m", " --json"])).toEqual({ + ok: false, + message: "Missing value for --model", + }); // A real model value is still accepted (both long and short forms).as per coding guidelines
test/**: tests must stay deterministic and use vitest. demand regression cases that reproduce concurrency bugs, token refresh races, and windows filesystem behavior.🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@test/repair-commands.test.ts` around lines 165 - 192, Add test cases exercising the short-form model flag in parseFixArgs to cover trimmed-empty and whitespace-prefixed flag-like values: extend the existing test block that checks "--model" behavior to also expect parseFixArgs(["-m", " "]) and parseFixArgs(["-m", " --json"]) to return { ok: false, message: "Missing value for --model" }, and keep the positive short-form case parseFixArgs(["-m", "gpt-5.5"]).ok toBe(true); this ensures the short-form branch in lib/codex-manager/repair-commands.ts (around the -m handling) is exercised and prevents regressions.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@lib/quota-probe.ts`:
- Around line 57-63: The duplicated ordered model list
(DEFAULT_QUOTA_PROBE_MODELS) is defined in two places; extract it into a single
exported constant in a shared module and have both the quota probe
implementation and the runtime quota probe import and use that constant instead
of redefining the array. Update references that currently use the local array
(the quota probe code that uses DEFAULT_QUOTA_PROBE_MODELS and the runtime probe
module that repeats the list) to import the shared symbol, and adjust the tests
that assert the probe fallback chain to reference the same exported
constant/contract so there is a single source of truth for the fallback chain.
---
Outside diff comments:
In `@lib/codex-manager/commands/report.ts`:
- Around line 403-427: The change-detection gate compares
previousEmail/previousAccountId against the pre-patch account and therefore
ignores identity-only patches carried in refreshPatch; update the condition so
it compares previousEmail and previousAccountId against the post-patch identity
(i.e. the values in refreshPatch when present) before skipping persistence,
ensuring persistRefreshedAccountPatch and applyRefreshedAccountPatch run for
identity-only updates; then add a vitest regression in
test/codex-manager-report-command.test.ts that simulates a refreshPatch
containing only email/accountId changes and asserts the report reflects the
patched identity after the command completes.
In `@lib/codex-manager/forecast-report-commands.ts`:
- Around line 145-160: There are two duplicated validation blocks for the
--model flag in forecast-report-commands.ts; create a small helper like
getModelValue(arg: string, next?: string) (or parseModelFlag) that accepts
either the current arg and optional next arg, performs trim() and the
startsWith("-") guard, and returns a normalized { ok, value?, message? } result;
then replace both the "--model"/"-m" branch and the "--model=" branch to call
this helper, set options.model on success, and return the helper's error message
on failure so both parsing paths share identical validation behavior used by the
tests.
---
Duplicate comments:
In `@test/repair-commands.test.ts`:
- Around line 165-192: Add test cases exercising the short-form model flag in
parseFixArgs to cover trimmed-empty and whitespace-prefixed flag-like values:
extend the existing test block that checks "--model" behavior to also expect
parseFixArgs(["-m", " "]) and parseFixArgs(["-m", " --json"]) to return { ok:
false, message: "Missing value for --model" }, and keep the positive short-form
case parseFixArgs(["-m", "gpt-5.5"]).ok toBe(true); this ensures the short-form
branch in lib/codex-manager/repair-commands.ts (around the -m handling) is
exercised and prevents regressions.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: ASSERTIVE
Plan: Pro
Run ID: 38373320-ef8d-4cbf-ad8b-59828a893b84
📒 Files selected for processing (29)
README.mdlib/codex-manager.tslib/codex-manager/commands/best.tslib/codex-manager/commands/forecast.tslib/codex-manager/commands/integrations.tslib/codex-manager/commands/models.tslib/codex-manager/commands/report.tslib/codex-manager/forecast-report-commands.tslib/codex-manager/help.tslib/codex-manager/repair-commands.tslib/integration-generators.tslib/prompts/codex.tslib/quota-probe.tslib/runtime-rotation-proxy.tslib/runtime/quota-probe.tspackage.jsonscripts/check-pack-budget-lib.jstest/check-pack-budget.test.tstest/codex-manager-cli.test.tstest/codex-manager-forecast-command.test.tstest/codex-manager-help.test.tstest/codex-manager-integrations-command.test.tstest/codex-manager-report-command.test.tstest/codex-prompts.test.tstest/documentation.test.tstest/package-bin.test.tstest/quota-probe.test.tstest/repair-commands.test.tstest/runtime-quota-probe.test.ts
📜 Review details
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
- GitHub Check: Greptile Review
🧰 Additional context used
📓 Path-based instructions (12)
lib/**/*.ts
📄 CodeRabbit inference engine (lib/AGENTS.md)
lib/**/*.ts: All public exports should flow throughlib/index.tsor documented package subpaths
Never import fromdist/in source tests or library code
Never suppress type errors
Files:
lib/codex-manager/commands/best.tslib/runtime-rotation-proxy.tslib/codex-manager/commands/forecast.tslib/prompts/codex.tslib/integration-generators.tslib/codex-manager/commands/integrations.tslib/codex-manager/commands/models.tslib/runtime/quota-probe.tslib/codex-manager/commands/report.tslib/codex-manager/help.tslib/codex-manager/forecast-report-commands.tslib/codex-manager/repair-commands.tslib/quota-probe.tslib/codex-manager.ts
**/*.ts
📄 CodeRabbit inference engine (AGENTS.md)
Do not use
as any,@ts-ignore, or@ts-expect-errortype assertions
Files:
lib/codex-manager/commands/best.tslib/runtime-rotation-proxy.tslib/codex-manager/commands/forecast.tslib/prompts/codex.tslib/integration-generators.tslib/codex-manager/commands/integrations.tslib/codex-manager/commands/models.tstest/package-bin.test.tslib/runtime/quota-probe.tstest/runtime-quota-probe.test.tstest/codex-manager-report-command.test.tslib/codex-manager/commands/report.tstest/documentation.test.tstest/codex-manager-forecast-command.test.tstest/codex-manager-integrations-command.test.tslib/codex-manager/help.tstest/repair-commands.test.tstest/codex-prompts.test.tslib/codex-manager/forecast-report-commands.tstest/quota-probe.test.tslib/codex-manager/repair-commands.tstest/codex-manager-help.test.tslib/quota-probe.tstest/codex-manager-cli.test.tstest/check-pack-budget.test.tslib/codex-manager.ts
**/*.{ts,js}
📄 CodeRabbit inference engine (AGENTS.md)
Use ESM module syntax exclusively; the project is ESM-only with
"type": "module"
Files:
lib/codex-manager/commands/best.tsscripts/check-pack-budget-lib.jslib/runtime-rotation-proxy.tslib/codex-manager/commands/forecast.tslib/prompts/codex.tslib/integration-generators.tslib/codex-manager/commands/integrations.tslib/codex-manager/commands/models.tstest/package-bin.test.tslib/runtime/quota-probe.tstest/runtime-quota-probe.test.tstest/codex-manager-report-command.test.tslib/codex-manager/commands/report.tstest/documentation.test.tstest/codex-manager-forecast-command.test.tstest/codex-manager-integrations-command.test.tslib/codex-manager/help.tstest/repair-commands.test.tstest/codex-prompts.test.tslib/codex-manager/forecast-report-commands.tstest/quota-probe.test.tslib/codex-manager/repair-commands.tstest/codex-manager-help.test.tslib/quota-probe.tstest/codex-manager-cli.test.tstest/check-pack-budget.test.tslib/codex-manager.ts
lib/**
⚙️ CodeRabbit configuration file
focus on auth rotation, windows filesystem IO, and concurrency. verify every change cites affected tests (vitest) and that new queues handle EBUSY/429 scenarios. check for logging that leaks tokens or emails.
Files:
lib/codex-manager/commands/best.tslib/runtime-rotation-proxy.tslib/codex-manager/commands/forecast.tslib/prompts/codex.tslib/integration-generators.tslib/codex-manager/commands/integrations.tslib/codex-manager/commands/models.tslib/runtime/quota-probe.tslib/codex-manager/commands/report.tslib/codex-manager/help.tslib/codex-manager/forecast-report-commands.tslib/codex-manager/repair-commands.tslib/quota-probe.tslib/codex-manager.ts
scripts/*.js
📄 CodeRabbit inference engine (AGENTS.md)
Windows filesystem operations must include retry handling for transient
EBUSY,EPERM, andENOTEMPTYerrors
Files:
scripts/check-pack-budget-lib.js
lib/runtime-rotation-proxy.ts
📄 CodeRabbit inference engine (lib/AGENTS.md)
lib/runtime-rotation-proxy.ts: Runtime rotation code must preserve pass-through semantics except for auth/provider headers that intentionally change
Runtime proxy client-facing headers must not expose account emails or tokens
Runtime rotation should fail open to normal official Codex forwarding when startup helpers are unavailable
Never add account emails/tokens to runtime proxy client responsesDo not expose account emails or tokens in runtime proxy client response headers or logs
Files:
lib/runtime-rotation-proxy.ts
package.json
📄 CodeRabbit inference engine (SECURITY.md)
package.json: Pinhonoto4.12.18or higher (but below4.12.0-4.12.1) to avoid GHSA-xh87-mx6m-69f3 authentication bypass vulnerability
Pinrollupto^4.59.0or higher to avoid vulnerable versions below4.59.0in Vite and Vitest transitive dependencies
Files:
package.json
test/**/*.test.ts
📄 CodeRabbit inference engine (test/AGENTS.md)
test/**/*.test.ts: Vitest globals (describe,it,expect) are enabled and should be used without explicit imports
Maintain 80% coverage threshold across statements, branches, functions, and lines
UseremoveWithRetryfor Windows filesystem cleanup instead of barefs.rmto handle EBUSY/EPERM/ENOTEMPTY backoff
Use source files in tests, not compileddist/files; test the source directly
Do not skip tests without justification; include rationale if a test must be skipped
Relax ESLint rules for test files as specified ineslint.config.js
Files:
test/package-bin.test.tstest/runtime-quota-probe.test.tstest/codex-manager-report-command.test.tstest/documentation.test.tstest/codex-manager-forecast-command.test.tstest/codex-manager-integrations-command.test.tstest/repair-commands.test.tstest/codex-prompts.test.tstest/quota-probe.test.tstest/codex-manager-help.test.tstest/codex-manager-cli.test.tstest/check-pack-budget.test.ts
test/**/*.ts
📄 CodeRabbit inference engine (AGENTS.md)
Windows filesystem operations must include retry handling for transient
EBUSY,EPERM, andENOTEMPTYerrors where tests cover Windows locks
Files:
test/package-bin.test.tstest/runtime-quota-probe.test.tstest/codex-manager-report-command.test.tstest/documentation.test.tstest/codex-manager-forecast-command.test.tstest/codex-manager-integrations-command.test.tstest/repair-commands.test.tstest/codex-prompts.test.tstest/quota-probe.test.tstest/codex-manager-help.test.tstest/codex-manager-cli.test.tstest/check-pack-budget.test.ts
test/**
⚙️ CodeRabbit configuration file
tests must stay deterministic and use vitest. demand regression cases that reproduce concurrency bugs, token refresh races, and windows filesystem behavior. reject changes that mock real secrets or skip assertions.
Files:
test/package-bin.test.tstest/runtime-quota-probe.test.tstest/codex-manager-report-command.test.tstest/documentation.test.tstest/codex-manager-forecast-command.test.tstest/codex-manager-integrations-command.test.tstest/repair-commands.test.tstest/codex-prompts.test.tstest/quota-probe.test.tstest/codex-manager-help.test.tstest/codex-manager-cli.test.tstest/check-pack-budget.test.ts
test/**/documentation.test.ts
📄 CodeRabbit inference engine (test/AGENTS.md)
Test documentation parity including command flags, config precedence, changelog policy, and governance rules
Files:
test/documentation.test.ts
test/**/codex-manager-cli.test.ts
📄 CodeRabbit inference engine (test/AGENTS.md)
Test CLI settings with question cancellation across all 5 panels and EBUSY/concurrent race conditions
Files:
test/codex-manager-cli.test.ts
🧠 Learnings (4)
📓 Common learnings
Learnt from: CR
Repo: ndycode/codex-multi-auth
Timestamp: 2026-06-03T10:33:38.254Z
Learning: Use `npm i -g codex-multi-auth` for standard installation of the package
Learnt from: CR
Repo: ndycode/codex-multi-auth
Timestamp: 2026-06-03T10:33:38.254Z
Learning: Use `codex-multi-auth login` to initialize the first account and access the account menu
Learnt from: CR
Repo: ndycode/codex-multi-auth
Timestamp: 2026-06-03T10:33:38.254Z
Learning: Run `codex-multi-auth status`, `codex-multi-auth check`, and `codex-multi-auth forecast --live` to validate manager state and account health
Learnt from: CR
Repo: ndycode/codex-multi-auth
Timestamp: 2026-06-03T10:33:38.254Z
Learning: Use `codex-multi-auth doctor --fix` for automatic diagnosis and safe repair of storage or account issues
Learnt from: CR
Repo: ndycode/codex-multi-auth
Timestamp: 2026-06-03T10:33:38.254Z
Learning: Store account credentials and configuration under `~/.codex/multi-auth/` directory with support for override via `CODEX_MULTI_AUTH_DIR` environment variable
Learnt from: CR
Repo: ndycode/codex-multi-auth
Timestamp: 2026-06-03T10:33:38.254Z
Learning: Enable `CODEX_MULTI_AUTH_RUNTIME_ROTATION_PROXY=1` by default for live account rotation in forwarded Codex CLI sessions
Learnt from: CR
Repo: ndycode/codex-multi-auth
Timestamp: 2026-06-03T10:33:38.254Z
Learning: Implement request timeout with `CODEX_AUTH_FETCH_TIMEOUT_MS` and stream stall timeout with `CODEX_AUTH_STREAM_STALL_TIMEOUT_MS` environment variable overrides
Learnt from: CR
Repo: ndycode/codex-multi-auth
Timestamp: 2026-06-03T10:33:38.254Z
Learning: Restrict background Responses mode to opt-in via `backgroundResponses` setting or `CODEX_AUTH_BACKGROUND_RESPONSES=1` for stateful routing compatibility
Learnt from: CR
Repo: ndycode/codex-multi-auth
Timestamp: 2026-06-03T10:33:38.254Z
Learning: Implement whole-pool replay disabled by default when all accounts are rate-limited, with bounded outbound request budgets and cross-account 5xx cooldowns
Learnt from: CR
Repo: ndycode/codex-multi-auth
Timestamp: 2026-06-03T10:33:38.254Z
Learning: Stagger proactive refresh operations to reduce background request bursts across the account pool
📚 Learning: 2026-06-03T09:09:54.928Z
Learnt from: ndycode
Repo: ndycode/codex-multi-auth PR: 0
File: :0-0
Timestamp: 2026-06-03T09:09:54.928Z
Learning: In ndycode/codex-multi-auth, `scripts/check-pack-budget-lib.js` exports two separate lists: `REQUIRED_FILES` (exact full-path equality check for `.codex-plugin/plugin.json`, `README.md`, `LICENSE`) and `REQUIRED_PREFIXES` (directory prefix checks for `dist/`, `assets/`, etc.). This split prevents a sibling file like `.codex-plugin/plugin.json.bak` from satisfying the exact-file publish gate. Tests for this live in `test/check-pack-budget.test.ts`.
Applied to files:
scripts/check-pack-budget-lib.js
📚 Learning: 2026-06-03T10:33:03.622Z
Learnt from: ndycode
Repo: ndycode/codex-multi-auth PR: 0
File: :0-0
Timestamp: 2026-06-03T10:33:03.622Z
Learning: In ndycode/codex-multi-auth, `lib/runtime-rotation-proxy.ts` uses `CURRENT_CODEX_MODEL` (resolves to `gpt-5-codex`, codex family) — not `DEFAULT_MODEL` — as the fallback when deriving the Responses API request context `family` via `getModelFamily(model ?? CURRENT_CODEX_MODEL)` for model-less `/codex/responses` requests. Using `DEFAULT_MODEL` (gpt-5.5 → gpt-5.2 family) was a regression introduced in round 4 that mis-bucketed codex pass-throughs into the wrong rotation/cooldown/budget family; `CURRENT_CODEX_MODEL` was restored in commit `15b34f2` (PR `#506` round 5). `DEFAULT_MODEL` remains the correct fallback for quota-probe and CLI `--model` parse sites only.
Applied to files:
lib/runtime-rotation-proxy.ts
📚 Learning: 2026-06-03T10:07:04.084Z
Learnt from: ndycode
Repo: ndycode/codex-multi-auth PR: 0
File: :0-0
Timestamp: 2026-06-03T10:07:04.084Z
Learning: In ndycode/codex-multi-auth, all split-arg `--model`/`-m` parse sites trim the value *before* the missing/flag-like guard (`startsWith('-')` check), so whitespace-only values (`' '`) and strings like `' --json'` are rejected consistently. Sites: `parseBestArgs` in `lib/codex-manager.ts` and `lib/codex-manager/help.ts`, `parseForecastArgs` in `lib/codex-manager/commands/forecast.ts` and `lib/codex-manager/forecast-report-commands.ts` (×2), `parseFixArgs` in `lib/codex-manager/repair-commands.ts`, integrations in `lib/codex-manager/commands/integrations.ts`, models in `lib/codex-manager/commands/models.ts`. `parseReportArgs` in `lib/codex-manager/commands/report.ts` was trimmed before round 4. The `--model=<value>` forms have always trimmed; this round aligned the split-arg forms to match.
Applied to files:
lib/codex-manager/commands/forecast.tslib/codex-manager/commands/report.ts
🔇 Additional comments (12)
package.json (1)
123-123: LGTM!scripts/check-pack-budget-lib.js (1)
16-24: LGTM!Also applies to: 108-124
test/check-pack-budget.test.ts (1)
99-99: LGTM!Also applies to: 112-149, 156-156, 182-198
test/package-bin.test.ts (1)
17-23: LGTM!test/codex-manager-cli.test.ts (2)
2009-2027: LGTM!Also applies to: 3279-3350, 7023-7070
748-748: LGTM!Also applies to: 1775-1775, 2992-2992, 3078-3078, 3124-3124, 3268-3270, 3401-3401, 7198-7198, 7411-7416, 9978-9985
lib/integration-generators.ts (1)
1-1: LGTM!Also applies to: 20-25
test/codex-manager-integrations-command.test.ts (1)
3-3: LGTM!Also applies to: 19-19, 33-51
test/runtime-quota-probe.test.ts (1)
4-4: LGTM!Also applies to: 46-46, 94-94
lib/codex-manager/help.ts (1)
1-4: LGTM!Also applies to: 145-219
README.md (1)
199-199: LGTM!test/codex-manager-help.test.ts (1)
5-7: LGTM!Also applies to: 94-127, 142-172
| const DEFAULT_QUOTA_PROBE_MODELS = [ | ||
| DEFAULT_MODEL, | ||
| "gpt-5.4", | ||
| "gpt-5.3-codex", | ||
| "gpt-5.2-codex", | ||
| "gpt-5-codex", | ||
| ] as const; |
There was a problem hiding this comment.
🛠️ Refactor suggestion | 🟠 Major | ⚡ Quick win
extract the probe fallback chain into one shared constant.
lib/quota-probe.ts:57-63 and lib/runtime/quota-probe.ts:6-12 still carry the same ordered model list in two places. that contract already drifted once in this pr. keeping both copies means the next default bump or inserted fallback can split manager live probes from runtime probes again. wire both call sites to one exported array/helper and keep test/quota-probe.test.ts:88-110 plus test/runtime-quota-probe.test.ts:19-96 as the shared contract.
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
In `@lib/quota-probe.ts` around lines 57 - 63, The duplicated ordered model list
(DEFAULT_QUOTA_PROBE_MODELS) is defined in two places; extract it into a single
exported constant in a shared module and have both the quota probe
implementation and the runtime quota probe import and use that constant instead
of redefining the array. Update references that currently use the local array
(the quota probe code that uses DEFAULT_QUOTA_PROBE_MODELS and the runtime probe
module that repeats the list) to import the shared symbol, and adjust the tests
that assert the probe fallback chain to reference the same exported
constant/contract so there is a single source of truth for the fallback chain.
… cli tests CodeRabbit round 6: - extract the duplicated quota-probe fallback chain into one exported QUOTA_PROBE_MODEL_CHAIN in model-map.ts; lib/quota-probe.ts and lib/runtime/quota-probe.ts both import it, so the ordered candidate list can no longer drift between manager and runtime probes (it already split once this PR). - test/codex-manager-cli.test.ts: replace default-probe-model assertions that hardcoded 'gpt-5.5' with the shared DEFAULT_MODEL constant (7 sites); left the cache-seed fixtures and the model-inspection literal as real test inputs. Value-neutral. Full suite: 4362 passed, 3 skipped, 0 failed; typecheck + lint clean. Co-Authored-By: Claude Opus 4.8 <[email protected]>
|
Round 6 addressed in
Full suite: 4362 passed, 0 failed; typecheck + lint clean; Greptile pass. @coderabbitai full review |
🧩 Analysis chain🏁 Script executed: Unrecoverable error: Failed to clone repository
the suite stable at 4362, no regressions. triggering full review. ✏️ Learnings added
✅ Actions performedFull review triggered. |
#506 (gpt-5.5 default probe, Codex-unavailable labeling, plugin manifest packaging, --model hardening, codex-family fallback) ships under 2.2.1; add it to docs/releases/v2.2.1.md so the notes match what's on main. Co-Authored-By: Claude Opus 4.8 <[email protected]>
None of these files is imported anywhere in the repo (verified by whole-repo reference search incl. scripts' dynamic dist imports, package.json export subpaths, vendor/, and the plugin manifest): - lib/codex-manager/forecast-report-commands.ts (625 LOC): superseded by commands/forecast.ts + commands/report.ts, which the dispatcher imports. The dead copy was still being patched in parallel (ndycode#502, ndycode#506) - exactly the drift hazard an orphaned duplicate creates. - lib/codex-manager/statusline-order.ts: duplicate of reorderStatuslineField in settings-panels.ts (the live, tested one). - lib/runtime/account-health-check.ts: clampRuntimeActiveIndices is never wired into account-check.ts's injected deps by any caller. - lib/runtime/oauth-browser-flow.ts: superseded by browser-oauth-flow.ts / manual-oauth-flow.ts. - lib/runtime/session-affinity.ts: ensureRuntimeSessionAffinity has no callers; rotation code constructs SessionAffinityStore directly. Also drops the stale runtime/session-affinity.ts row from the lib/AGENTS.md structure tree. https://claude.ai/code/session_01XNtnkLbBiXZxfQQYLMpucB
Summary
gpt-5.5as the default live/quota probe model, while keeping legacy Codex fallback compatibilityVerification
npm test -- --run test/codex-manager-cli.test.ts test/codex-manager-help.test.ts test/quota-probe.test.ts test/codex-manager-integrations-command.test.tsnpm test -- --run test/codex-prompts.test.ts test/documentation.test.ts test/runtime-rotation-proxy.test.tsnpm test -- --run test/runtime-quota-probe.test.ts test/runtime-account-check.test.ts test/repair-commands.test.ts test/package-bin.test.ts test/check-pack-budget.test.ts test/plugin-manifest.test.tsnpm run typechecknpm run pack:checknote: greptile review for oc-chatgpt-multi-auth. cite files like
lib/foo.ts:123. confirm regression tests + windows concurrency/token redaction coverage.Greptile Summary
this pr promotes
gpt-5.5as the default live/quota probe model, unifies both the manager and runtime probe fallback chains into a singleQUOTA_PROBE_MODEL_CHAINconstant, corrects the misleading "signed in and working" label for codex-unavailable accounts, adds exact-file validation for the plugin manifest in npm pack budgets, and hardens--modelflag parsing across all command modules to reject flag-like next-arg values.DEFAULT_MODEL = \"gpt-5.5\"andQUOTA_PROBE_MODEL_CHAIN = [gpt-5.5, gpt-5.4, gpt-5.3-codex, ...]exported frommodel-map.ts; bothlib/quota-probe.tsandlib/runtime/quota-probe.tsnow import the same list, eliminating drift between the manager and runtime probe paths.CodexUnavailableErrorand probe-skip paths now land insignedInOnly(notok), and the live summary showscodexAvailable | signed in only | need re-logininstead of a single "working" bucket, making plan-access failures visible at a glance..codex-plugin/plugin.jsonadded topackage.jsonfiles field and toREQUIRED_FILES(exact-path check);README.mdandLICENSEmigrated from prefix-match to exact-match, closing a bug whereREADME.md.bakcould satisfy the README requirement.Confidence Score: 5/5
safe to merge; all changed paths have corresponding test coverage and the runtime-rotation fallback model logic is correctly preserved
the logic change is well-contained — a constant rename, a label correction, and a pack-budget exact-file gate. the probe chain unification eliminates an existing drift risk. the two minor observations (dead
oktracking in live mode, missing absence-tests for README/LICENSE) don't affect runtime correctnesslib/codex-manager.ts (dead
okcounter in live path) and test/check-pack-budget.test.ts (no test for absent README.md or LICENSE)Important Files Changed
Flowchart
%%{init: {'theme': 'neutral'}}%% flowchart TD A[runHealthCheck liveProbe=true] --> B{usable token?} B -- yes --> C{accountId present?} B -- no --> D[queuedRefresh] D -- success --> C D -- fail + sessionValid --> E[warnings++ signedInOnly++] D -- fail session dead --> F[failed++] C -- no --> G[ok++ warnings++ signedInOnly++ tone=warning] C -- yes --> H[fetchCodexQuotaSnapshot via QUOTA_PROBE_MODEL_CHAIN] H --> I{probe result} I -- success --> J[ok++ codexAvailable++ tone=success] I -- CodexUnavailableError --> K[ok++ warnings++ signedInOnly++ tone=warning] I -- other error --> K E --> M[live summary] F --> M J --> M K --> M G --> M M --> N[codexAvailable - signed in only - need re-login]Prompt To Fix All With AI
Reviews (10): Last reviewed commit: "refactor(#506): single probe-chain const..." | Re-trigger Greptile