8000 fix(collector): keep statusline quota flowing past a corrupted line by InfinityPacer · Pull Request #16 · InfinityPacer/meterleaf · GitHub
[go: up one dir, main page]

Skip to content

fix(collector): keep statusline quota flowing past a corrupted line - #16

Merged
InfinityPacer merged 3 commits into
mainfrom
fix/statusline-quota-and-home-gap
Sep 27, 2026
Merged

InfinityPacer merged 3 commits into
mainfrom
fix/statusline-quota-and-home-gap

Conversation

@InfinityPacer
Copy link
Copy Markdown
Owner

Problem

A status-line script that caches Claude Code's rate_limits into a TSV can leave a corrupted line such as fseven_day 0 1791100800 when several sessions write at once. The collector rejected the whole file on any unknown line, so 5h and 7d quota stopped updating while usage kept flowing. The home card then showed a 7d window at 0% sampled right after the weekly reset, and a waiting 5h window. The background sync log only printed 额度 0, so nothing explained why.

Two display issues showed up at the same time. On mobile the account list touched the trend card with no gap. The Fable weekly window disappeared once its snapshot expired, because Claude Code only refreshes that value when its usage panel is opened.

Behavior

  • The status-line reader ignores unreadable or unknown lines one by one and keeps the valid windows. The collect report counts ignored lines.
  • Background sync logs quota source problems once when they start and once when they clear, even when the push itself fails.
  • An expired Fable weekly window stays as a 等待更新 placeholder while the shared weekly window is active, for up to a week after it ended. The account detail hides its old reset time and cost while waiting.
  • The mobile home keeps a 16px gap above the trend card.
  • The collector guide and CHANGELOG describe the skipped lines and the waiting Fable window.

Verification

  • bun test tests: 341 pass, bun run typecheck passes. New tests cover a file with a corrupted line next to valid windows, and the Fable placeholder rules.
  • End to end with an isolated collector home and a copy of the real TSV plus the corrupted line: the first sync logged 状态栏额度: 忽略 1 行无法识别的内容, a repeat logged nothing new, and after removing the line it logged 额度来源已恢复正常.
  • Demo UI at 390px: the gap between .mobile-home and .app-period went from 0 to 16px, and an expired Fable window renders as Fable · 等待更新 · 12:00 已重置.
  • Not checked in a browser: the desktop account detail sheet in the waiting state.

🤖 Generated with Claude Code

InfinityPacer and others added 3 commits September 27, 2026 19:15
A status-line script writing rate-limits.tsv concurrently left a stray
"fseven_day" line that its own per-window replacement never removes.
The collector rejected the whole file on any unknown line, so 5h and 7d
quota stopped updating while usage kept flowing, and the home card showed
a three-hour-old 7d 0% and a waiting 5h window.

- Ignore unreadable or unknown lines individually and keep valid windows;
  count them in the collect report.
- Log quota source problems in the background sync once when they start
  and once when they clear, instead of only in the manual collect output.
- Keep an expired Fable weekly window as a waiting placeholder while the
  shared week is active, for up to a week after it ended. Fable only
  refreshes with Claude Code's usage cache, so it used to vanish.
- Add the missing gap between the mobile account list and the trend card.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…uota

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@InfinityPacer
InfinityPacer merged commit a6915b0 into main Sep 27, 2026
2 checks passed
@InfinityPacer
InfinityPacer deleted the fix/statusline-quota-and-home-gap branch September 27, 2026 15:35
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.

1 participant

0