Skip to content

Add Claude Fable model tier#131

Merged
ohong merged 3 commits into
ohong:mainfrom
alexesprit:add-claude-fable-title-tier
Jul 3, 2026
Merged

Add Claude Fable model tier#131
ohong merged 3 commits into
ohong:mainfrom
alexesprit:add-claude-fable-title-tier

Conversation

@alexesprit

@alexesprit alexesprit commented Jun 12, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Add Claude Fable labeling for claude-fable model slugs
  • Treat Fable as the highest Claude tier in auto-generated usage titles
  • Relax Opus matching to claude-opus slugs without pinning to a version

Summary by CodeRabbit

Summary by CodeRabbit

  • New Features

    • Added support for Claude Fable model variants across auto-title generation, shared model labels, and recap/model displays
  • Bug Fixes

    • Improved recognition and normalization of Claude Fable/Opus model names so labels and derived titles render consistently
    • Updated model color mapping for Claude Fable in activity feed cards and theme rendering
  • Tests

    • Expanded coverage for model prettification and usage auto-title logic, including Fable/Opus combinations

@vercel

vercel Bot commented Jun 12, 2026

Copy link
Copy Markdown

@alexesprit is attempting to deploy a commit to the Pacific Systems Team on Vercel.

A member of the Team first needs to authorize it.

@coderabbitai

coderabbitai Bot commented Jun 12, 2026

Copy link
Copy Markdown

Review Change Stack

Warning

Review limit reached

@ohong, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 53 minutes

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 2ee2978c-180f-454f-a406-5aabf3ef6fe1

📥 Commits

Reviewing files that changed from the base of the PR and between 20fed10 and 3ce9731.

📒 Files selected for processing (2)
  • apps/web/__tests__/api/usage-submit.test.ts
  • apps/web/app/api/usage/submit/route.ts
📝 Walkthrough

Walkthrough

This PR extends Claude model recognition across shared helpers, usage title generation, UI model labels, and palette mappings to support Fable variants and broader Opus matching. Tests were added for the new model names and the usage submit flow.

Changes

Claude Fable Model Support

Layer / File(s) Summary
Shared model prettification updates
packages/shared/src/models.ts
prettifyModel and getShareModelLabel now recognize claude-fable and broader claude-opus variants via case-insensitive regex and substring matching.
Usage submit auto-title resolution
apps/web/app/api/usage/submit/route.ts
resolveClaudeTitleLabel normalizes model strings, maps Fable before other Claude labels, and POST /api/usage/submit uses that helper with simplified Claude detection.
Model display and color updates
apps/web/components/app/feed/ActivityCard.tsx, apps/web/lib/share-assets/post-card-image.tsx, apps/web/lib/utils/recap.ts, packages/cli/src/components/theme.ts, docs/CHANGELOG.md
Feed labels, share-card rendering, recap names, CLI colors, and changelog text now include Claude Fable and broader Opus matching.
Prettify-model unit tests
apps/web/__tests__/unit/prettify-model.test.ts
Unit coverage now checks claude-fable-5, claude-opus-5, and the legacy whitespace-trimming fallback for Fable variants.
Usage submit integration test
apps/web/__tests__/api/usage-submit.test.ts
The usage submit test now asserts that a device containing both Fable and Opus models produces a post title that prefers Claude Fable.

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

Possibly related PRs

  • ohong/straude#30: Also updates prettifyModel behavior and related tests around Claude model name formatting.
🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 33.33% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly matches the main change: adding support for the Claude Fable model tier.
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.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@apps/web/app/api/usage/submit/route.ts`:
- Around line 339-344: The current slug-to-Claude-tier mapping (in
resolveClaudeTitleLabel) labels any slug containing
"fable","opus","sonnet","haiku" as Claude; change it so you only map those
substrings when the same slug also indicates a Claude/Anthropic namespace (e.g.,
contains "claude" or "anthropic"); update the logic that builds slugs
(models.map(...)) and the subsequent checks to require both the namespace check
and the tier substring check per slug before returning "Claude
Fable/Opus/Sonnet/Haiku", otherwise return null.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 6bd6bcc1-ff0e-424e-8a30-bf6cd81843cc

📥 Commits

Reviewing files that changed from the base of the PR and between f62d7bd and a734ef2.

📒 Files selected for processing (4)
  • apps/web/__tests__/api/usage-submit.test.ts
  • apps/web/__tests__/unit/prettify-model.test.ts
  • apps/web/app/api/usage/submit/route.ts
  • packages/shared/src/models.ts

Comment thread apps/web/app/api/usage/submit/route.ts
PR ohong#131 added Fable labeling to the shared prettifyModel/getShareModelLabel
helpers and the submit-route auto-title, but three sibling copies of the
tier-label logic and both model-color maps were untouched.

- post-card-image.tsx: local prettifyModel now maps claude-fable-* -> Claude Fable
- recap.ts: MODEL_DISPLAY_NAMES gains claude-fable; opus key relaxed to claude-opus
- ActivityCard.tsx: legacy highest-tier fallback ranks Fable above Opus
- Dedicated Fable color #C2410C (deep burnt orange, top tier) in the CLI palette
  (theme.ts) and the web feed model-usage bar (ActivityCard.modelColor)

No collection changes: ccusage already prices claude-fable-5 via LiteLLM online
mode, so Fable spend flows into daily_usage.cost_usd automatically.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🧹 Nitpick comments (1)
apps/web/lib/share-assets/post-card-image.tsx (1)

24-38: 📐 Maintainability & Code Quality | 🔵 Trivial

Consider consolidating duplicated prettifyModel logic.

This file, ActivityCard.tsx, and packages/shared/src/models.ts each maintain their own copy of Claude tier-matching logic. Adding Fable here required editing three separate implementations independently, and they've already drifted (e.g. ActivityCard.tsx's legacy fallback uses .includes("fable") without the /i flag, vs this file's /claude-fable/i regex). Importing the shared prettifyModel from packages/shared/src/models.ts would prevent future divergence.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@apps/web/lib/share-assets/post-card-image.tsx` around lines 24 - 38, The
prettifyModel logic is duplicated and has already drifted across
implementations, so update this file to reuse the shared prettifyModel from
packages/shared/src/models.ts instead of maintaining a local copy. Make the
post-card image path call the shared helper from the relevant rendering code,
and verify any Claude tier formatting behavior stays consistent with
ActivityCard.tsx and the shared models utility.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Nitpick comments:
In `@apps/web/lib/share-assets/post-card-image.tsx`:
- Around line 24-38: The prettifyModel logic is duplicated and has already
drifted across implementations, so update this file to reuse the shared
prettifyModel from packages/shared/src/models.ts instead of maintaining a local
copy. Make the post-card image path call the shared helper from the relevant
rendering code, and verify any Claude tier formatting behavior stays consistent
with ActivityCard.tsx and the shared models utility.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: a11442a9-fe57-4e43-86bc-b8c5baf84949

📥 Commits

Reviewing files that changed from the base of the PR and between a734ef2 and 20fed10.

📒 Files selected for processing (5)
  • apps/web/components/app/feed/ActivityCard.tsx
  • apps/web/lib/share-assets/post-card-image.tsx
  • apps/web/lib/utils/recap.ts
  • docs/CHANGELOG.md
  • packages/cli/src/components/theme.ts
✅ Files skipped from review due to trivial changes (1)
  • docs/CHANGELOG.md

@ohong ohong merged commit 143a5af into ohong:main Jul 3, 2026
2 of 4 checks passed
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