Repository navigation
fix(cli): render quota bars in ocx provider quota - #2586
Conversation
quota() rendered the response through summaryLines(), a depth-1 flattener that emits 'N item(s)' for a non-scalar array. Every fetched report was discarded, so the default invocation printed a count and users had to pipe --json through a parser to read their own quota. Reuses providerQuotaLine, the formatter ocx account refresh already uses, so both commands render the same shape.
|
Warning Review limit reachedNext included review available in 3 minutes. View limit detailsLimit details: You’ve used all 10 included reviews currently available. You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Review configuration: ⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: ASSERTIVE Plan: Pro Plus Run ID: 📒 Files selected for processing (3)
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. Comment |
|
✅ Deterministic PR hygiene checks passed. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 216c082766
ℹ️ 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".
| test("one line per report, using the same formatter as ocx account refresh", () => { | ||
| const line = providerQuotaLine("anthropic", report("anthropic", { |
There was a problem hiding this comment.
Exercise the provider quota command in the regression test
These tests call the pre-existing providerQuotaLine formatter directly, so they still pass if quota() is reverted to summaryLines, maps the wrong response field, or fails to preserve --refresh; consequently, the behavior changed by this commit has no regression coverage. Invoke handleProviderRuntimeCommand("quota", ...) through fakeRuntime, capture stdout, and assert both the request path and rendered report lines.
AGENTS.md reference: AGENTS.md:L276-L278
Useful? React with 👍 / 👎.
quota() rendered the response through summaryLines(), a depth-1 flattener that emits 'N item(s)' for a non-scalar array. Every fetched report was discarded, so the default invocation printed a count and users had to pipe --json through a parser to read their own quota. Reuses providerQuotaLine, the formatter ocx account refresh already uses, so both commands render the same shape.
quota() rendered the response through summaryLines(), a depth-1 flattener that emits 'N item(s)' for a non-scalar array. Every fetched report was discarded, so the default invocation printed a count and users had to pipe --json through a parser to read their own quota. Reuses providerQuotaLine, the formatter ocx account refresh already uses, so both commands render the same shape.
Summary
Closes #2565.
quota()rendered the response throughsummaryLines(), a depth-1 flattener that emitsN item(s)for a non-scalar array. Every fetched report was discarded, so the defaultinvocation of the command printed a count and users had to pipe
--jsonthrough a parserto read their own quota.
The fix reuses
providerQuotaLine, the formatterocx account refreshalready uses, soboth commands render the same shape.
Verification
Before:
After, against the same live proxy:
Percentages are not reformatted here:
ocx account refreshprints the same raw values, andchanging the shared formatter's precision is a separate decision from repairing a dropped
projection.
Checklist
devdevhead