Skip to content

[OpenAI/Codex] Parsed K12 short-window quota is dropped before cache, API, dashboard, and routing #2047

Description

@jojodat

Client or integration

OpenCodex dashboard

Area

Proxy and routing

Summary

OpenCodex 2.24.1 parses the K12 short-window quota correctly, but setAccountQuotaFromParsed discards shortPercent, shortResetAt, and shortWindowSeconds. The refresh JSON therefore exposes the longer window while reporting all short-window fields as missing. computeCodexUsageScore also ignores shortPercent.

Expected: the short-window fields must survive parse → cache → API/dashboard and contribute to routing. This matches the P1 review findings in PR #1863, so the merged fix remains end-to-end incomplete.

Reproduction

  1. Authenticate a K12 account and fetch its quota payload.
  2. Confirm the raw payload contains a primary 18000s window at 0% used and a secondary 604800s window at 1% used.
  3. Refresh account usage through OpenCodex 2.24.1.
  4. Observe weeklyPercent = 1, but shortPercent = null, shortWindowSeconds = null, and no short-window reset.
  5. Inspect the code path: parseUsageQuota populates shortPercent, shortResetAt, and shortWindowSeconds; setAccountQuotaFromParsed copies only weekly/monthly/reset-credit fields; computeCodexUsageScore considers only weekly/monthly percentages.

Regression coverage should assert the full path:

WHAM payload → parseUsageQuota → account cache → API/dashboard → routing score

It should also distinguish missing short-window data from a genuine 0% value.

Version

2.24.1

Operating system

macOS (version-independent server-side parsing/cache path)

Provider and model

OpenAI/Codex K12 (model-independent quota handling)

Logs or error output

Redacted raw quota:
- primary: window `18000s`, `0%` used
- secondary: window `604800s`, `1%` used

OpenCodex refresh JSON:
- `weeklyPercent = 1`
- `shortPercent = null`
- `shortWindowSeconds = null`
- no short-window reset

No real reset values, account identifiers, or session data are included.

Screenshots and supporting files

Follow-up to #1791 and the P1 review findings in PR #1863. No additional private data should be necessary. If maintainers need a diagnostic build tested, I can offer one anonymized K12 run.

Redacted configuration

No provider-specific secrets or account configuration are required to reproduce the field-loss path.

Checks

  • I searched existing issues and documentation.
  • I removed secrets, tokens, account details, request credentials, and personal data.

Metadata

Metadata

Assignees

No one assigned

    Labels

    account-poolOAuth, credentials, Codex pool, quota, failover, plansbugSomething isn't workingguiDashboard, tray, settings UIproxyHTTP proxy, routing, reverse-proxy / management auth

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions