Skip to content

feat(codex): add account pause controls and bulk exhaustion action - #565

Closed
Alvin0412 wants to merge 9 commits into
lidge-jun:devfrom
Alvin0412:agent/codex-account-pause
Closed

feat(codex): add account pause controls and bulk exhaustion action#565
Alvin0412 wants to merge 9 commits into
lidge-jun:devfrom
Alvin0412:agent/codex-account-pause

Conversation

@Alvin0412

@Alvin0412 Alvin0412 commented Jul 27, 2026

Copy link
Copy Markdown

What changed

  • add a persisted Pause / Resume control for the main Codex login and every added pool account
  • exclude paused accounts from future affinity, quota rotation, 429 fallback, transient failover, cooldown probes, subagent fallback, and manual activation
  • fail closed when every Pool account is paused
  • add a Pause exhausted bulk action beside quota refresh
  • refresh all accounts before the bulk action and pause only accounts whose plan-relevant quota window is freshly confirmed at exactly 100%
  • keep unknown quota, failed refreshes, and already-paused accounts unchanged
  • keep Go / Free plans on their 30-day quota semantics
  • expose the controls in both Codex Auth and the embedded Providers account surface, with all six GUI locales and configuration docs updated

Why

A dedicated eligibility control is more general than special-casing the main account as a last resort. It lets users explicitly reserve any account, including the main login, without allowing retries, resets, or fallback paths to silently reintroduce it.

The bulk action removes repetitive manual work while keeping the decision strict: routing's conservative unknown-quota score is not reused, so an unknown or stale quota cannot be mistaken for exhaustion.

Behavior

Pause affects future Pool selections. In-flight requests keep the credential captured when they started. Quota metadata remains visible and refreshable. Direct mode continues to use its existing single-main-account semantics.

Validation

  • targeted Codex routing and auth API tests: 167 passed
  • GUI test suite: 298 passed
  • GUI controller / bulk action checks: 15 passed
  • TypeScript typecheck: passed
  • GUI ESLint and production build: passed
  • docs production build: passed
  • privacy scan: passed
  • full root suite: 4,839 passed; 2 server-auth tests fail with Bun ECONNRESET
  • the same two server-auth failures reproduce unchanged on the untouched 7ba0fec base checkout (52 passed, 2 failed)

Summary by CodeRabbit

  • New Features

    • Added controls to pause/resume individual Codex pool accounts (including the main account) and bulk “Pause exhausted”: refreshes quotas first, then pauses only accounts confirmed at 100%.
    • Added pausedCodexAccountIds to persist pause exclusions across restarts.
    • GUI: pause/resume buttons, paused badges/hints, and localized “pause exhausted” workflow.
  • Bug Fixes

    • Paused accounts are excluded from automatic selection, retry/failover, cooldown recovery, and manual activation (paused activation rejected).
    • If all accounts are paused, pool routing fails closed.
    • Active reauth prompting is suppressed when the active account is paused; deleting a paused account clears its stored pause state.
  • Documentation

    • Updated configuration and pool behavior notes across supported languages.

@coderabbitai

coderabbitai Bot commented Jul 27, 2026

Copy link
Copy Markdown

Review Change Stack

Note

Reviews paused

It 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 reviews.auto_review.auto_pause_after_reviewed_commits setting.

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • ▶️ Resume reviews
  • 🔍 Trigger review
📝 Walkthrough

Walkthrough

The change adds persisted Codex account pausing, quota-confirmed bulk pausing, routing exclusions, API endpoints, GUI controls, localized text, lifecycle cleanup, configuration documentation, and automated coverage.

Changes

Codex account pausing

Layer / File(s) Summary
Pause configuration and lifecycle contract
src/types.ts, src/config.ts, src/codex/account-pause.ts, src/codex/account-lifecycle.ts, structure/..., docs-site/src/content/docs/*/reference/configuration.md, README.md, tests/config.test.ts, tests/rate-limit-reset-credits.test.ts
Defines, validates, persists, documents, and cleans up pausedCodexAccountIds, including quota-confirmed bulk-pause behavior.
Quota-aware pause API
src/codex/quota.ts, src/codex/auth-api.ts, tests/codex-auth-api.test.ts
Adds 100%-based exhaustion detection, fresh quota propagation, pause/resume endpoints, paused account DTO fields, active-account rejection, and API coverage.
Routing and fallback exclusion
src/codex/routing.ts, src/codex/subagent-model-fallback.ts, tests/codex-routing.test.ts, tests/codex-auth-context.test.ts
Excludes paused accounts from selection, affinity reuse, cooldown fallback, and subagent fallback while preserving captured in-flight contexts.
GUI controls and validation
gui/src/hooks/useCodexAccountPool.ts, gui/src/components/*CodexAccountPool*, gui/src/icons.tsx, gui/src/i18n/*, gui/tests/*CodexAccountPool*
Adds serialized pause mutations, individual and bulk controls, paused-state rendering, translations, icons, toast handling, and GUI behavior tests.

Estimated code review effort: 4 (Complex) | ~60 minutes

Possibly related PRs

  • lidge-jun/opencodex#391: Extends related subagent fallback availability logic that intersects with paused-account exclusion.

Suggested reviewers: lidge-jun, wibias, ingwannu

Sequence Diagram(s)

sequenceDiagram
  participant AccountPoolUI
  participant useCodexAccountPool
  participant CodexAuthAPI
  participant Config
  AccountPoolUI->>useCodexAccountPool: pause account or pause exhausted accounts
  useCodexAccountPool->>CodexAuthAPI: send pause mutation
  CodexAuthAPI->>Config: persist pausedCodexAccountIds
  CodexAuthAPI-->>useCodexAccountPool: return paused state and active account
  useCodexAccountPool-->>AccountPoolUI: render updated account state
Loading
🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 14.81% 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 accurately summarizes the main change: Codex pause controls plus the bulk pause-exhausted action.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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

Copy link
Copy Markdown
Author

@coderabbitai review

@coderabbitai

coderabbitai Bot commented Jul 27, 2026

Copy link
Copy Markdown
✅ Action performed

Review finished.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

Copy link
Copy Markdown
Author

@lidge-jun The PR Labeler is failing before it reaches any branch code. Run 30292826165 reports Issues: write, but POST /repos/lidge-jun/opencodex/issues/565/labels still returns 403 Resource not accessible by integration while applying the expected enhancement label. Because this is pull_request_target using trusted default-branch code, the fork branch cannot repair or rerun it. Could you please add enhancement manually or adjust the repository Actions/App policy for this workflow?

@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 `@gui/src/hooks/useCodexAccountPool.ts`:
- Around line 242-266: Translate the "__main__" sentinel when reconciling
main-account pause state: in gui/src/hooks/useCodexAccountPool.ts:242-266,
update setAccountPaused’s setAccounts predicate to match either the requested id
or "__main__" with account.isMain; in
gui/src/components/codex-account-pool-main-card.tsx:96-113, compare
pauseUpdatingId to "__main__" for the Saving indicator; in
gui/tests/codex-account-pool-behaviour.test.tsx:128-157, add a regression test
using a main account whose real id differs from "__main__" and assert
setAccountPaused("__main__", true) updates its paused flag.

In `@gui/tests/codex-account-pool-behaviour.test.tsx`:
- Around line 128-157: Add a test for setAccountPaused("__main__", true) using a
fixture whose isMain account has a distinct real id, then assert the matching
account’s paused flag becomes true locally and the operation succeeds. Place it
alongside the existing direct-id pause tests to cover the sentinel path used by
CodexAccountPoolMainCard.
🪄 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: 7d3f2b55-7d88-465f-a6a0-5a10ee59a03c

📥 Commits

Reviewing files that changed from the base of the PR and between f348166 and ebac7ba.

📒 Files selected for processing (34)
  • README.md
  • docs-site/src/content/docs/ja/reference/configuration.md
  • docs-site/src/content/docs/ko/reference/configuration.md
  • docs-site/src/content/docs/reference/configuration.md
  • docs-site/src/content/docs/ru/reference/configuration.md
  • docs-site/src/content/docs/zh-cn/reference/configuration.md
  • gui/src/components/CodexAccountPool.tsx
  • gui/src/components/codex-account-pool-cards.tsx
  • gui/src/components/codex-account-pool-main-card.tsx
  • gui/src/hooks/useCodexAccountPool.ts
  • 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/src/icons.tsx
  • gui/tests/codex-account-pool-behaviour.test.tsx
  • gui/tests/codex-account-pool-controller.test.ts
  • gui/tests/codex-account-pool-toast-tone.test.tsx
  • src/codex/account-lifecycle.ts
  • src/codex/account-pause.ts
  • src/codex/auth-api.ts
  • src/codex/quota.ts
  • src/codex/routing.ts
  • src/codex/subagent-model-fallback.ts
  • src/config.ts
  • src/types.ts
  • structure/08_openai-provider-tiers.md
  • tests/codex-auth-api.test.ts
  • tests/codex-auth-context.test.ts
  • tests/codex-routing.test.ts
  • tests/config.test.ts
  • tests/rate-limit-reset-credits.test.ts

Comment thread gui/src/hooks/useCodexAccountPool.ts
Comment thread gui/tests/codex-account-pool-behaviour.test.tsx
@lidge-jun lidge-jun added the enhancement New feature or request label Jul 27, 2026
@Alvin0412
Alvin0412 marked this pull request as ready for review July 27, 2026 18:38

@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.

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (2)
gui/src/hooks/useCodexAccountPool.ts (1)

259-262: 🗄️ Data Integrity & Integration | 🟠 Major | 🏗️ Heavy lift

Serialize active-account reconciliation across pause and switch mutations.

setAccountPaused and pauseExhaustedAccounts unconditionally overwrite pendingActiveIdRef and activeId, while switchAccount can run concurrently because pauseMutationRef does not cover it. If a pause response arrives after a newer switch response, it can replace the accepted active account with a stale value. Subsequent loads treat the mismatch as a stale read and keep the incorrect pending value, leaving the GUI out of sync with the management API.

Serialize these mutations or use a shared monotonic mutation/request token so only the latest operation commits activeId and pendingActiveIdRef. Add a delayed-response regression test covering switch-versus-pause ordering.

As per path instructions, GUI state changes must stay consistent with management API responses.

Also applies to: 286-289

🤖 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 `@gui/src/hooks/useCodexAccountPool.ts` around lines 259 - 262, Serialize
active-account mutations across switchAccount, setAccountPaused, and
pauseExhaustedAccounts, or introduce a shared monotonic request token, so only
the latest management API response updates activeId and pendingActiveIdRef.
Ensure stale pause responses cannot overwrite a newer switch result, while
preserving GUI state consistency with the accepted API response, and add a
delayed switch-versus-pause regression test.

Source: Path instructions

gui/src/components/codex-account-pool-main-card.tsx (1)

146-159: 🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win

Disable header actions during individual pause mutations.

The header buttons only check refreshingQuota || pausingExhausted. While setAccountPaused is in flight, pauseUpdatingId is non-null but “Pause exhausted” remains clickable and immediately receives { ok: false, reason: "busy" }; refresh can also run concurrently with the pause reconciliation.

Pass a unified pause-busy value (for example, pauseUpdatingId !== null || pausingExhausted) into CodexAccountPoolPageHead and use it for both buttons. Add a UI test asserting both controls are disabled during an individual pause.

As per path instructions, GUI state changes must stay consistent with management API responses.

🤖 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 `@gui/src/components/codex-account-pool-main-card.tsx` around lines 146 - 159,
Update CodexAccountPoolPageHead and its caller to derive a unified pause-busy
state from pauseUpdatingId being non-null or pausingExhausted, then use that
state alongside refreshingQuota to disable both header actions. Preserve
management API response handling and add a UI test verifying both controls are
disabled while an individual pause mutation is in flight.

Source: Path instructions

🤖 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.

Outside diff comments:
In `@gui/src/components/codex-account-pool-main-card.tsx`:
- Around line 146-159: Update CodexAccountPoolPageHead and its caller to derive
a unified pause-busy state from pauseUpdatingId being non-null or
pausingExhausted, then use that state alongside refreshingQuota to disable both
header actions. Preserve management API response handling and add a UI test
verifying both controls are disabled while an individual pause mutation is in
flight.

In `@gui/src/hooks/useCodexAccountPool.ts`:
- Around line 259-262: Serialize active-account mutations across switchAccount,
setAccountPaused, and pauseExhaustedAccounts, or introduce a shared monotonic
request token, so only the latest management API response updates activeId and
pendingActiveIdRef. Ensure stale pause responses cannot overwrite a newer switch
result, while preserving GUI state consistency with the accepted API response,
and add a delayed switch-versus-pause regression test.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: 417f282b-2dfb-4773-ad42-909aeee379d2

📥 Commits

Reviewing files that changed from the base of the PR and between ebac7ba and 84247cd.

📒 Files selected for processing (3)
  • gui/src/components/codex-account-pool-main-card.tsx
  • gui/src/hooks/useCodexAccountPool.ts
  • gui/tests/codex-account-pool-behaviour.test.tsx

@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: 84247cd904

ℹ️ 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 src/codex/auth-api.ts Outdated
@Wibias
Wibias marked this pull request as draft July 28, 2026 01:50
@Alvin0412

Copy link
Copy Markdown
Author

Hi @Wibias, the Codex P2 feedback has been addressed in 36946b9 and the review thread is resolved. All checks are passing. Was the draft conversion intentional, or should I mark this ready for review again?

@Wibias
Wibias marked this pull request as ready for review July 28, 2026 03:03

@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: 36946b9ec3

ℹ️ 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 src/codex/auth-api.ts Outdated
Comment thread gui/src/hooks/useCodexAccountPool.ts
Comment thread src/codex/auth-api.ts Outdated
Comment thread src/codex/auth-api.ts Outdated
Comment thread gui/src/hooks/useCodexAccountPool.ts

@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.

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (2)
gui/src/hooks/useCodexAccountPool.ts (1)

272-297: 🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win

Bulk "pause exhausted" doesn't handle the "__main__" sentinel, and no test catches it. pauseExhaustedAccounts was added without the sentinel-translation logic already present in its sibling setAccountPaused, and the new bulk-pause test never exercises the main-account path to catch the gap.

  • gui/src/hooks/useCodexAccountPool.ts#L272-L297: extend the setAccounts predicate at Line 285 to also match pausedIds.has("__main__") && account.isMain, mirroring Line 255's setAccountPaused logic.
  • gui/tests/codex-account-pool-behaviour.test.tsx#L194-L209: add a bulk-pause regression test where the pause-exhausted mock returns pausedAccountIds: ["__main__"] against a fixture whose isMain row has a real id distinct from "__main__", asserting that row's paused flag flips locally (mirroring the existing setAccountPaused("__main__", true) test at Lines 149-166).
🤖 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 `@gui/src/hooks/useCodexAccountPool.ts` around lines 272 - 297, Update
pauseExhaustedAccounts in gui/src/hooks/useCodexAccountPool.ts lines 272-297 so
its setAccounts predicate marks an account paused when pausedIds contains
"__main__" and account.isMain, matching setAccountPaused behavior. Add a
regression test in gui/tests/codex-account-pool-behaviour.test.tsx lines 194-209
using a distinct real ID for the isMain fixture, returning pausedAccountIds:
["__main__"], and asserting the main row’s local paused flag changes.

Source: Path instructions

src/codex/auth-api.ts (1)

751-766: 🎯 Functional Correctness | 🔴 Critical | ⚡ Quick win

Normalize the target account before the pause check
In src/codex/auth-api.ts:751-766, body.accountId: null skips isCodexAccountPaused(...), but the same handler later treats null as MAIN_CODEX_ACCOUNT_ID for routing. That lets a paused main account be reselected through /api/codex-auth/active. Normalize first, then check the pause state, and add a regression test for the null body 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 `@src/codex/auth-api.ts` around lines 751 - 766, Normalize body.accountId to
the effective target account, using MAIN_CODEX_ACCOUNT_ID when it is null,
before calling isCodexAccountPaused in the PUT /api/codex-auth/active handler.
Use that normalized target consistently for pause validation and
resetCodexRoutingForManualSelection, while preserving the response’s existing
accountId value; add a regression test covering a null accountId when the main
account is paused.
🤖 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.

Outside diff comments:
In `@gui/src/hooks/useCodexAccountPool.ts`:
- Around line 272-297: Update pauseExhaustedAccounts in
gui/src/hooks/useCodexAccountPool.ts lines 272-297 so its setAccounts predicate
marks an account paused when pausedIds contains "__main__" and account.isMain,
matching setAccountPaused behavior. Add a regression test in
gui/tests/codex-account-pool-behaviour.test.tsx lines 194-209 using a distinct
real ID for the isMain fixture, returning pausedAccountIds: ["__main__"], and
asserting the main row’s local paused flag changes.

In `@src/codex/auth-api.ts`:
- Around line 751-766: Normalize body.accountId to the effective target account,
using MAIN_CODEX_ACCOUNT_ID when it is null, before calling isCodexAccountPaused
in the PUT /api/codex-auth/active handler. Use that normalized target
consistently for pause validation and resetCodexRoutingForManualSelection, while
preserving the response’s existing accountId value; add a regression test
covering a null accountId when the main account is paused.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: 624e6bba-d379-4b4f-9d0e-06c5b514a7b9

📥 Commits

Reviewing files that changed from the base of the PR and between 36946b9 and c38617a.

📒 Files selected for processing (5)
  • gui/src/hooks/useCodexAccountPool.ts
  • gui/tests/active-account-reauth-aggregate.test.ts
  • gui/tests/codex-account-pool-behaviour.test.tsx
  • src/codex/auth-api.ts
  • tests/codex-auth-api.test.ts

@Alvin0412

Copy link
Copy Markdown
Author

Addressed both outside-diff findings from the latest CodeRabbit review in c1be956: bulk pause now maps the __main__ sentinel to the real main-account row, and PUT /api/codex-auth/active normalizes null to the effective main account before pause validation and routing reset. Added regressions for both paths. Validation: 172 backend/routing tests, 302 GUI tests, TypeScript typecheck, ESLint, privacy scan, and GUI 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: 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 `@gui/tests/codex-account-pool-behaviour.test.tsx`:
- Around line 240-243: Update the gated reload test around releaseReload and the
subsequent act block to assert the reconciled GUI state after the reload
completes. Verify that the main account remains paused and that activeId still
matches the value selected by the management API, covering both state fields
rather than only awaiting the reload.
🪄 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: 75b47cdb-c11a-4cf9-9a85-fa6824f4cdc5

📥 Commits

Reviewing files that changed from the base of the PR and between c38617a and c1be956.

📒 Files selected for processing (4)
  • gui/src/hooks/useCodexAccountPool.ts
  • gui/tests/codex-account-pool-behaviour.test.tsx
  • src/codex/auth-api.ts
  • tests/codex-auth-api.test.ts

Comment thread gui/tests/codex-account-pool-behaviour.test.tsx
@Wibias

Wibias commented Jul 28, 2026

Copy link
Copy Markdown
Collaborator

Please resolve the Conflicts. After that I will review your PR. Thanks.

@Alvin0412

Copy link
Copy Markdown
Author

Thanks — the conflicts are resolved in edf04e6. The PR is mergeable again and the current checks pass. I also added regression coverage for pause behavior with the new quota, round-robin, and fill-first account-pool strategies. Ready for your review.

@Wibias Wibias left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Maintainer review (bug + security)

Verdict: APPROVE

Security

No medium+ issues in the pause/control-plane surface. Pause endpoints sit on the existing /api/codex-auth management auth model; list/bulk responses keep the masked account DTO (no tokens). PUT /active rejects paused accounts (409). Pause is enforced in isCodexAccountSelectable and related failover/affinity/subagent paths.

Bug review / open Codex + CodeRabbit

Item Status
Rabbit: __main__ sentinel UI desync Fixed (Rabbit confirmed)
Rabbit: __main__ / gated-reload test coverage Fixed (Rabbit confirmed)
Codex P2: classify pool exhaustion with fresh plan Fixed (freshPlan from WHAM)
Codex P2: require known main plan before pause Fixed (omit plan_type → fail/skip, not mis-pause)
Codex P2: align next/active after pausing current Fixed (reconcileCodexActiveAfterExclusion)
Codex P2: recheck existence before persisting bulk pauses Fixed (delete/gen race → discard)
Codex P2: report bulk refresh total failure Fixed (502 when nothing checked)
Codex P2: exclude paused from active reauth projection Fixed (!activeAccount?.paused)

Focused regressions exercised here: 15 pass (pause / exhausted filters in codex-auth-api + codex-routing).

Notes (non-blocking)

  • Fork head currently shows only label/CodeRabbit checks — run/wait for full cross-platform CI before merge.
  • Residual edge case: if WHAM omits plan_type for a pool account, classification falls back to stored currentAccount.plan (stricter than inventing a plan). Acceptable given fail-closed when no plan can be established; optional follow-up is stronger plan cache parity with main.
  • Partial bulk refresh (complete: false) still uses the success toast path — UX polish only.

@Wibias

Wibias commented Jul 28, 2026

Copy link
Copy Markdown
Collaborator

Will get merged after interal code work lands on dev.

@Wibias

Wibias commented Jul 29, 2026

Copy link
Copy Markdown
Collaborator

Maintainer takeover: conflicts with current dev (#599 Spark quota scopes) + CI failure in the workspace reauth seam are fixed on a maintainer branch.

Superseding PR: #667

Please continue review / discussion there. This PR will be closed once #667 lands (or close now if preferred).

@Wibias

Wibias commented Jul 29, 2026

Copy link
Copy Markdown
Collaborator

Superseded by maintainer takeover #667 (conflict resolve + CI fix).

@Wibias Wibias closed this Jul 29, 2026
Wibias added a commit to Wibias/opencodex that referenced this pull request Jul 29, 2026
Resolve conflicts between lidge-jun#565 pause work and account namespace foundation on current
dev. Keep both pausedCodexAccountIds and codexAccountNamespaces; align pause id
validation with CODEX_ACCOUNT_ID_RE / isValidCodexAccountId.
Wibias added a commit that referenced this pull request Jul 29, 2026
Maintainer takeover of #565. Persisted pause exclusion, bulk pause-exhausted, GUI controls, docs. Integrated with account namespaces and Spark quota scopes on current dev.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants