Skip to content

Spark quota disappears after partial response-header updates #4007

Description

@cb8010d6

This was generated by AI during triage.

Client or integration

OpenCodex dashboard

Area

Authentication and account pool

Summary

With Spark quota display enabled, refreshing a Codex account shows its Spark weekly quota, but a subsequent ordinary response-header quota update removes that window from the stored account quota. The header response does not carry model-specific WHAM windows; omission should not clear the last known Spark reading.

Reproduction

  1. Enable Spark quota display and refresh an eligible account's quota.
  2. parseUsageQuota reads additional_rate_limits for GPT-5.3-Codex-Spark and setAccountQuotaFromParsed stores its customWindows entry.
  3. Apply an ordinary response containing x-codex-primary-used-percent: 21 and x-codex-primary-window-minutes: 10080 through applyAccountQuotaFromUpstreamHeaders.
  4. getAccountQuota(...).customWindows becomes undefined, although the new response said nothing about Spark.

A deterministic regression test on current dev reproduces this transition without credentials or upstream requests. mergeAccountQuota rebuilds the snapshot and only copies custom windows from the incoming update, unlike other retained partial fields. Expected: retain omitted custom windows; continue replacing them when explicitly supplied, including an empty list, and clear them when the account cache is cleared.

Version

2.48.0; reproduced on dev commit 74f62f9

Operating system

Windows; deterministic Bun regression test

Provider and model

Native Codex account / GPT-5.3-Codex-Spark quota display

Logs or error output

Expected: [{ label: "GPT-5.3-Codex-Spark Weekly", percent: 30, resetAt: 2000000000 }]
Received: undefined

Screenshots and supporting files

The minimal reproduction uses synthetic quota readings and exercises the WHAM parser, quota store, and response-header writer. No account data or screenshots are required.

Redacted configuration

{ "showCodexSparkQuota": true }

Checks

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

Activity

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-poolOAuth, credentials, Codex pool, quota, failover, plansbugSomething isn't workinglanded-via-maintainerOriginal PR closed after landing via a maintainer merge train

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions