Repository navigation
fix(quota): surface Bailian 5h/weekly/monthly windows via quota.windows (#4594) - #4680
Closed
diegosouzapw wants to merge 1 commit into
Closed
diegosouzapw wants to merge 1 commit into
diegosouzapw wants to merge 1 commit into
Conversation
…ws + registerQuotaWindows (#4594)
Contributor
|
Warning You have reached your daily quota limit. Please wait up to 24 hours and I will start processing your requests again! |
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
Collaborator
Author
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.
Closes #4594
Problem
The Bailian quota fetcher computed per-window percentages (5h / weekly / monthly) internally and returned them as
window5h/windowWeekly/windowMonthly, but it never:quota.windowsmap (the contractquotaPreflightchecks for per-window cutoffs), norregisterQuotaWindows(the registry the dashboard uses to discover a provider's window names).So operators could not enforce separate 5h/weekly/monthly cutoffs through the same preflight path other providers use — routing fell back to a single worst-percent signal, under-modeling a near-exhausted shorter window.
Fix (mirrors codex/opencode)
parseBailianQuotaResponsenow also returns awindowsmap keyed by5h/weekly/monthly(legacy fields preserved forquotaMonitor/ cooldown consumers).registerBailianCodingPlanQuotaFetchernow callsregisterQuotaWindows("bailian-coding-plan", ["5h","weekly","monthly"]).parseBailianQuotaResponse+BAILIAN_QUOTA_WINDOWSfor the regression test.Validation (Hard Rule #18 — TDD)
tests/unit/bailian-quota-windows-4594.test.ts— 3 cases (RED before the change → GREEN):windowsmap keyed by the 3 windows, values mirroring the legacy fieldswindow5h/windowWeekly/windowMonthly+ worst-casepercentUsedpreservedgetQuotaWindows("bailian-coding-plan")returns the registered windows after registrationExisting
bailian-quota-fetcher.test.ts(14) still green.typecheck:coreclean, ESLint 0 errors.