Skip to content

feat: add optional per-account Smart refresh - #5

Open
ElliotDrel wants to merge 3 commits into
poweruserz:mainfrom
ElliotDrel:feat/smart-refresh
Open

ElliotDrel wants to merge 3 commits into
poweruserz:mainfrom
ElliotDrel:feat/smart-refresh

Conversation

@ElliotDrel

@ElliotDrel ElliotDrel commented Oct 15, 2026 •

Copy link
Copy Markdown

Fixed refresh intervals either leave active usage stale or keep polling idle accounts. This adds an optional Smart choice under Settings → Auto refresh, using the existing preference and keeping the default at 15 minutes.

  • A quota change starts five minutes of one-minute checks. Unchanged successful results then step through 2, 5, 10 and 15 minutes; any further change returns to one minute.
  • Each account has its own schedule, calculated when its result arrives. One timer wakes the next due accounts, and in-flight checks are not repeated. When every account is in flight, the footer shows “Refreshing…” rather than “Paused”.
  • Only raw progress values and limits count as activity. Countdown text, status messages and local history charts do not reset the schedule. Failed/stale results use a separate capped 2/5/10/15-minute backoff; the existing native HTTP rate-limit gate remains in place.
  • Opening the panel refreshes data at least a minute old, without bypassing error backoff. With no other signal, resumed usage can take up to 15 minutes to be detected.
  • Smart polls reuse successful local token-history results for 15 minutes, keyed by account and query options. Manual refreshes and fixed intervals still scan fresh history and replace the cache. Quota requests remain live.
  • No new dependencies, file watchers or burn-rate prediction. Includes all 11 UI translations and regression tests for transitions, independent/slow accounts, failures, cancellation, focus refresh, settings persistence, IPC opt-in and local-history cache behavior.

Validation:

  • Production frontend build and TypeScript check passed.
  • Full frontend/provider suite passed: 74 files, 1,294 tests (node node_modules/vitest/vitest.mjs run --pool=threads --maxWorkers=2). The initial wrapper stalled starting workers; running Vitest directly completed successfully.
  • Windows verification passed the frontend build, cargo test --locked --lib (212 passed, 1 ignored), and cargo build --locked --bins at 9794dc1. Native source is unchanged since that run; the final footer-only correction passed a fresh frontend build and full suite. The fork-only verification workflow is not part of this PR.
  • Screenshots omitted at the requester's direction. This PR starts from upstream main and contains no taskbar-placement changes.

@ElliotDrel
ElliotDrel marked this pull request as ready for review October 15, 2026 20:45
@github-actions github-actions Bot added the docs label Oct 15, 2026
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 15, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-15T20:52:33.838556Z 9a2cda3 Draft marked ready
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant