Skip to content

fix(web): offer hub limits from the model usage popup - #30896

Open
LaganYT wants to merge 2 commits into
pingdotgg:mainfrom
LaganYT:fix/cliproxy-limits-popup
Open

LaganYT wants to merge 2 commits into
pingdotgg:mainfrom
LaganYT:fix/cliproxy-limits-popup

Conversation

@LaganYT

@LaganYT LaganYT commented Nov 4, 2026

Copy link
Copy Markdown

Summary

Fixes #30886. A Claude connection through CLIProxyAPI shows "Unavailable" in the model usage popup even when the same environment has usable hub quotas in Usage and /usage-limits.

 selected account has no usable limits
-  Limits: Unavailable
+  same-provider hub has usable limits → View hub limits → existing in-chat usage report
+  otherwise → Limits: Unavailable

The popup keeps valid selected-account quotas. It does not guess which hub account serves the endpoint or present a pool's allowance as that account's quota. This is a focused fix for the misleading unavailable state using the existing report, with no routing, quota-fetching, or contract changes. Web and desktop share this popup; mobile has separate UI and is unchanged.

Evidence

Synthetic Claude custom-endpoint fixture with a usable Claude hub account, rendered in headless Chromium at the same 280px width in dark mode.

Before After
Before: unavailable despite valid hub data After: action to view available hub limits
  • Before: pnpm exec vp test run apps/web/src/components/chat/ThreadDetailsUsage.browser.test.tsx fails because the popup renders Unavailable instead of offering the hub report.
  • After: the same test passes. It checks the action, excludes unrelated-provider and failed hub readings, and preserves valid selected-account quota bars.
  • pnpm exec vp run check:changed passes format, lint, knip, affected-package typechecking, nearby tests, and React compiler checks. Nearby tests: 50 passed across 4 files.
  • Full-app visual verification was attempted with an isolated dev server, but T3's browser automation timed out taking a snapshot. The images above are actual component renders with synthetic data, not captures from a live proxy connection. Live CLIProxyAPI routing was not tested.

Merge Danger

Door: two-way. Reverting restores the original unavailable row.

Blast Radius: small. Only the web/desktop thread-details usage row and its existing in-chat report action change.

@github-actions github-actions Bot added vouch:unvouched PR author is not yet trusted in the VOUCHED list. size:S 10-29 changed lines (additions + deletions). labels Nov 4, 2026
@macroscopeapp

macroscopeapp Bot commented Nov 4, 2026

Copy link
Copy Markdown
Contributor

Approvability

Verdict: Approved at 2d391cb

Macroscope's review found this PR approvable — Adds a “View hub limits” link when provider-specific usage limits are unavailable. It reuses the existing panel without changing quotas, permissions or product defaults.

You can add or adjust custom eligibility rules. Learn more.

@coderabbitai

coderabbitai Bot commented Nov 4, 2026 •

Copy link
Copy Markdown
Contributor

Explain Change →

No actionable comments were generated in the recent review.

Walkthrough

The model details usage panel can link to valid hub limits when selected endpoint limits are absent or unavailable. ChatView passes the usage-limits handler to the panel. Browser tests cover matching hub accounts, unavailable cases, and endpoint limits.

Changes: Hub usage limits

Layer / File(s) Summary
Usage limits display and wiring
apps/web/src/components/chat/ThreadDetailsUsage.tsx, apps/web/src/components/ChatView.tsx, apps/web/src/components/chat/ThreadDetailsUsage.browser.test.tsx
The usage panel checks selected-instance limits and matching source-account limits. When valid hub limits are available and selected limits are absent or have a notice, it shows a “View hub limits” button. ChatView passes the handler, and browser tests cover hub and endpoint limit states.

Estimated code review effort: 2 (Simple) | ~10 minutes

Change: Bug fix · Severity of issue fixed: Low

Possibly related issues

  • pingdotgg/t3code#30990 — Reports the same unavailable-limits state for a Claude CLIProxyAPI endpoint despite usable hub quotas.

Possibly related PRs

  • pingdotgg/t3code#31032: Changes how the hub readings used by this panel are refreshed and retained after failed probes.
  • pingdotgg/t3code#26859: Introduced the thread-details usage readout and its unavailable-limits behavior.
  • pingdotgg/t3code#30634: Addresses missing selected-instance limits when matching hub accounts have limits.

Suggested reviewers: t3dotgg

Merge Risk: Minimal · up to 214f5

The popup can link to matching hub limits. No merge-blocking issue was identified.

Pre-merge checks: Passed 4

Check name Status Explanation
Title check Passed The title clearly describes the hub limits action in the model usage popup.
Description check Passed The description is mostly complete. It explains the problem, fix, scope, tests, screenshots, and verification limits. It links the issue but does not establish its triage or approval status.
Linked Issues check Passed [#30886] The popup offers “View hub limits” when selected-account limits are unusable and matching provider hub limits are available. The action opens the existing usage report without attributing poo…
Out of Scope Changes check Passed [#30886] The popup change, usage-report callback wiring, and browser tests support the linked issue. The incremental import change restores the merge-base import and adds no whole-PR scope. No unrelat…
Full details: Linked Issues check

Explanation

[#30886] The popup offers “View hub limits” when selected-account limits are unusable and matching provider hub limits are available. The action opens the existing usage report without attributing pooled quotas to the selected account. Valid selected-account limits remain visible. Browser tests cover the action, unavailable hub data, other providers, and selected-account limits. The reported tests were not rerun.

Full details: Out of Scope Changes check

Explanation

[#30886] The popup change, usage-report callback wiring, and browser tests support the linked issue. The incremental import change restores the merge-base import and adds no whole-PR scope. No unrelated changes are identified in the whole-PR summary.

Finishing Touches

Generate unit tests (beta)

  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
Recent review info

Run configuration

Commits

Reviewing files that changed from the base of the PR and between 2d391cb and 214f59d.

Files selected for processing: 2

  • apps/web/src/components/ChatView.tsx
  • apps/web/src/components/chat/ThreadDetailsUsage.tsx

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 9 remain after this review.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:S 10-29 changed lines (additions + deletions). vouch:unvouched PR author is not yet trusted in the VOUCHED list.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: Model limits popup shows Unavailable with CLIProxyAPI while Usage and /usage-limits show valid quotas

1 participant