Skip to content

Add rate-limit reset redemption - #7

Merged
ognjeeen merged 6 commits into
masterfrom
feature/rate-limit-reset-usage
Aug 31, 2026
Merged

Add rate-limit reset redemption#7
ognjeeen merged 6 commits into
masterfrom
feature/rate-limit-reset-usage

Conversation

@ognjeeen

Copy link
Copy Markdown
Owner

Summary

  • show earned rate-limit reset credits and their expiration times in the detailed widget
  • require confirmation before redeeming a reset through the Codex app-server flow, with stable idempotency for retries
  • add localized preview support, regression coverage, and consistent tooltip/dialog styling across light and dark themes

Validation

  • dotnet build .\CodexUsageWidget.slnx -c Release --no-restore
  • dotnet test .\CodexUsageWidget.slnx -c Release --no-build (168 passed)
  • manually verified reset redemption UI, tooltips, button contrast, and dialog proportions in the local Windows preview

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: ae2fd78457

ℹ️ 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".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment on lines +493 to +494
catch (Exception ex) when (
ex is IOException or InvalidOperationException or UnauthorizedAccessException)

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Keep redemption failure handling out of the view

If the Codex executable becomes unavailable after the initial snapshot, restarting the app-server can throw Win32Exception; similarly, a response without outcome throws KeyNotFoundException. Neither matches this filter, so the exception escapes the async void handler onto the WPF dispatcher and can terminate the application. Normalize transport/protocol failures in an Application-layer redemption use case and return a stable result for the view to present, rather than coordinating the operation and infrastructure exception types in code-behind.

AGENTS.md reference: AGENTS.md:L33-L35

Useful? React with 👍 / 👎.

MessageBoxImage.Warning);
}

await _usageMonitor.RefreshAsync();

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Guarantee the post-redemption refresh

If a periodic, notification-triggered, or manual refresh already holds UsageMonitor's refresh gate when redemption finishes, this call returns immediately because RefreshAsync uses WaitAsync(0). If that in-flight read captured the pre-redemption state, the redeemed credit remains selectable until the next two-minute refresh, potentially leading the user to retry a reset that was already consumed. Queue or coalesce a refresh that is guaranteed to run after the active refresh completes.

Useful? React with 👍 / 👎.

@ognjeeen
ognjeeen merged commit 47bd379 into master Aug 31, 2026
1 check passed
@ognjeeen
ognjeeen deleted the feature/rate-limit-reset-usage branch August 31, 2026 13:01
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