Conversation
sususu98
reviewed
Aug 31, 2026
sususu98
left a comment
Contributor
There was a problem hiding this comment.
Thanks for implementing support for Codex quota reset hints! The overall design, defensive parsing, and test matrix look very solid.
I'd like to suggest one refinement based on real-world production usage:
Suggestion: Clamp Codex Max Quota Horizon to 30m (Supporting Early Resets & User Upgrades)
In practice, an OpenAI Codex credential often becomes available much earlier than the pessimistic resets_at / resets_in_seconds timestamp returned in 429 errors:
-
Dynamic Capacity & Early Resets: OpenAI frequently uses sliding windows and dynamic capacity refills. The
resets_atfield often reflects a pessimistic upper bound (e.g. 5 hours, 3 days), but usable capacity is frequently restored much sooner. -
User-Initiated Actions (Crucial): When a limit is hit, users frequently go to their OpenAI/ChatGPT dashboard to purchase extra credits, update payment methods, or upgrade subscriptions (e.g. Plus
$\to$ Pro/Team). Once completed, the upstream credential is functional immediately.
The Problem:
If Home strictly locks the credential for the full 72 hours, newly topped-up or early-reset credentials will sit idle for days without manual admin intervention in Home UI.
💡 Proposed Solution: Clamp Horizon to now + 30m
- Introduce a provider-scoped
Max Quota Horizondefaulting to30 * time.Minuteforcodex(aligning with the existingquotaBackoffMaxceiling). - When
resets_atorresets_in_secondsexceeds the horizon, clamp the deadline tonow + 30minstead of locking for multi-day periods:- Short hints (e.g. 5m, 10m): Respect the exact hint.
- Long hints (e.g. 72h): Sleep for at most 30 minutes, allowing Home to automatically discover and recover when upstream resets early or when the user upgrades/adds credits. If upstream is still exhausted after 30m, the next 429 will simply clamp into another 30m cycle.
This achieves the optimal balance: precise backoff for short windows, and automatic recovery for early resets and user top-ups.
- Clamp OpenAI Codex quota reset hints exceeding 30 minutes to now + 30m (matching quotaBackoffMax) while respecting exact hints <= 30m - Retain the 60-day maximum horizon for Antigravity and other providers - Ensure provider horizon is derived from the authoritative auth provider in MarkResult and StateMutator - Keep exponential backoff ladder as the minimum cooldown floor and never shorten open windows - Update English and Chinese Management API documentation - Add comprehensive unit and cluster test coverage for clamping, precedence, and provider mismatches
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Introduce support for Codex quota reset hints, enhancing the handling of execution cooldowns and retry logic based on provider-specific reset information. This update improves the system's responsiveness to quota limits and ensures accurate backoff behavior during quota exceedances.