fix(tauri,ui): switch budget to daily mode and increase default#6
Merged
fix(tauri,ui): switch budget to daily mode and increase default#6
Conversation
…efault The budget system was falsely reporting 0 tokens remaining because: 1. The default weekly_token_budget (700K) was far too low — normal manual Claude Code usage (200-300K tokens/day) would exhaust it in 2-3 days. 2. The calculation compared ALL weekly token usage against the weekly budget, so heavy usage early in the week would incorrectly exhaust the budget for remaining days. Switch to daily mode: divide the weekly budget into daily slices and compare only today's usage against the daily budget. Each day starts fresh, so heavy usage on one day no longer poisons the rest of the week. This better reflects how subscription rate limits actually work (rolling windows, not rigid weekly lump sums). - Increase default weekly_token_budget from 700K to 5M (~714K/day), matching typical subscription capacity for dailyModelTokens metric - Change calculate_budget_status to use daily budget (weekly / 7) and compare against tokens_used_today instead of tokens_used_week - Add migration 15 to update existing DB rows from 700K to 5M - Update TS fallback default to match - Update sidebar status card and budget settings UI for daily mode
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
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
weekly_token_budgetfrom 700K to 5M (~714K/day) to match actual subscription capacityTest plan