Repository navigation
fix: the Claude usage calendar no longer goes blank at startup - #1059
Merged
Merged
Conversation
For a few seconds after every server start the Local token activity calendar was empty until the first Claude status check finished. The pending snapshot seeded from the saved status dropped the calendar on purpose, and the registry then replaced the saved status with it, since the pending sign-in is unknown. The pending snapshot now carries the saved calendar, also when the saved reading has no meter windows and for API-key sign-ins (which read the calendar but have no meters). A verified check whose calendar read came back partial keeps the last calendar. An account folder that shares the main history reads no calendar, so it carries none over. The composer's usage popover no longer shows an empty "Claude usage" heading when the only usage is a token calendar, which it doesn't draw.
|
The latest updates on your projects. Learn more about Vercel for GitHub. 1 Skipped Deployment
|
This branch was previously deployed
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.
For a few seconds after every server start, Claude's "Local token activity" calendar was empty until the first status check finished. The pending snapshot seeded from the saved status dropped the calendar on purpose (
seedClaudeProviderUsage), and the registry then replaced the saved status with it, because the pending sign-in is unknown.The pending snapshot now carries the saved calendar:
carryClaudeAccountUsageForwardkeeps a calendar-only reading)A verified check whose calendar read came back partial keeps the last calendar. An account folder that shares the main history reads no calendar, so it carries none over (
keepsTokenCalendar, set by the driver).The composer's usage popover no longer shows an empty "Claude usage" heading when the only usage is a token calendar, which it doesn't draw. API-key users already hit this before this change.
Tested with a server test of the startup sequence (saved status, then the pending snapshot through the registry merge, then a first check with no calendar), plus the API-key and shared-folder cases, and a popover browser test. Both fail on the old code. Typecheck, lint, the related server tests and the full browser suite pass.