Skip to content

Show Copilot calendar-month pace under the premium row#690

Open
coygeek wants to merge 2 commits intosteipete:mainfrom
coygeek:fix/copilot-weekly-pace
Open

Show Copilot calendar-month pace under the premium row#690
coygeek wants to merge 2 commits intosteipete:mainfrom
coygeek:fix/copilot-weekly-pace

Conversation

@coygeek
Copy link
Copy Markdown

@coygeek coygeek commented Apr 11, 2026

Summary

  • keep Copilot to a single visible Premium row with pace text underneath
  • derive Copilot's pacing window from the calendar month ending at quota_reset_date
  • stop using assigned_date -> quota_reset_date for premium-request pace calculations
  • keep Claude-style in deficit / in reserve wording for the Copilot pace line
  • add regression coverage for the live payload shape and corrected monthly reserve math

Closes #689

Root cause

A live /copilot_internal/user response returned:

  • assigned_date: 2026-03-22T16:03:34-07:00
  • quota_reset_date: 2026-05-01
  • premium_interactions.entitlement: 1500
  • premium_interactions.remaining: 1139
  • premium_interactions.percent_remaining: 75.9

GitHub's premium-request analytics are calendar-month based, but CodexBar was previously interpreting that payload as a single Mar 22 -> May 1 quota window. That made Copilot reserve/deficit text too optimistic.

This change treats Copilot premium pacing as the current calendar month ending at quota_reset_date, which matches GitHub's own analytics page.

Validation

  • gh api -H "Accept: application/json" -H "Editor-Version: vscode/1.96.2" -H "Editor-Plugin-Version: copilot-chat/0.26.7" -H "User-Agent: GitHubCopilotChat/0.26.7" -H "X-Github-Api-Version: 2025-04-01" /copilot_internal/user --jq '{copilot_plan, assigned_date, quota_reset_date, monthly_quotas, limited_user_quotas, quota_snapshots}'
  • swift test --filter CopilotUsageModelsTests
  • swift test --filter UsagePaceTextTests
  • swift test --filter CodexPresentationCharacterizationTests
  • pnpm check
  • ./Scripts/compile_and_run.sh

Notes

  • The live menu now shows 24% used and 9% in reserve, which aligns with the calendar-month premium-request window.
  • Claude/Codex keep their existing layouts and pace behavior.

Derive Copilot reset windows from the existing assigned/reset dates so the shared pace UI can show whether chat usage is ahead or behind schedule.

Co-authored-by: factory-droid[bot] <138933559+factory-droid[bot]@users.noreply.github.com>
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: 5e8992b3a4

ℹ️ 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 +218 to +219
guard let assignedAt = Self.parseQuotaDate(self.assignedDate),
let resetsAt = Self.parseQuotaDate(self.quotaResetDate),
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 Handle Copilot free-tier windows when deriving pace

The new quotaWindow logic requires both assigned_date and quota_reset_date, so it returns nil whenever either key is missing. That breaks the new pace/reset support for responses that are still valid via the existing free-tier path (monthly_quotas + limited_user_quotas) but do not include those two fields, because CopilotUsageFetcher will keep emitting windows without resetsAt/windowMinutes. In that scenario the Copilot menu never shows pace or reset timing despite this feature being enabled for .copilot.

Useful? React with 👍 / 👎.

@coygeek coygeek changed the title Add Copilot weekly pace support Add Copilot monthly pace ahead/behind status Apr 11, 2026
@coygeek coygeek changed the title Add Copilot monthly pace ahead/behind status Show Copilot monthly pace under the premium row Apr 11, 2026
@coygeek coygeek changed the title Show Copilot monthly pace under the premium row Show Copilot calendar-month pace under the premium row Apr 11, 2026
Derive Copilot premium-request pacing from the calendar month ending at quota_reset_date instead of the assigned_date window. Keep Copilot on a single visible row and add regression coverage for the corrected monthly reserve math.
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.

Copilot premium usage should use calendar-month pace under a single row

1 participant