Skip to content

feat: hold last snapshot + skip empty rate_limits pushes#7

Merged
yuchou87 merged 2 commits into
mainfrom
feat/hold-last-value
Jun 21, 2026
Merged

feat: hold last snapshot + skip empty rate_limits pushes#7
yuchou87 merged 2 commits into
mainfrom
feat/hold-last-value

Conversation

@yuchou87

Copy link
Copy Markdown
Owner

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 on HasRateLimits() (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 test pass (new tests for HasRateLimits + skip-on-empty). 1.47B running the firmware side; host reinstalled locally.

yuchou87 added 2 commits June 21, 2026 10:13
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.
@yuchou87 yuchou87 merged commit 34227eb into main Jun 21, 2026
6 checks passed
@yuchou87 yuchou87 deleted the feat/hold-last-value branch June 21, 2026 02:36
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