Skip to content

feat(codex): carry account pause controls onto dev2-go (#667) - #669

Merged
Wibias merged 2 commits into
lidge-jun:dev2-gofrom
Wibias:maintainer-carry/667-codex-account-pause
Jul 29, 2026
Merged

feat(codex): carry account pause controls onto dev2-go (#667)#669
Wibias merged 2 commits into
lidge-jun:dev2-gofrom
Wibias:maintainer-carry/667-codex-account-pause

Conversation

@Wibias

@Wibias Wibias commented Jul 29, 2026

Copy link
Copy Markdown
Collaborator

Summary

Go port

Go has Codex pool routing / auth API surface under go/internal/codex/ but no pausedCodexAccountIds, pause/resume endpoints, or pause-aware eligibility.

Tracking: #670

Test plan

  • CI green on dev2-go
  • Cherry-picks applied cleanly (c9bed7c5, f0867e8d)

chrisae9 and others added 2 commits July 29, 2026 08:04
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.
@coderabbitai

coderabbitai Bot commented Jul 29, 2026

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

🗂️ Base branches to auto review (2)
  • ^dev$
  • ^preview$

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: 7a541213-d74e-4180-b51c-c5799ef4ea33

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review

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

@github-actions github-actions Bot added the enhancement New feature or request label Jul 29, 2026
@Wibias

Wibias commented Jul 29, 2026

Copy link
Copy Markdown
Collaborator Author

Go port tracking: will link once issue opens. Carry includes prerequisite account namespace foundation from dev.

@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: 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`, {

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Badge 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 👍 / 👎.

Comment thread src/codex/auth-api.ts
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)) {

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge 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;

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge 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 👍 / 👎.

@Wibias
Wibias merged commit ab5b04a into lidge-jun:dev2-go Jul 29, 2026
9 of 12 checks passed
@Wibias
Wibias deleted the maintainer-carry/667-codex-account-pause branch July 30, 2026 19:05
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.

2 participants