Skip to content

Add quota warning controls and markers#852

Merged
steipete merged 4 commits intosteipete:mainfrom
Alekstodo:codex/quota-warning-notifications-pr
May 10, 2026
Merged

Add quota warning controls and markers#852
steipete merged 4 commits intosteipete:mainfrom
Alekstodo:codex/quota-warning-notifications-pr

Conversation

@Alekstodo
Copy link
Copy Markdown
Contributor

@Alekstodo Alekstodo commented May 6, 2026

Summary

  • add global quota warning defaults for session and weekly windows
  • add provider-specific overrides for quota warning thresholds and per-window enablement
  • improve quota warning notifications with current remaining copy, optional sound, and menu bar flash feedback
  • show warning markers in usage bars and cover the behavior with focused tests

Tests

  • DEVELOPER_DIR=/Applications/Xcode.app/Contents/Developer ./Scripts/lint.sh lint
  • DEVELOPER_DIR=/Applications/Xcode.app/Contents/Developer swift test (2101 tests passed)

@Alekstodo Alekstodo force-pushed the codex/quota-warning-notifications-pr branch from 55dfc55 to 410a88d Compare May 6, 2026 23:07
@Alekstodo Alekstodo marked this pull request as ready for review May 6, 2026 23:21
@Alekstodo Alekstodo force-pushed the codex/quota-warning-notifications-pr branch from 410a88d to 4931dbb Compare May 10, 2026 01:34
@steipete steipete force-pushed the codex/quota-warning-notifications-pr branch from 4931dbb to 2edab0d Compare May 10, 2026 02:57
Copy link
Copy Markdown

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

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: 2edab0d997

ℹ️ 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 +733 to +734
self.handleQuotaWarningTransition(provider: provider, window: .session, rateWindow: snapshot.primary)
self.handleQuotaWarningTransition(provider: provider, window: .weekly, rateWindow: snapshot.secondary)
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 Map quota warning windows using provider-aware window selection

Do not hard-code .session to snapshot.primary and .weekly to snapshot.secondary for all providers. Some providers intentionally place non-weekly quotas in the secondary lane (for example Copilot chat-only plans keep chat in secondary), so this logic can mislabel chat/session depletion as a weekly warning and skip the real session warning path when primary is nil. This leads to incorrect/missed notifications whenever providers do not use primary/secondary as strict session/weekly windows.

Useful? React with 👍 / 👎.

@steipete steipete force-pushed the codex/quota-warning-notifications-pr branch from 2edab0d to b50e0e4 Compare May 10, 2026 03:03
Copy link
Copy Markdown
Owner

@steipete steipete left a comment

Choose a reason for hiding this comment

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

Reviewed quota warning controls/markers, fixed startup-default seeding and local script-runner churn, rebased on main, and live-tested the rebuilt app. Thanks @Alekstodo!

Copy link
Copy Markdown

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

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: b50e0e4a8e

ℹ️ 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 +1189 to +1191
warningMarkerPercents: Self.warningMarkerPercents(
thresholds: input.quotaWarningThresholds[.session],
showUsed: input.usageBarsShowUsed))
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 Map warning markers using provider-aware window routing

The marker mapping in this metric path assumes primary is always the session window by hard-wiring .session thresholds here (with the inverse assumption for secondary in secondaryMetric). That breaks providers where window placement differs (for example, Copilot can expose session quota via secondary fallback), causing warning markers to appear on the wrong bar or not appear for the actual session lane. This makes the new quota markers misleading even when thresholds are configured correctly.

Useful? React with 👍 / 👎.

@steipete steipete merged commit 18eb73d into steipete:main May 10, 2026
4 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