Repository navigation
Description
Area
Authentication and account pool
What are you trying to accomplish?
Make it clear whether selecting/pinning another Codex pool account guarantees that native-main quota will not be used.
What prevents this today?
A manual pool pin is a routing preference/tier ceiling (src/codex/account-priority.ts:71), not an exact binding. src/codex/auth-context.ts intentionally permits validated caller-main fallback when the stored pool has no candidate or is cooling down without a probe. Existing documentation describes fallback but does not distinguish the dashboard preference from an exact account selector prominently. This can look like #7398 even after duplicate registration is fixed.
What should OpenCodex do?
Consider an explicit pool-only/no-caller-fallback preference or clear dashboard wording before changing this established policy. Keep exact-account selectors fail-closed and preserve observed-main pause checks. This proposal does not authorize a routing-policy redesign in #7398.
Example usage or interface
Synthetic regression on branch fix/7398-account-pool-usage: pin pool-a, carry a distinct fake caller main bearer, then exclude pool-a or put it in quota cooldown. The resolved context is {kind: "main", accountId: null} while the stored selection remains pool-a. An exact accountId=pool-a binding refuses; a caller matching observed paused main also refuses. Four focused policy tests pass.
Alternatives or workarounds
Use an account-qualified model for an exact binding. Pause the observed native main for pool routing. The #7398 fix adds documentation and bounded fallback visibility; a new product-level policy remains outside that fix.
Additional context
Related #7398 and #7399; implementation branch fix/7398-account-pool-usage. No real credentials or network inference used. Test: bun test tests/codex-integration/codex-pool-caller-fallback-policy.test.ts (4 pass, 0 fail).
Checks
- I searched existing issues and documentation.
- This request describes a concrete OpenCodex workflow rather than merely naming a desired technology.
- I removed secrets and personal data.
Implementation and evidence ledger: #7414
Activity
github-actions commentedon Oct 19, 2026
Automated translation bookkeeping — detected language: English.
Ingwannu commentedon Oct 20, 2026
Checked against trusted dev
12025981e5a304cdb6b1b54f525ba8554f623977. The distinction remains intentional:activeCodexAccountPinnedis a preference, while an exact account binding refuses rather than selecting caller-main.tests/codex-integration/codex-pool-caller-fallback-policy.test.tsrecords exclusion/cooldown fallback, exact-binding refusal and observed-main pause refusal. Keep this as a product/design decision for an explicit pool-only policy; do not silently turn a preference into a binding as part of the duplicate-account repair.lidge-jun commentedon Oct 28, 2026
At
devfdc6dd82d930295880dcf6d10bbb9f2c61994574, a manual pin remains a preference/tier ceiling (src/codex/account-priority.ts:71). Caller-main fallback is explicit for no stored candidate (src/codex/auth-context.ts:1500) and cooldown without a probe (src/codex/auth-context.ts:1669). Main can also be selected directly by Pool ordering (src/codex/auth-context.ts:1484). Exact bindings refuse cooldown atsrc/codex/auth-context.ts:1658. This matches Ingwannu's decision and the policy preserved by merged #7414; changing the pin itself would be incorrect.There are two materially different new policies:
__main__can still participate. It cannot honestly promise that native-main quota is never used.__main__accounts may serve. It excludes caller-main fallback and main selected through ordering/preservation. This is the stronger protection, with explicit refusal when the allowed pool is exhausted.I recommend the second contract, off by default. A pin remains a preference among allowed accounts. Explicit Direct or main-qualified requests are separate operator choices and should be clearly identified as outside automatic Pool policy. Paused, duplicate-main, entitlement and cooldown checks continue to apply; this policy must not make an otherwise ineligible account usable. Existing configurations retain their behavior without migration.
The smallest coherent implementation would add the validated policy to
src/types/config.ts,src/config/schema/config-schema.tsand settings management, then share its candidate decision acrosssrc/codex/account-usability.ts,src/codex/auth-context.tsand routing previews. Guarding just the two fallback returns misses the ordered-main and preserved-main paths. A newtests/codex-integration/codex-pool-only-policy.test.tsshould cover those paths, pin exclusion, all-cooled refusal, an eligible alternate, paused main, exact bindings and explicit Direct. Retain the four existing caller-fallback policy cases unchanged as default-mode controls; add preview/resolution agreement tests and layout registrations.The remaining product decision is the policy's precise promise: caller-only exclusion or exclusion of main from automatic Pool routing. The implementation slice above is safe only after accepting the stronger scope and documenting its explicit-route exception. No runtime validation is claimed here.
feat(codex): opt-in pool-only policy keeps automatic Pool routing off…