Skip to content

Clarify manual pool pin versus caller-main fallback and consider pool-only policy #7410

Closed

Description

@lidge-jun

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

  1. added
    enhancement
    on Oct 19, 2026
  2. github-actions commented on Oct 19, 2026

    @github-actions
    Contributor

    Automated translation bookkeeping — detected language: English.

  3. added
    account-pool
    on Oct 19, 2026
  4. Ingwannu commented on Oct 20, 2026

    @Ingwannu
    Owner

    Checked against trusted dev 12025981e5a304cdb6b1b54f525ba8554f623977. The distinction remains intentional: activeCodexAccountPinned is a preference, while an exact account binding refuses rather than selecting caller-main. tests/codex-integration/codex-pool-caller-fallback-policy.test.ts records 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.

  5. lidge-jun commented on Oct 28, 2026

    @lidge-jun
    OwnerAuthor

    At dev fdc6dd82d930295880dcf6d10bbb9f2c61994574, 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 at src/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:

    • Disable only caller-credential fallback. This is narrow and leaves stored-account rotation intact, but stored __main__ can still participate. It cannot honestly promise that native-main quota is never used.
    • Add an opt-in alternate-pool-only policy for automatic Pool resolution: only registered, eligible non-__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.ts and settings management, then share its candidate decision across src/codex/account-usability.ts, src/codex/auth-context.ts and routing previews. Guarding just the two fallback returns misses the ordered-main and preserved-main paths. A new tests/codex-integration/codex-pool-only-policy.test.ts should 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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    account-poolenhancement

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions