feat(quota): add fixed-window runway projection - #267
Merged
Merged
Conversation
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
Adds the default-off
quotaProjection: "runway"setting for eligible fixed quota windows.When enabled, human-readable quota displays estimate when remaining quota will run out using average consumption since a provider-confirmed fixed window began. Estimates appear as
Runs out ≈ 1h 50min full displays andr/o ≈ 1h 50min compact displays. The provider's exact reset countdown remains separate.Compact output keeps the most urgent eligible window under width pressure. Long provider or account identities yield space before the urgent window label, percentage, and runway.
Supported evidence
Projection evidence is emitted only where the implementation proves the fixed start, observation time, fixed end/reset, and full-reset behavior:
Exclusions and compatibility
Rolling or irregular windows, label-only guesses, incomplete timing data, balances, status rows, unlimited rows, and unsupported spend-only rows omit the estimate without warning. This excludes OpenAI spend controls and code-review rows without fixed-window evidence, xAI end-only fallback data, Cursor calendar fallback or partial budget data, Qwen RPM, and other rolling windows.
The public JSON export remains version 2 and unchanged. Fixed-window evidence and rendered runway data stay internal. With the setting disabled, existing output remains unchanged.
Documentation was added to the README configuration and provider guides.
Linked Issue
Closes #252
OpenCode Validation
Validation
08dd8eadb0d29c48174e3971af2df51277e0ba0epnpm run typecheckpnpm run buildpnpm verifypnpm run release:checkgit diff --checkQuality Checklist
pnpm run typecheckpnpm run buildpnpm test