Skip to content

feat: show ChatGPT usage pace - #13

Merged
ygpark80 merged 1 commit into
mainfrom
feat/usage-pace
Aug 9, 2026
Merged

feat: show ChatGPT usage pace#13
ygpark80 merged 1 commit into
mainfrom
feat/usage-pace

Conversation

@ygpark80

@ygpark80 ygpark80 commented Aug 9, 2026

Copy link
Copy Markdown
Contributor

User description

Changes

  • decode ChatGPT quota window duration from Prism
  • add a pace projection to prism chatgpt usage
  • show whether current usage will last until reset or when it will run out

Testing

  • go test -mod=vendor -race ./...
  • go vet -mod=vendor ./...
  • gofmt -l .
  • go build -mod=vendor ./...

Notes

  • Pace projection follows the OpenUsage burn-rate thresholds and stays unavailable when the server does not provide a window duration.

CodeAnt-AI Description

Show ChatGPT quota usage pace and projected reset status

What Changed

  • ChatGPT usage now includes a PACE column showing whether current usage is expected to last until reset
  • Displays projected remaining quota, a warning when usage is close to the limit, or the estimated time until quota runs out
  • Shows clear states for reached limits and insufficient usage data; existing reset and error details remain available
  • Reads the quota window duration needed for pace projections

Impact

✅ Earlier warning before ChatGPT quotas run out
✅ Clearer quota status at reset
✅ ChatGPT usage includes projected run-out time

💡 Usage Guide

Checking Your Pull Request

Every time you make a pull request, our system automatically looks through it. We check for security issues, mistakes in how you're setting up your infrastructure, and common code problems. We do this to make sure your changes are solid and won't cause any trouble later.

Talking to CodeAnt AI

Got a question or need a hand with something in your pull request? You can easily get in touch with CodeAnt AI right here. Just type the following in a comment on your pull request, and replace "Your question here" with whatever you want to ask:

@codeant-ai ask: Your question here

This lets you have a chat with CodeAnt AI about your pull request, making it easier to understand and improve your code.

Example

@codeant-ai ask: Can you suggest a safer alternative to storing this secret?

Preserve Org Learnings with CodeAnt

You can record team preferences so CodeAnt AI applies them in future reviews. Reply directly to the specific CodeAnt AI suggestion (in the same thread) and replace "Your feedback here" with your input:

@codeant-ai: Your feedback here

This helps CodeAnt AI learn and adapt to your team's coding style and standards.

Example

@codeant-ai: Do not flag unused imports.

Retrigger review

Ask CodeAnt AI to review the PR again, by typing:

@codeant-ai: review

Check Your Repository Health

To analyze the health of your code repository, visit our dashboard at https://app.codeant.ai. This tool helps you identify potential issues and areas for improvement in your codebase, ensuring your repository maintains high standards of code health.

Summary by CodeRabbit

  • New Features
    • Added a PACE column to usage reporting.
    • Usage pacing now indicates whether quota is healthy, nearing exhaustion, projected to run out, or already reached.
    • Account-level errors display a clear placeholder when pacing information is unavailable.
    • Usage limits now support window duration information for more accurate pacing calculations.

@codeant-ai

codeant-ai Bot commented Aug 9, 2026

Copy link
Copy Markdown

🤖 CodeAnt AI — Review Status

Status Commit Started (UTC) Finished (UTC)
✅ Reviewed your PR 17312e2 Aug 09, 2026 · 11:18 11:20

@codeant-ai

codeant-ai Bot commented Aug 9, 2026

Copy link
Copy Markdown

Thanks for using CodeAnt! 🎉

We're free for open-source projects. if you're enjoying it, help us grow by sharing.

Share on X ·
Reddit ·
LinkedIn

@codeant-ai codeant-ai Bot added the size:L This PR changes 100-499 lines, ignoring generated files label Aug 9, 2026
@coderabbitai

coderabbitai Bot commented Aug 9, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 3bc37ddc-98dc-4878-b400-c9e9a6426255

📥 Commits

Reviewing files that changed from the base of the PR and between 78570b2 and 17312e2.

📒 Files selected for processing (4)
  • internal/api/client.go
  • internal/api/client_test.go
  • internal/cli/run.go
  • internal/cli/run_test.go

📝 Walkthrough

Walkthrough

The usage API now exposes usage-window duration. The CLI calculates quota pacing statuses and displays them in a new PACE column. Tests cover API decoding, rendered output, and pacing calculations across quota states.

Changes

Usage pacing

Layer / File(s) Summary
Usage window contract
internal/api/client.go, internal/api/client_test.go
UsageLimit now stores optional WindowSeconds data. API tests validate the decoded seven-day window.
Pace calculation and output
internal/cli/run.go
Usage rows now include a PACE column. usagePace reports reached, too-early, running-out, and remaining-capacity states.
Pacing output validation
internal/cli/run_test.go
Tests validate the new table output and pacing calculations across supported quota states.

Estimated code review effort: 3 (Moderate) | ~20 minutes

Sequence Diagram(s)

sequenceDiagram
  participant UsageAPI
  participant UsageLimit
  participant usagePace
  participant UsageTable
  UsageAPI->>UsageLimit: return usage limit and window duration
  UsageLimit->>usagePace: provide usage, reset time, and window
  usagePace->>UsageTable: return pace status
  UsageTable->>UsageTable: render PACE column
Loading

Possibly related PRs

  • circlesac/prism-cli#8: Introduced the usage types, API fixture, formatter, and tests extended by this change.
  • circlesac/prism-cli#12: Also modifies usage display and tests, but adds localized reset-time formatting.
🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and concisely describes the main change: adding ChatGPT usage pace reporting.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat/usage-pace

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@ygpark80
ygpark80 merged commit 76ac2dd into main Aug 9, 2026
1 check passed
@ygpark80
ygpark80 deleted the feat/usage-pace branch August 9, 2026 11:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:L This PR changes 100-499 lines, ignoring generated files

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant