fix(models): label codex weekly usage windows correctly#31938
Merged
steipete merged 1 commit intoopenclaw:mainfrom Mar 2, 2026
Merged
fix(models): label codex weekly usage windows correctly#31938steipete merged 1 commit intoopenclaw:mainfrom
steipete merged 1 commit intoopenclaw:mainfrom
Conversation
Contributor
Greptile SummaryFixes incorrect labeling of codex secondary usage windows by using reset timestamp cadence as a fallback when API reports ambiguous 24-hour durations. The change extracts window label resolution into a dedicated function that checks if the gap between secondary and primary window reset times exceeds 3 days, correctly identifying weekly windows even when Key improvements:
Confidence Score: 5/5
Last reviewed commit: 181b888 |
steipete
added a commit
that referenced
this pull request
Mar 2, 2026
Contributor
|
Landed via temp rebase onto main.
Thanks @bmendonca3! |
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.
Summary
Describe the problem and fix in 2–5 bullets:
limit_window_seconds, which can report86400even when reset cadence is clearly weekly.openclaw models statuscan displayDay ...while showing multi-day reset countdowns, which misrepresents codex quota scope.Change Type (select all)
Scope (select all touched areas)
Linked Issue/PR
User-visible / Behavior Changes
openclaw models statusnow labels codex secondary usage asWeekwhen reset cadence indicates a weekly budget, even if API window seconds report 24h.Security Impact (required)
No)No)No)No)No)Yes, explain risk + mitigation:Repro + Verification
Environment
Steps
primary_window.reset_at = Tsecondary_window.limit_window_seconds = 86400secondary_window.reset_at = T + 5 daysmodels statuspipeline.Expected
Week(cadence is clearly weekly).Actual
Daywheneverlimit_window_secondsmapped to 24h.Evidence
Attach at least one:
Before:
pnpm vitest src/infra/provider-usage.fetch.codex.test.ts -t "reset cadence"Weeklabel, receivedDay.After:
pnpm vitest src/infra/provider-usage.fetch.codex.test.tspnpm vitest src/infra/provider-usage.test.ts src/infra/provider-usage.format.test.ts src/commands/models/list.status.test.tspnpm checkHuman Verification (required)
What you personally verified (not just CI), and how:
Week.86400secondary window with weekly reset cadence now maps toWeek.Day.Compatibility / Migration
Yes)No)No)Failure Recovery (if this breaks)
Weeklabeling where reset cadence is not actually long-lived.Risks and Mitigations
List only real risks for this PR. Add/remove entries as needed. If none, write
None.Weekif reset timestamps are malformed.