You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
fix(web): offer hub limits from the model usage popup - #30896
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: 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.
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.
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.
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: 4
Check name
Status
Explanation
Title check
The title clearly describes the hub limits action in the model usage popup.
Description check
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
[#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
[#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
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 file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
size:S10-29 changed lines (additions + deletions).vouch:unvouchedPR author is not yet trusted in the VOUCHED list.
1 participant
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.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.
pnpm exec vp test run apps/web/src/components/chat/ThreadDetailsUsage.browser.test.tsxfails because the popup rendersUnavailableinstead of offering the hub report.pnpm exec vp run check:changedpasses format, lint, knip, affected-package typechecking, nearby tests, and React compiler checks. Nearby tests: 50 passed across 4 files.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.