-
Notifications
You must be signed in to change notification settings - Fork 1.8k
fix: parse Command Code rolling usage windows #2630
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -11,14 +11,6 @@ extension UsageStore { | |
| { | ||
| // Session quota notifications are tied to the primary session window. Copilot free plans can | ||
| // expose only chat quota, so allow Copilot to fall back to secondary for transition tracking. | ||
| // Command Code synthesizes a depleted primary while subscription enrichment is unavailable. | ||
| // Preserve the prior notification state for that placeholder, but accept positive credit data. | ||
| if provider == .commandcode, | ||
| snapshot.commandCodeSubscriptionEnrichmentUnavailable, | ||
| SessionQuotaNotificationLogic.isDepleted(snapshot.primary?.remainingPercent) | ||
| { | ||
| return | ||
| } | ||
| // Hooks have their own enable switch, so a configured quota_reached hook must fire on a | ||
| // real depletion even when session quota notifications are off. Run transition detection | ||
| // whenever notifications OR a matching hook rule is active; gate the OS notification post | ||
|
|
@@ -37,9 +29,6 @@ extension UsageStore { | |
| return | ||
| } | ||
| guard let sessionWindow = self.sessionQuotaWindow(provider: provider, snapshot: snapshot) else { | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
When Command Code's optional subscription request times out or fails and the credits response does not include Useful? React with 👍 / 👎. |
||
| if provider == .commandcode, snapshot.commandCodeSubscriptionEnrichmentUnavailable { | ||
| return | ||
| } | ||
| if provider == .codex { | ||
| if let previous = self.sessionQuotaTransitionStates[.codex] { | ||
| if previous.codexOwnerKey != codexOwnerKey { | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For the same Command Code enrichment-failure snapshots that lack
windowLimits, continuing past this point leavesprimaryWindow/secondaryWindownil andhandleQuotaWarningTransitionremoves the stored fired thresholds. A later successful rolling window that is still below the configured threshold is therefore reported as a fresh crossing and can re-send the samequota_lownotification or hook; skip state mutation only for enrichment-unavailable refreshes without rolling windows instead of clearing the warning state.Useful? React with 👍 / 👎.