Skip to content

Fix Command Code rolling and monthly usage windows - #2466

Open
derekszen wants to merge 1 commit into
steipete:mainfrom
derekszen:fix/provider-reset-times
Open

Fix Command Code rolling and monthly usage windows#2466
derekszen wants to merge 1 commit into
steipete:mainfrom
derekszen:fix/provider-reset-times

Conversation

@derekszen

Copy link
Copy Markdown
Contributor

Summary

  • read Command Code API-key credentials from the CLI auth file or environment
  • fetch live 5-hour, weekly, and monthly billing windows through the alpha billing API
  • preserve browser-cookie fallback while allowing Linux auto mode to use API-key auth
  • expose reset timestamps and correct quota labels in provider output
  • add cross-platform and Linux coverage for auth, headers, percentages, and reset dates

Verification

  • make test
  • ./Scripts/lint.sh lint-linux
  • SwiftFormat lint on changed files
  • live codexbar usage --provider commandcode --format json --pretty against a Go account

@clawsweeper

clawsweeper Bot commented Jul 27, 2026

Copy link
Copy Markdown

ClawSweeper status: review started.

I am starting a fresh review of this pull request: Fix Command Code rolling and monthly usage windows This is item 1/1 in the current shard. Shard 0/1.

This placeholder means the worker is alive and reading the current context. I will edit this same comment with the actual review when the claws are done clicking.

Crustacean status: shell secured, claws on keyboard, evidence pebbles being sorted.

@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: b73f4040bf

ℹ️ 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 +73 to +75
primary: self.fiveHourWindow,
secondary: self.weeklyWindow,
tertiary: monthly,

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 monthly depletion stabilization on the tertiary lane

When the optional subscription request fails after a paid snapshot, commandCodeSnapshotResolvingDepletionOnEnrichmentFailure still reads and replaces primary, but this change makes primary the live five-hour window and moves monthly usage to tertiary. Consequently, a transient enrichment failure can falsely replace valid five-hour usage with 100%, while a snapshot without a rolling window no longer preserves the depleted monthly lane at all; update that stabilization path and its Command Code quota-transition tests to operate on tertiary.

Useful? React with 👍 / 👎.

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