feat: hold last snapshot + skip empty rate_limits pushes#7
Merged
Conversation
Drop the stale watchdog: the board now keeps showing the last received reading until a new snapshot arrives, instead of greying to '--' after 60s with no data. Matches the desired 'persist, refresh only when new data comes' behavior. On boot it still shows '--' placeholders until the first snapshot.
Claude Code sometimes emits a status-line payload without rate_limits (all-zero fields) -> we were pushing an all-zero snapshot, which the board (hold mode) then kept (5H 0% / RESET 00:00:00 / SESSION $0.00). Gate the push on HasRateLimits (resets_at>0), so empty payloads are skipped and the board keeps its last real reading. A legit 0% at window start still has resets_at>0 and pushes normally.
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.
Two paired changes so the board shows the last real reading and never blanks/zeros on its own.
Firmware: hold last snapshot
Drop the 60s stale watchdog — the board keeps the last received reading until a new snapshot arrives (instead of greying to
--). On boot it still shows--until the first snapshot.Host: skip pushes with no rate_limits
Claude Code sometimes emits a status-line payload without
rate_limits(all-zero fields). We were pushing an all-zero snapshot, which the board (now in hold mode) kept — showing 5H 0% / RESET 00:00:00 / SESSION $0.00. Now the push is gated onHasRateLimits()(resets_at>0), so empty payloads are skipped and the board keeps its last real value. A legitimate 0% at the start of a window still has resets_at>0 and pushes normally.Both verified;
go vet/go testpass (new tests for HasRateLimits + skip-on-empty). 1.47B running the firmware side; host reinstalled locally.