Skip to content

docs(codex): clarify pool routing and account continuity - #862

Open
luvs01 wants to merge 5 commits into
lidge-jun:devfrom
luvs01:docs/806-codex-routing-semantics
Open

docs(codex): clarify pool routing and account continuity#862
luvs01 wants to merge 5 commits into
lidge-jun:devfrom
luvs01:docs/806-codex-routing-semantics

Conversation

@luvs01

@luvs01 luvs01 commented Aug 1, 2026

Copy link
Copy Markdown
Contributor

Fixes #806

Summary

  • separate the Codex pool UI and documentation into three distinct behaviors: new/unbound task assignment, usage-based proactive switching, and failure-time recovery
  • make threshold help strategy-specific:
    • quota can proactively rebind an already-bound task after the threshold
    • round-robin does not use the threshold for its base distribution
    • fill-first uses the threshold as the drain point for unbound tasks while healthy bound tasks retain affinity
  • define a new/unbound task in terms of the proxy's current account binding, including the proxy-restart and cleared-affinity cases
  • replace the overbroad “automatic switching is off” claim with wording limited to usage-based switching
  • explain pre-output 429/402 retry, cooldown, reauthentication, exclusion, and configured transient failover independently from the percentage threshold
  • use one conversation-continuity versus provider prompt-cache note for both manual and automatic account changes
  • keep English, German, Japanese, Korean, Russian, and Chinese dashboard copy aligned, and update every maintained CLI/configuration documentation locale

Scope

This is a semantic copy and documentation correction only. It does not change pool routing, affinity, quota, retry, or failover behavior, and it does not redesign the existing controls.

Validation

  • CLI account matrix: 63 passed, 0 failed on Bun 1.4.0-canary.1 and bundled Bun 1.3.14
  • Codex account auto-switch GUI tests: 21 passed, 0 failed on both runtimes
  • TypeScript typecheck passed
  • GUI ESLint passed
  • privacy scan passed

The change follows the maintainer direction in #806: English-first semantics, equivalent maintained locales, strategy-specific threshold copy, an explicit unbound-task definition, separate failure recovery, and shared continuity/cache guidance.

Summary by CodeRabbit

  • New Features
    • Clarified account-pool routing and switching behavior in the CLI and GUI.
    • Added strategy-specific guidance for quota, round-robin, and fill-first modes.
    • Explained assignment of new or unbound tasks, affinity resets, thresholds, retries, and recovery.
    • Added guidance about conversation context replay and possible prompt-cache rewarming after account changes.
  • Documentation
    • Updated account-pool configuration and CLI guidance across supported languages.
  • Tests
    • Expanded coverage for strategy-specific switching, recovery, messaging, and unbound-task assignment.

@github-actions github-actions Bot added the documentation Improvements or additions to documentation label Aug 1, 2026
@coderabbitai

coderabbitai Bot commented Aug 1, 2026

Copy link
Copy Markdown

Review Change Stack

Warning

Review limit reached

@luvs01, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 40 minutes

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: 02cac345-13b4-4741-9005-18eff481ea8b

📥 Commits

Reviewing files that changed from the base of the PR and between 7e7e782 and b455a91.

📒 Files selected for processing (10)
  • docs-site/src/content/docs/ja/reference/cli.md
  • docs-site/src/content/docs/ja/reference/configuration.md
  • docs-site/src/content/docs/ko/reference/cli.md
  • docs-site/src/content/docs/ko/reference/configuration.md
  • docs-site/src/content/docs/reference/cli.md
  • docs-site/src/content/docs/reference/configuration.md
  • docs-site/src/content/docs/ru/reference/cli.md
  • docs-site/src/content/docs/ru/reference/configuration.md
  • docs-site/src/content/docs/zh-cn/reference/cli.md
  • docs-site/src/content/docs/zh-cn/reference/configuration.md
📝 Walkthrough

Walkthrough

The pull request aligns Codex account-pool behavior across CLI messages, reference documentation, GUI controls, translations, and tests. It documents affinity reset, unbound-task assignment, strategy-specific switching, recovery, conversation replay, and provider prompt-cache behavior.

Changes

Account pool routing semantics

Layer / File(s) Summary
CLI account selection behavior
docs-site/src/content/docs/*/reference/cli.md, src/cli/account.ts, src/cli/help.ts, tests/cli-account.test.ts
CLI text and tests now describe next-request routing after affinity reset, in-flight account continuity, later reselection, conversation replay, and possible cold provider prompt caches.
Pool routing configuration
docs-site/src/content/docs/*/reference/configuration.md
Configuration documentation now defines unbound assignments, quota rebinding, round-robin stickiness, fill-first behavior, alternate-account retries, recovery routing, and binding-based sticky limits.
GUI strategy state and descriptions
gui/src/components/AccountPoolStrategyControls.tsx, gui/src/components/CodexAccountPool.tsx, gui/src/components/CodexAutoSwitchSetting.tsx, gui/src/components/CodexPoolStrategySetting.tsx
The GUI resolves and propagates the active strategy, renders strategy-specific switching guidance, and reports unbound-task and cache behavior.
Localized behavior and validation
gui/src/i18n/*.ts, gui/tests/*.tsx
Translations and tests cover strategy-specific thresholds, recovery messaging, assignment behavior, sticky-limit semantics, loading behavior, and updated accessibility text.

Estimated code review effort: 3 (Moderate) | ~20 minutes

Possibly related PRs

  • lidge-jun/opencodex#337 — Extends the earlier Codex auto-switch threshold UI and related account-pool components.
  • lidge-jun/opencodex#593 — Overlaps with account-pool affinity, assignment, quota rebinding, and strategy behavior.
  • lidge-jun/opencodex#715 — Builds on account-pool selection-order and pinning behavior across CLI, GUI, and documentation.

Suggested reviewers: lidge-jun, ingwannu

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 42.86% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly summarizes the primary changes: clarifying Codex pool routing and account continuity.
Linked Issues check ✅ Passed The documentation, UI copy, CLI text, and tests address all coding objectives in [#806], including routing, thresholds, affinity, failover, and cache behavior.
Out of Scope Changes check ✅ Passed All changes support [#806] through documentation, localized UI updates, CLI messaging, and related test updates; no unrelated code changes are evident.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Comment @coderabbitai help to get the list of available commands.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 7a444761f9

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread docs-site/src/content/docs/reference/configuration.md Outdated

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Actionable comments posted: 2

🤖 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 `@docs-site/src/content/docs/reference/cli.md`:
- Around line 370-374: Update the App login documentation so failure-time
account rotation is clearly independent of usage-based switching and cannot be
disabled by auto-switch off: in docs-site/src/content/docs/reference/cli.md
lines 370-374, define the Pool-versus-Direct behavior, process-local affinity
reset, 401/403 reauthentication, 429/retry-after cooldowns,
threshold-independent recovery, and prompt-cache continuity, then use it as the
translation source. Apply the equivalent semantics in
docs-site/src/content/docs/ja/reference/cli.md lines 271-275,
docs-site/src/content/docs/ko/reference/cli.md lines 312-316,
docs-site/src/content/docs/ru/reference/cli.md lines 301-306, and
docs-site/src/content/docs/zh-cn/reference/cli.md lines 262-265.

In `@gui/src/components/CodexAccountPool.tsx`:
- Line 55: Keep poolStrategy unresolved until CodexPoolStrategySetting finishes
loading instead of initializing it to DEFAULT_ACCOUNT_POOL_STRATEGY. Update the
rendering around the strategy explanation and threshold control, including
CodexAutoSwitchSetting, so quota-specific UI is deferred or disabled while
unresolved and only becomes interactive after the persisted strategy succeeds;
add a regression test covering a delayed round-robin or fill-first response.
🪄 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: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: f2b4ab40-c403-4b8e-8c65-4b2a4f84475c

📥 Commits

Reviewing files that changed from the base of the PR and between aae9426 and 7a44476.

📒 Files selected for processing (24)
  • docs-site/src/content/docs/ja/reference/cli.md
  • docs-site/src/content/docs/ja/reference/configuration.md
  • docs-site/src/content/docs/ko/reference/cli.md
  • docs-site/src/content/docs/ko/reference/configuration.md
  • docs-site/src/content/docs/reference/cli.md
  • docs-site/src/content/docs/reference/configuration.md
  • docs-site/src/content/docs/ru/reference/cli.md
  • docs-site/src/content/docs/ru/reference/configuration.md
  • docs-site/src/content/docs/zh-cn/reference/cli.md
  • docs-site/src/content/docs/zh-cn/reference/configuration.md
  • gui/src/components/AccountPoolStrategyControls.tsx
  • gui/src/components/CodexAccountPool.tsx
  • gui/src/components/CodexAutoSwitchSetting.tsx
  • gui/src/components/CodexPoolStrategySetting.tsx
  • gui/src/i18n/de.ts
  • gui/src/i18n/en.ts
  • gui/src/i18n/ja.ts
  • gui/src/i18n/ko.ts
  • gui/src/i18n/ru.ts
  • gui/src/i18n/zh.ts
  • gui/tests/codex-account-auto-switch.test.tsx
  • src/cli/account.ts
  • src/cli/help.ts
  • tests/cli-account.test.ts

Comment thread docs-site/src/content/docs/reference/cli.md Outdated
Comment thread gui/src/components/CodexAccountPool.tsx Outdated

luvs01 commented Aug 1, 2026

Copy link
Copy Markdown
Contributor Author

Follow-up review fixes are in 7e7e782.

  • Restored the quota-threshold condition across all five configuration locales.
  • Documented Pool versus Direct routing, process-local affinity reset, 401/403 reauthentication, 429/retry-after cooldown, threshold-independent pre-output recovery, and prompt-cache continuity in all five CLI locales.
  • Deferred quota-specific GUI controls until the persisted pool strategy resolves, with a delayed round-robin regression.

Local validation: 63 CLI tests, all 468 GUI tests on Bun 1.4.0-canary.1, 43 focused GUI tests on bundled Bun 1.3.14, GUI ESLint, i18n lint, production GUI build, root typecheck/privacy checks, and a successful frozen docs production build.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Actionable comments posted: 2

🤖 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 `@docs-site/src/content/docs/ja/reference/configuration.md`:
- Around line 99-100: In the Japanese configuration documentation paragraph
describing the quota assignment and proactive switching strategy, remove the
duplicated threshold clause spanning the line break and fix the surrounding
punctuation so the sentence contains only one autoSwitchThreshold condition
before continuing to the round-robin description.

In `@docs-site/src/content/docs/reference/cli.md`:
- Around line 370-377: Document the complete failure-time routing contract
across all listed CLI and configuration locale sections: in each CLI file, state
that 401/403 clears affinity and requires reauthentication, while 429 honors
Retry-After, starts cooldown, clears affinity, and may rotate to another
eligible Pool account; in each configuration file, add those explicit
transitions while retaining the existing one-retry 429/402 rule. Keep
autoSwitchThreshold: 0 limited to usage-based proactive switching, with failure
recovery still active. Update
docs-site/src/content/docs/reference/cli.md:370-377,
docs-site/src/content/docs/ja/reference/cli.md:271-272,
docs-site/src/content/docs/ko/reference/cli.md:312-313,
docs-site/src/content/docs/ru/reference/cli.md:301-302,
docs-site/src/content/docs/zh-cn/reference/cli.md:262-262,
docs-site/src/content/docs/reference/configuration.md:143-151,
docs-site/src/content/docs/ja/reference/configuration.md:88-97,
docs-site/src/content/docs/ko/reference/configuration.md:90-97,
docs-site/src/content/docs/ru/reference/configuration.md:96-104, and
docs-site/src/content/docs/zh-cn/reference/configuration.md:85-94, translating
the additions appropriately for each locale.
🪄 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: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: 502eca5f-90b4-4a81-b914-408093844e43

📥 Commits

Reviewing files that changed from the base of the PR and between 7a44476 and 7e7e782.

📒 Files selected for processing (13)
  • docs-site/src/content/docs/ja/reference/cli.md
  • docs-site/src/content/docs/ja/reference/configuration.md
  • docs-site/src/content/docs/ko/reference/cli.md
  • docs-site/src/content/docs/ko/reference/configuration.md
  • docs-site/src/content/docs/reference/cli.md
  • docs-site/src/content/docs/reference/configuration.md
  • docs-site/src/content/docs/ru/reference/cli.md
  • docs-site/src/content/docs/ru/reference/configuration.md
  • docs-site/src/content/docs/zh-cn/reference/cli.md
  • docs-site/src/content/docs/zh-cn/reference/configuration.md
  • gui/src/components/CodexAccountPool.tsx
  • gui/tests/account-pool-strategy.test.tsx
  • gui/tests/codex-auto-switch-controller.test.tsx

Comment thread docs-site/src/content/docs/ja/reference/configuration.md Outdated
Comment thread docs-site/src/content/docs/reference/cli.md
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant