Skip to content

Generalize provider usage bucket groups#512

Open
iam-brain wants to merge 2 commits intosteipete:mainfrom
iam-brain:bryan/codex-spark-oauth-live
Open

Generalize provider usage bucket groups#512
iam-brain wants to merge 2 commits intosteipete:mainfrom
iam-brain:bryan/codex-spark-oauth-live

Conversation

@iam-brain
Copy link
Contributor

@iam-brain iam-brain commented Mar 12, 2026

Summary

This PR adds a generic provider-owned bucket-group mechanism for extra live rate-limit sections and uses Codex OAuth Spark data as the first implementation.

The goal is to support provider-specific rate-limit buckets without widening the existing primary / secondary / tertiary model or adding more one-off snapshot fields.

Why this approach:

  • It keeps the current primary / secondary / tertiary model intact, so existing menu bar ranking, pace logic, and provider behavior stay stable.
  • It gives providers one reusable path for extra rate-limit sections through snapshot data instead of more provider-specific fields.
  • It keeps provider-specific detection in the provider mapping layer while making presentation data-driven in shared renderers.
  • It matches the repo’s preference for typed snapshot data over provider-specific UI branching or metadata flags.

What changed:

  • Added UsageBucketGroupSnapshot and UsageBucketSnapshot to UsageSnapshot as usageBucketGroups.
  • Mapped Codex OAuth additional_rate_limits into a generic bucket group:
    • group id: codex.spark
    • group title: GPT-5.3-Codex-Spark
    • bucket ids: codex.spark.session, codex.spark.weekly
  • Updated the menu descriptor, menu card, status menu, and CLI renderer to display extra bucket groups generically.
  • Added regression coverage for OAuth decoding, snapshot round-tripping, CLI rendering, menu rendering, and status menu ordering/separators.

What intentionally did not change:

  • No scanner, pricing, or history code.
  • No changes to the existing primary / secondary / tertiary semantics.
  • No new provider metadata booleans or provider-specific rendering branches for extra buckets.

Verification

  • swift test
  • pnpm check
  • ./Scripts/compile_and_run.sh

Copy link

@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: 693893f916

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

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