Skip to content

feat: highlight expiring Codex resets with local-time countdowns - #28

Merged
errhythm merged 2 commits into
errhythm:mainfrom
GiorgoLazaridis:feat/reset-expiry-warning
Oct 30, 2026
Merged

errhythm merged 2 commits into
errhythm:mainfrom
GiorgoLazaridis:feat/reset-expiry-warning

Conversation

@GiorgoLazaridis

@GiorgoLazaridis GiorgoLazaridis commented Oct 29, 2026 •

Copy link
Copy Markdown
Contributor

Problem

A banked Codex reset can expire while it is easy to miss among quota rows. The existing display gives the earliest expiry little emphasis, omits its absolute local time in the dashboard, and renders a passed expiry as “now”. A reset has been missed this way in normal use.

Change

Make the existing reset display more prominent without introducing a separate notification system:

  • Highlight the earliest expiry during its last 24 hours, with stronger emphasis during the last hour. Use a warning marker as well as color.
  • Show a live countdown plus the absolute local date, time, timezone and UTC offset. The offset distinguishes the repeated local hour at the end of daylight saving time; timezone-less input is shown as unknown rather than guessed.
  • Put urgent resets immediately below an expanded account's identity and first in compact rows. Let urgent rows wrap, so narrow terminals keep the expiry visible. Separate adjacent expanded warnings.
  • Keep a known urgent expiry visible alongside a usage error/sentinel, labelled last known. A passed timestamp says expiry passed; refresh usage to confirm, rather than asserting a card is still available.
  • Reuse one small pure formatter for the dashboard and ccswap codex usage. JSON output keeps its existing structure and values.
  • Refresh the rendered clock locally every 30 seconds, including account cards in the switch screen. This performs no quota request or credential operation.

The contribution is split into two small commits: the formatter and its boundary/timezone tests, then the TUI/CLI integration, rendering regressions and short user documentation. No changelog, new settings or dependencies.

Validation

  • GitHub CI: Linux, Windows and macOS checks passed at bfe88f2.
  • Full Linux suite, Python 3.12: 4,628 passed, 13 skipped.
  • Full Linux suite, Python 3.13: 4,628 passed, 13 skipped.
  • Tests cover exact 24h/1h/expiry boundaries, sub-minute countdowns, malformed/unknown dates, zero/invalid counts, fractional timezone offsets, and the repeated DST hour.
  • Rendering regressions cover dark/light themes, usage sentinels, two inactive accounts inside the actual 40-column dashboard panel, and preserving JSON output.
  • Independent read-only review and follow-up; no account, token or redemption changes. Secret scans and whitespace checks completed before push.

Tests use synthetic accounts and quota; no reset was redeemed. The feature is also being tested locally together with the separate opt-in warmup contribution #27; this PR itself is based directly on v0.43.0 and does not include #27.

Limits

This PR changes dashboard/account-card rendering and codex usage text; list output, menu-bar summaries and redemption prompts retain their existing formatting. Only the earliest available reset expiry is supplied by the existing quota data. A warning reflects the last available reading; it does not prove a card still exists after redemption or a failed refresh. With the app closed there is no dashboard warning or OS notification. The display uses the machine's local timezone and clock. Native Windows/macOS UI testing is not claimed by the Linux results; CI status is reported separately.

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 29, 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 ⚠️ Failed 2026-10-29T21:07:47.973031Z
We couldn’t complete this review. Comment @codex review to try again.
bfe88f2 PR opened
ℹ️ 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.

@errhythm
errhythm merged commit df8ee12 into errhythm:main Oct 30, 2026
3 checks 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