Repository navigation
feat(codex): opt in to using remaining included quota - #6629
Yuxin-Qiao wants to merge 1 commit into
Conversation
|
Important Draft PR not reviewedDraft PRs are not automatically reviewed by default.
To automatically review draft PRs, update your CodeRabbit configuration: reviews:
auto_review:
drafts: true
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
⏳ DRAFT
What to do
Review readiness checklist
1/4 boxes ticked. This pull request was already a draft. Its draft status will be preserved after every issue above is resolved. |
|
Thanks @Yuxin-Qiao! Your remaining-included-quota preference is carried onto current dev with attribution and updated guard coverage in #7158, so I’m closing this stale branch in favor of that draft. |
* feat(codex): opt in to remaining included quota (carry #6629) Port #6629 from 2a7add5 onto current dev, retaining account policy and native refresh changes. Add opt-in coverage for entitlement, round-robin, automatic pause, reauthentication, and paid-credit refusal. Co-authored-by: Yuxin Qiao <104957188+Yuxin-Qiao@users.noreply.github.com> * docs(structure): place use-remaining CLI note in the account-policy section --------- Co-authored-by: GOAT <goat@localhost> Co-authored-by: Yuxin Qiao <104957188+Yuxin-Qiao@users.noreply.github.com>
Summary
An explicitly selected Codex account can still be switched away or refused at a proactive quota threshold while included quota remains. Turning off auto-switch alone does not remove the main-account hard lock. This adds a persistent, default-off preference for using an individual account's remaining included quota.
ocx account use-remaining openai <id|alias|main> <on|off|status> [--json]and authenticated GET/PUT/api/codex-auth/accounts/use-remainingroutes.Example after enabling the preference:
This control is exposed through the CLI and API. Explicit maintainer security review is pending for the account policy and management authentication boundary.
Verification
Validated locally against head
2a7add53ca, based ondevat0511f458f1:bun run typecheck— passed.bun test tests/codex-integration/codex-use-remaining-quota.test.ts tests/cli/cli-account-policy.test.ts tests/ci-workflows/file-size-ratchet.test.ts— 114 passed, 0 failed. Includes 95%/99.9% admission, 100% refusal, pause/429 cooldown, persistence, rollback, management credential checks, malformed configuration, and restoration of saved thresholds.bun test tests/server/management-route-registry.test.ts tests/cli/cli-capability-account-workflows.test.ts— 38 passed, 0 failed.bun run privacy:scan,bun run structure:check,bun run skill:surface:check, andgit diff --check— passed.cd docs-site && bun install --frozen-lockfile && bun run build— passed, including internal-link validation.bun run test— not passed: the parallel lane was terminated by the repository's 900-second watchdog (exit 124), with failures before termination and incomplete full-suite coverage. On an unchanged0511f458f1baseline, the Anthropic Fast management test also fails (7 passed/1 failed), and provider management validation has 118 passed/19 failed. These reproduce specific baseline failures; other full-run failures and timeouts have not all been independently classified.Regression evidence uses isolated fixtures. No real-account quota consumption or production runtime activation was performed. No remote CI result or approval is claimed.
Checklist
Review readiness
Required local validation passed; commands, results, and any full-suite exception are documented.
I pushed my PR to a recent dev commit (at most 10 behind; a maintainer may still ask for the exact tip before merge).
I resolved all correct Codex and CodeRabbit findings.
My PR is ready for review.