Skip to content

Add guarded limit reset action and bump 0.5.1 - #7

Merged
ssh4net merged 2 commits into
ssh4net:masterfrom
woffko:agent/usage-limit-reset-button
Aug 22, 2026
Merged

Add guarded limit reset action and bump 0.5.1#7
ssh4net merged 2 commits into
ssh4net:masterfrom
woffko:agent/usage-limit-reset-button

Conversation

@woffko

@woffko woffko commented Aug 22, 2026

Copy link
Copy Markdown
Contributor

Summary

Add a guarded RESET action to the Usage LIMITS card and bump CoMon to 0.5.1.

What changed

  • Add a standalone Norton Commander-style RESET button inside the right-center of the Usage LIMITS card.
  • Enable the button only when:
    • the account has at least one available reset credit;
    • at least one displayed limit has reached 0% remaining.
  • Show a confirmation dialog before consuming a reset credit.
  • Call account/rateLimitResetCredit/consume with a unique idempotency key.
  • Process reset requests serially in the existing limits worker.
  • Refresh rate limits and account usage immediately after the reset response.
  • Persist a one-hour cooldown before sending the irreversible request.
  • Show disabled, in-flight, and cooldown states directly on the button.
  • Preserve the cooldown after ambiguous errors to prevent accidental double consumption.
  • Handle all reset outcomes: reset, nothingToReset, noCredit, and alreadyRedeemed.

Safety

The reset RPC is not sent unless the cooldown has first been written successfully to state.json.

A separate bounded channel prevents routine refresh requests from displacing the user action. The backend remains authoritative, and the UI guard uses a small floating-point
tolerance around 0% remaining.

UI

The RESET button is independent of the card border, vertically centered, and aligned to the card's right inner edge.

Its active state uses the same inverse-video treatment as the YES/NO dialog buttons. Disabled, in-flight, and cooldown states remain visually distinct.

Validation

  • 167 tests passed.
  • cargo fmt --check
  • bash scripts/check-ascii.sh
  • Visual verification at 180×45.
  • Release binary built and installed locally as comon 0.5.1.

The existing upstream theme and heatmap Clippy warnings are unchanged by this PR.

@ssh4net
ssh4net merged commit bad90d0 into ssh4net:master Aug 22, 2026
1 check passed
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.

2 participants