mirror of
https://github.com/diegosouzapw/OmniRoute.git
synced 2026-08-04 22:32:12 +03:00
Two accuracy problems in buildCodexUsageQuotas (open-sse/services/codexUsageQuotas.ts): 1. ChatGPT Codex's /wham/usage advertises a latent per-feature ceiling for the spark feature (metered_feature codex_bengalfox) to accounts by default. A never-used bucket is unanchored (used_percent 0, reset_after_seconds == limit_window_seconds), so it recomputes its reset as now + full_window on every fetch and was rendered as a permanent GPT-5.3-Codex-Spark row at 100% for a model the operator never used. Skip latent windows (isLatentWindow); they reappear once the feature is actually used. The label now comes from the payload's own limit_name, falling back to the constant. 2. primary_window/secondary_window were labeled session/weekly purely by position, ignoring limit_window_seconds, so a 7-day primary_window showed 'Session'. The session/weekly keys (routing semantics) stay unchanged; only the display label is corrected from the real window duration (windowDurationLabel), so a 7-day window shows 'Weekly'. Fixes #8051.