Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

feat: distinguish expired/invalid tokens from generic errors on limit gauges#67

Merged
nigel-dev merged 1 commit intomaintokentopapp/tokentop:mainfrom
feat/issue-29-error-categoriestokentopapp/tokentop:feat/issue-29-error-categoriesCopy head branch name to clipboard
Mar 8, 2026
Merged

feat: distinguish expired/invalid tokens from generic errors on limit gauges#67
nigel-dev merged 1 commit intomaintokentopapp/tokentop:mainfrom
feat/issue-29-error-categoriestokentopapp/tokentop:feat/issue-29-error-categoriesCopy head branch name to clipboard

Conversation

@nigel-dev
Copy link
Copy Markdown
Contributor

Summary

Replace the generic red ERR indicator on provider limit gauges and provider cards with category-specific labels, colors, and icons so users can diagnose token/auth issues at a glance without leaving the dashboard.

Changes

  • Add src/utils/error-category.ts with ProviderErrorCategory type, classifyProviderError() string classifier, and getErrorCategoryDisplay() shared display helper
  • Update LimitGauge.tsx to render category-specific error states: AUTH (yellow, ⚷ icon), RATE (yellow, ⧗), TIME (yellow, ⧗), CRED (yellow), NET (red), ERR (red, fallback)
  • Update ProviderCard.tsx (Providers page) with the same category-aware treatment — status icon, status color, and error body all reflect the error category
  • Update ProviderLimitsPanel.tsx to pass errorCategory through to LimitGauge in all 3 layout modes (compact, normal, wide)
  • Update RealTimeDashboard.tsx to compute errorCategory via the classifier and pass it to the limits panel
  • Add 13 test cases (46 assertions) in src/utils/__tests__/error-category.test.ts covering real error strings from all 11 provider plugins

Type

  • feat — New feature
  • fix — Bug fix
  • refactor — Code change that neither fixes a bug nor adds a feature
  • docs — Documentation only
  • chore — Build, deps, CI, or tooling
  • test — Adding or updating tests

Related issues

Closes #29

Testing

  • bun test passes (109 tests, 0 failures)
  • bun run typecheck passes (0 errors)
  • Manual verification (describe below)

Error classification is tested against real error strings from all 11 provider plugins (Anthropic, OpenAI, Gemini, GitHub Copilot, Perplexity, Codex, Antigravity, Z.ai, MiniMax, Chutes, OpenCode Zen). Visual verification requires running with an expired/invalid token to trigger the new indicators.

Screenshots / captures

No captures yet — visual changes are best verified by running ttop with an expired OAuth token or invalid API key. The before/after:

Before (all errors identical):

✗ Anthropic   ────────── ERR    (red)
✗ OpenAI      ────────── ERR    (red)
✗ Perplexity  ────────── ERR    (red)

After (category-specific):

⚷ Anthropic   ────────── AUTH   (yellow — re-auth needed)
✗ OpenAI      ────────── ERR    (red — generic error)
⧗ Perplexity  ────────── RATE   (yellow — transient, will resolve)

@nigel-dev nigel-dev merged commit ac019d2 into main Mar 8, 2026
6 checks passed
This was referenced Mar 8, 2026
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.

[Feature]: Distinguish expired/invalid tokens from generic errors on dashboard limit gauges

1 participant

Morty Proxy This is a proxified and sanitized view of the page, visit original site.