Skip to content

feat(codex): add exact account routing - #671

Draft
chrisae9 wants to merge 1 commit into
lidge-jun:devfrom
chrisae9:split/426-02-exact-account-routing
Draft

feat(codex): add exact account routing#671
chrisae9 wants to merge 1 commit into
lidge-jun:devfrom
chrisae9:split/426-02-exact-account-routing

Conversation

@chrisae9

Copy link
Copy Markdown
Contributor

Part of #425. This is the second layer split out of #426 after the maintainer review; the namespace foundation is already on dev as c9bed7c5a.

What this adds

An account-qualified native model now routes to the one stored Codex account mapped by its namespace. For example, side/gpt-5.6-sol uses the side binding and sends gpt-5.6-sol on the wire through the canonical openai provider.

  • Exact selection works even when the OpenAI provider is globally in Direct mode.
  • Bare gpt-* models keep their existing Direct or Pool behavior.
  • Missing, unusable, paused, cooling-down, or reauthentication-required accounts fail closed.
  • Exact requests do not run Pool balancing, quota priming/probes, affinity rebinding, active-account promotion, alternate-account retry, or subagent fallback.
  • Physical account health is still recorded, but an exact request cannot rotate or otherwise mutate Pool selection.
  • Same-credential transient transport retry remains available.
  • Logs and client-facing cooldown errors use the public namespace, never the stored account ID.

The binding is carried through Responses HTTP/SSE, compact, WebSocket response.create, and the translated chat/Claude paths that use the shared Responses core. Standalone endpoints that do not receive the qualified model selector (Images, Search, and Live) retain normal provider routing.

The latest dev pause controls are respected: pausing an account blocks new exact selections without invalidating an already-started request.

Not in this PR

Catalog generation/model-picker rows, account lifecycle and settings UI, documentation/localization, and account-qualified fallback-chain candidates remain separate follow-up layers. Keeping those out is intentional so this review stays focused on the credential-routing boundary.

Security review

This changes credential-to-model routing and therefore needs the explicit maintainer security review required by MAINTAINERS.md.

The main invariants are covered by regressions for Direct override, exact main and added accounts, missing/paused/cooled accounts, 400/402/429 handling, HTTP/SSE, compact, WebSocket, public-only logging, quota probes, Pool state preservation, and spawned-child fallback behavior.

Validation

  • bun run prepush
  • Typecheck passed
  • GUI lint passed
  • 5,897 tests passed, 1 platform-specific test skipped, 0 failed
  • Privacy scan passed
  • React Doctor skipped because this PR does not change gui/

Per the current integration policy, this TypeScript routing change will also need its dev2-go counterpart (or a recorded no-counterpart decision) after it lands on dev.

@coderabbitai

coderabbitai Bot commented Jul 29, 2026

Copy link
Copy Markdown

Important

Review skipped

Draft detected.

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: b0209138-98ad-4543-b353-48afcba0235d

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

1 participant