Repository navigation
feat(codex): add opt-in quota-weighted account scheduling - #7234
yuanyuanlove wants to merge 2 commits into
Conversation
Carry the quota-weighted feature onto dev 7a42860 with per-window observation freshness and safe soft-health recovery fixes. Retain the GUI/CLI/API and focused backend regressions, affected translated guides and one authoritative routing contract; omit duplicate structure cross-links and optional help/recipe copy. Original source: ed31c59. Original validated candidate: f276879c03185eecf2f5a3c29016a701e476c877. Locally validated focused tree: 170487c. Co-authored-by: yuanyuanlove <yuanyuanlove@users.noreply.github.com>
|
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
0/4 boxes ticked. This pull request was already a draft. Its draft status will be preserved after every issue above is resolved. |
Retain both quota-weighted and permanent-refusal documentation. Reflow existing routing prose without changing content to keep the owning structure document within its line budget.
|
Intake at |
|
Thank you for the work here. We're closing this to keep the review queue manageable: the scheduling design is still open in #7206, and the draft currently fails CI. You're welcome to reopen this or open a smaller PR against |
Summary
quota-weightedaccount-pool strategy across configuration, CLI, management API, and the dashboard, with translated labels, affected user guides, one authoritative structure note, and regression coverage. The default strategy remainsquota. Enable it withocx account pool openai --strategy quota-weighted.ed31c59b5261577f7bcb4fbcef79644922d72c90, preserving its attribution, and include two follow-up correctness fixes found during local validation.Actual effect on account rotation
quotaordering, and optional idle-window steering keeps its existing precedence.0disables threshold filtering only. There is no zero-weight fallback that bypasses known exhaustion or a credits-off hold, and paid credits still require the existing explicit opt-in.The intended benefit is better use of relative remaining quota among eligible accounts for new work. The score compares percentages, not absolute plan capacity, and does not increase total quota or guarantee higher throughput.
Follow-up fixes
Retry-Aftercandidate or an already-held probe cannot hide a recoverable sibling. Preview only checks availability; final authentication still enforces cooldowns and owns the probe lease. The threshold, exhaustion, credits, pause, reauthentication, model/plan, main-account, and refresh-backoff fences continue to apply.Verification
Exact locally validated content
7a4286052fe7a4f26c5691ecc380b91262508a6c(devat integration time).devadvanced to4ed45e9516e4421197d7cb0dd95a3d2f316aa0c9, one commit ahead of the integrated base. That CLI carry overlaps only the two test-registration files, at separate hunks; it has not been merged or locally validated with this candidate. Live mergeability and exact-head CI must still be checked.c03eafd46bdae15aba058850e409c0598309e2ed.f276879c03185eecf2f5a3c29016a701e476c877.170487c49c34ed183ac3d17ef2b6ccbdf12fe5de(frozen local source commitb6eab4b444f2bf5e7817ee9d69f1d9c39b2554a1).c21a11f7df6d4cf41b3f29a072df33ba1c3dbf0a.7a4286052dev baseline. A separate SHA-only tree reconstruction also reproduced the final integrated tree exactly. Scope against that integrated baseline: 47 files, +1,060/-75; the two follow-up fixes affect 8 files, +379/-38 against the original candidate.Commands below name the pinned runner as
bun; JUnit output paths are shortened to<phase.xml>.The same explicit, source-audited 13-file command ran on clean integration baseline (
7a4286052) and the final integrated tree. The integration safety review rechecked the sole upstream test import change and its execution owners before running:Result on each side: 477 passed, 0 failed, 0 skipped, with all 477 file/class/test-name/status identities equal and no added failing identity. Earlier comparisons on the previous base, original candidate, and pre-integration feature tree also passed the same 477 cases; those historical runs do not expand the current allowlist scope.
Final-candidate-specific regressions were run separately and are not included in the common baseline count:
Result: 67 passed, 0 failed, 0 skipped. Coverage includes the known-quota dominant tier, equal-score rotation, unknown-quota probing, reset-evidence freshness after partial/credits writes, and soft-health recovery/probe admission ordering.
The focused 47-file tree was rechecked directly after scope reduction. The same 477 identities also match the clean integration baseline exactly. GUI strategy tests passed on this exact final tree: 25 passed, 0 failed.
GUI i18n lint and build passed. Final integrated static checks passed:
A final independent read-only source review reported no remaining concrete quota-weighted integration finding. The separate pre-existing upstream lifecycle limitation is documented below. This does not constitute maintainer security approval.
Earlier evidence, with different scope
Before the two follow-up fixes, original candidate
f276879passed a local nine-file backend set (384 tests),cd gui && bun test --isolate tests/account-pool-strategy.test.tsx(25 tests), andcd gui && bun run build. The same GUI build also passed once on the clean base. These are historical checks of the original candidate/base, not additional final-tree backend or GUI results. No separate root build was performed.Incomplete validation and draft blockers
devadvanced by one further commit during publication preparation. The focused tree based on7a4286052fe7a4f26c5691ecc380b91262508a6cpassed the source-audited 477 common cases, 67 specialized cases, 25 focused GUI cases, typecheck, privacy/structure/surface/file-size checks, GUI i18n lint and GUI build. This remains focused validation, not a full runtime-suite or cross-platform claim.gui/, so the screenshot requirement remains unmet and the enforcement check may remain blocked. Add a real screenshot to the PR description, without committing screenshot evidence to the PR branch.A separate upstream limitation was found by read-only integration review:
account-lifecycle.tsreplaced the broad routing cleanup with leaf cleanup calls but omitted the failure-window cleanup. Native-main identity replacement may therefore retain the previous identity's degraded failure-window state. This already exists in upstream7a4286052and is not introduced by this PR; it is intentionally kept outside this focused change. No live-account reproduction was performed.This PR is intentionally a draft while these gaps remain.
Checklist
Review readiness checklist
This PR stays in draft until every box below is ticked. All four remain unchecked pending validation and review of the final published head.
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.
Co-authored-by: yuanyuanlove yuanyuanlove@users.noreply.github.com