Skip to content

Fix OpenAI quota window classification#11

Merged
thibautrey merged 1 commit into
thibautrey:mainfrom
JeremyMahieu:agent/fix-openai-quota-window-classification
Jul 20, 2026
Merged

Fix OpenAI quota window classification#11
thibautrey merged 1 commit into
thibautrey:mainfrom
JeremyMahieu:agent/fix-openai-quota-window-classification

Conversation

@JeremyMahieu

@JeremyMahieu JeremyMahieu commented Jul 13, 2026

Copy link
Copy Markdown
Contributor

OpenAI has suspended 5h window quotas, this causes the UI to misbehave by displaying the weekly quota in the 5h columns because this is now the "primary" one.

https://www.reddit.com/r/OpenAI/comments/1uuqhmk/if_you_noticed_that_in_codex_you_no_longer_a_see/

image

What changed

  • Preserve the upstream rate-limit window duration when parsing usage.
  • Classify five-hour and weekly quota windows by their actual duration instead of by the unstable primary_window and secondary_window positions.
  • Keep positional fallback behavior for payloads that do not report a duration.

Why

OpenAI currently returns the seven-day quota as primary_window when the temporary five-hour limit is absent, with secondary_window set to null. The proxy previously assumed that primary_window always meant five hours and consequently displayed the weekly percentage in the five-hour column.

Classifying by limit_window_seconds correctly displays the weekly quota today and will automatically recognize the five-hour window if OpenAI restores it later.

Impact

Quota percentages and reset times are assigned to the correct normalized five-hour or weekly window. Routing continues to consume the same normalized fields.

Validation

  • docker compose build multivibe
  • git diff --check

@JeremyMahieu
JeremyMahieu marked this pull request as ready for review July 13, 2026 10:18
@thibautrey
thibautrey merged commit 2ebea22 into thibautrey:main Jul 20, 2026
@JeremyMahieu
JeremyMahieu deleted the agent/fix-openai-quota-window-classification branch July 23, 2026 06:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants