feat(codex): carry account pause controls onto dev2-go (#667) - #669
Conversation
Maintainer takeover of lidge-jun#565. Persisted pause exclusion, bulk pause-exhausted, GUI controls, docs. Integrated with account namespaces and Spark quota scopes on current dev.
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. 🗂️ Base branches to auto review (2)
Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: ASSERTIVE Plan: Pro Plus Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
Comment |
|
Go port tracking: will link once issue opens. Carry includes prerequisite account namespace foundation from dev. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: a0873ba3b6
ℹ️ 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".
| pauseMutationRef.current = { accountId: id }; | ||
| setPauseUpdatingId(id); | ||
| try { | ||
| const response = await fetch(`${apiBase}/api/codex-auth/accounts/pause`, { |
There was a problem hiding this comment.
Port the pause controls before exposing them on dev2-go
On the targeted dev2-go line, this request is handled by the primary Go server, but go/internal/management/api.go registers neither pause endpoint, go/internal/management/codex_auth.go implements neither handler, and the Go routing config has no paused-account eligibility check. Consequently the new dashboard actions fail with a non-success response and even a hand-added pausedCodexAccountIds value would not stop traffic from using that account. Port the management, config, and routing behavior to Go, or retarget this TypeScript-only change to dev.
AGENTS.md reference: AGENTS.md:L86-L89
Useful? React with 👍 / 👎.
| try { body = (await req.json()) as typeof body; } catch { return jsonResponse({ error: "Invalid JSON" }, 400); } | ||
| const runtimeConfig = getRuntimeConfig(config); | ||
| const targetAccountId = body.accountId ?? MAIN_CODEX_ACCOUNT_ID; | ||
| if (body.accountId === MAIN_CODEX_ACCOUNT_ID && hasLegacyMainCodexPoolAccount(runtimeConfig.codexAccounts)) { |
There was a problem hiding this comment.
Apply the legacy-main guard to null selections
When a config contains the quarantined legacy non-main __main__ pool row and a client sends { "accountId": null }, which this endpoint supports as the Desktop/default selection, targetAccountId resolves to __main__ but this check only examines the raw value. The handler therefore returns success and resets routing to an account that isCodexAccountUsable deliberately rejects as ambiguous, so the next request silently falls back or fails instead of returning the intended 409. Check targetAccountId for the legacy collision as well.
Useful? React with 👍 / 👎.
| setActiveId(nextActiveId); | ||
| } | ||
| void load(); | ||
| return { ok: true, pausedCount: result.pausedCount ?? pausedIds.size } as const; |
There was a problem hiding this comment.
Surface partial failures from bulk pause
When at least one quota refresh succeeds and another fails, the endpoint intentionally returns HTTP 200 with complete: false and a positive failedAccountCount; this hook discards both fields and returns ok: true with only the paused count. The caller consequently shows either a full-success toast or “No accounts have confirmed 100% usage,” misleading the operator even though some accounts were never checked. Preserve the completion/failure fields and render a partial-result warning.
AGENTS.md reference: gui/AGENTS.md:L7-L10
Useful? React with 👍 / 👎.
Summary
dev2-go: Codex account pause + bulk pause-exhausted (TS oracle, GUI, docs, tests).c9bed7c5account namespace foundation fromdev(not yet ondev2-go; pause validation depends on it).Go port
Go has Codex pool routing / auth API surface under
go/internal/codex/but nopausedCodexAccountIds, pause/resume endpoints, or pause-aware eligibility.Tracking: #670
Test plan
dev2-goc9bed7c5,f0867e8d)