Skip to content

fix: recognize Fable 5 model family in usage display#230

Open
grisha wants to merge 1 commit into
Maciek-roboblog:mainfrom
grisha:fix/fable-5-model-family
Open

fix: recognize Fable 5 model family in usage display#230
grisha wants to merge 1 commit into
Maciek-roboblog:mainfrom
grisha:fix/fable-5-model-family

Conversation

@grisha

@grisha grisha commented Jul 17, 2026

Copy link
Copy Markdown

Problem

When all usage comes from claude-fable-5 (Anthropic's new Claude 5 family), the model usage bar shows "Other 100%" instead of naming the model family. ModelUsageBar._family_for() only knew Sonnet, Opus, and Haiku, so Fable fell into the "Other" fallback bucket.

Pricing already handles Fable (core/pricing.py has a fable rate entry); only the display classification was behind.

Changes

  • ui/progress_bars.py: add a Fable family to _FAMILY_STYLES (styled highlight, which is defined in all three themes) and match fable in _family_for().
  • core/models.py: pass Fable model ids through normalize_model_name() lowercased, matching the existing 4-series behavior.
  • Tests for both: Fable renders as its own family (not "Other"), and normalization is covered in test_normalize_model_name.

Testing

pytest src/tests: 730 passed, 3 skipped. Also verified against live usage data from a Fable 5 session — the bar now shows Fable 100.0%.

Summary by CodeRabbit

  • New Features

    • Added support for Fable model names, including consistent recognition of lowercase and mixed-case variants.
    • Fable models now appear under the Fable category in usage progress bars, with token usage and percentages displayed correctly.
  • Bug Fixes

    • Corrected model-name normalization so Fable model names are consistently identified and formatted.

Usage from claude-fable-5 was falling into the 'Other' bucket of the
model usage bar because the family classifier only knew Sonnet, Opus,
and Haiku. Pricing already handles Fable; only display classification
was behind.

Add a Fable family to ModelUsageBar (styled 'highlight', present in all
themes) and pass Fable model ids through normalize_model_name lowercased,
matching the 4-series behavior.
@coderabbitai

coderabbitai Bot commented Jul 17, 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

Run ID: ee923f41-ecfc-4bbb-9e19-9895d11ba70d

📥 Commits

Reviewing files that changed from the base of the PR and between c59a83b and 1889929.

📒 Files selected for processing (4)
  • src/claude_monitor/core/models.py
  • src/claude_monitor/ui/progress_bars.py
  • src/tests/test_formatting.py
  • src/tests/test_progress_bars.py

📝 Walkthrough

Walkthrough

Adds Fable model recognition to model-name normalization and usage progress bars, including a dedicated style and tests for case-insensitive normalization and family rendering.

Changes

Fable model family support

Layer / File(s) Summary
Normalize and render Fable models
src/claude_monitor/core/models.py, src/claude_monitor/ui/progress_bars.py, src/tests/test_formatting.py, src/tests/test_progress_bars.py
Fable model names are normalized to lowercase, grouped under the “Fable” family with highlight styling, and validated through normalization and progress-bar rendering tests.

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

Suggested reviewers: maciek-roboblog

🚥 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 summarizes the main change: recognizing the Fable 5 model family in usage display.
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 unit tests (beta)
  • Create PR with unit tests

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.

@kramersharp

Copy link
Copy Markdown

ClaimVerifier: blocking findings

The following file claims in commit messages / PR body were not actually modified on this branch:

  • core/pricing.py — Claim in pr_body references core/pricing.py but branch diff does not modify it

Please update the claim or add the missing changes.

@grisha

grisha commented Jul 17, 2026

Copy link
Copy Markdown
Author

The PR body doesn't claim core/pricing.py was modified — it notes that pricing already supports Fable (it has a fable rate entry), which is exactly why this fix only touches the display classification. No changes to pricing are needed.

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.

2 participants