Skip to content

feat(quota): add fixed-window runway projection - #267

Merged
slkiser merged 1 commit into
mainfrom
maintainer/issue-252-runs-out-current
Sep 9, 2026
Merged

slkiser merged 1 commit into
mainfrom
maintainer/issue-252-runs-out-current

Conversation

@slkiser

@slkiser slkiser commented Sep 9, 2026

Copy link
Copy Markdown
Owner

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 50m in full displays and r/o ≈ 1h 50m in 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:

  • OpenAI explicit fixed 5-hour, weekly, and monthly API windows
  • xAI explicit current-period start and end
  • Cursor complete API budget with a configured billing-cycle start
  • Qwen Code fixed UTC-day request quota
  • Configured local UTC-day request and priced-budget percentages

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

  • Current production released OpenCode version tested: 1.18.11
  • Why this version is relevant to the fix: it is the repository's pinned OpenCode plugin version used by the automated plugin and TUI validation.

Validation

  • Independent final review passed exact head 08dd8eadb0d29c48174e3971af2df51277e0ba0e
  • Focused Phase 3 matrix: 596 passed, 1 skipped
  • Exact-head compact regression slice: 30 passed
  • Full suite: 2,307 passed, 1 skipped
  • pnpm run typecheck
  • pnpm run build
  • pnpm verify
  • pnpm run release:check
  • Release-package verification: 656 files
  • Same packed artifact passed Node 22.23.2 and Node 24.12.0 smoke tests
  • Credential-free command, toast, 36-column Sidebar, and compact display bundle
  • git diff --check

Quality Checklist

  • I ran pnpm run typecheck
  • I ran pnpm run build
  • I ran pnpm test
  • This change is focused and avoids unrelated behavior changes
  • I updated or added tests when behavior changed
  • I updated docs when user-facing workflow, command, or config behavior changed
  • For provider changes, I followed Provider Changes, or this does not apply

@slkiser
slkiser merged commit fa9e66b into main Sep 9, 2026
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[feature]: pro-rata view

1 participant