Repository navigation
feat(codex): opt in to remaining included quota (carry #6629) - #7158
Conversation
|
Note Currently processing new changes in this PR. This may take a few minutes, please wait... ⚙️ Run configuration
📒 Files selected for processing: 2
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info
📝 Walkthrough
Merge Risk: ⚪ Minimal · up to
|
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
✅ Deterministic PR hygiene checks passed. |
Keep #7146's hard-lock fallback resolver beside this carry's remaining-quota threshold override; PolicyConfig covers both settings. Co-authored-by: Yuxin-Qiao <104957188+Yuxin-Qiao@users.noreply.github.com>
# Conflicts: # scripts/test-layout/layout.json
|
Maintainer integration into
|
Summary
Carry #6629 by @Yuxin-Qiao from source head
2a7add53cabd24e26be203e1472daef37a7f2790ontodevat7640a942b35044c974e534b84d5a8049f4a8ae9a.codexUseRemainingQuotaAccountIdspreference throughocx account use-remaining openai <id|alias|main> <on|off|status>and authenticated GET/PUT/api/codex-auth/accounts/use-remaining.Closes #6629.
Co-authored-by: Yuxin Qiao 104957188+Yuxin-Qiao@users.noreply.github.com
Verification
Every test/check used fresh isolated
OPENCODEX_HOME=$(mktemp -d) CODEX_HOME=$(mktemp -d). Tests also usedOCX_TEST_NO_QUEUE=1for the explicitly concurrent lanes, while keeping one test worker.bun scripts/test.ts --parallel=1 tests/codex-integration/codex-use-remaining-quota.test.ts tests/cli/cli-account-policy.test.ts tests/codex-integration/main-account-hard-lock-auth.test.ts— 159 passed, 0 failed before the additional guard cases.bun scripts/test.ts --parallel=1 tests/codex-integration/codex-use-remaining-quota.test.ts tests/codex-integration/main-account-hard-lock-auth.test.ts— final auth coverage: 72 passed, 0 failed.bun scripts/test.ts --parallel=1 tests/codex-integration/codex-account-threshold-routing.test.ts tests/codex-integration/codex-account-threshold-api.test.ts tests/codex-integration/codex-account-threshold-auth.test.ts tests/codex-integration/main-account-hard-lock-thresholds.test.ts tests/codex-integration/codex-credits-after-limit.test.ts tests/codex-integration/codex-credits-after-limit-main.test.ts tests/codex-integration/low-quota-protection.test.ts tests/codex-integration/codex-model-entitlement-admission.test.ts— 142 passed, 0 failed.bun scripts/test.ts --parallel=1 tests/ci-workflows/file-size-ratchet.test.ts tests/test-layout.test.ts tests/test-layout-tooling.test.ts tests/ci-workflows/skill-ocx.test.ts tests/lab/core-lab-boundary.test.ts tests/server/management-route-registry.test.ts tests/cli/cli-capability-account-workflows.test.ts— 115 passed, 0 failed.bun run typecheck— passed after final test additions.bun run skill:surface— regenerated successfully; the skill synchronization tests above passed.bun run privacy:scan— passed.bun run structure:check— passed after folding the added API note into the existing paragraph to honor the 600-line cap (initially failed at 602 lines).git diff --cached --check— passed.cd docs-site && bun install --frozen-lockfile && bun run build— passed; 577 pages and 81,204 internal links checked.Full-suite and local cross-platform runs were omitted because approximately 20 concurrent lanes share this machine. Focused quota, account-policy, auth, routing, credit, layout and boundary coverage ran serially; broader suite/platform coverage is left to the dispatched
ci.ymlrun. No real-account quota consumption was performed. No passing remote CI or maintainer approval is claimed.Independent security review, round 1 (head
307c2b47d63b41891c2cc548cf1525838cdcffb6). Every threshold-0 short-circuit (hasCodexQuotaHeadroom, the request-owned main pin, active rotation, priority failback, subagent fallback) still runs pause, cooldown, entitlement, reauthentication and the credit-consent hold (CodexPoolAccountCreditsOffError/CodexMainAccountCreditsOffError) independently. The preference therefore cannot spend paid credits, and the main lock at 100% still refuses at the limit. The new GET/PUT pass through the centralrequireManagementAuthgate for/api/*. The PUT has no await between reading and saving the runtime config, rolls back the live list when a save fails, and account deletion's whole-config rollback covers the key. The one fix pushed in this round moves the CLI note instructure/cli-management.mdout of the document header and into its account-policy section.OCX_TEST_NO_QUEUE=1 bun run test:changed(merge base7640a942b): 38005 pass / 107 skip / 21 fail / 4 errors. The failing files were rerun serially on this head and on cleanorigin/dev7640a942b(cli-access-audio-live,sibling-home-client-sync,native-codex-toggle,native-grok-toggle,service-ownership-state,service-sqlite-home,service,server-auth). Both heads gave 481 pass / 5 fail, with the same five audio-live and sibling-home failures. The other parallel-run failures did not reproduce serially, so there is no regression.bun scripts/test.ts --parallel=1overstructure-ssot,file-size-ratchet,test-layout,test-layout-tooling,core-lab-boundary,repo-hygiene,skill-ocx,codex-use-remaining-quota,cli-account-policy,main-account-hard-lock-authandmanagement-route-registry: 327 pass, 0 fail.bun run typecheck,bun run privacy:scan,bun run skill:surface:check,bun run structure:checkandgit diff --checkall passed.Cross-platform CI dispatched on exact head
307c2b47d63b41891c2cc548cf1525838cdcffb6: https://github.com/lidge-jun/opencodex/actions/runs/38716156883 (queued at handoff; the superseded run for4a700abe0was cancelled).Checklist
Summary by CodeRabbit
New Features
ocx account use-remaining openai <account> status|on|off.Documentation