Skip to content

feat(models): add Fable 5 as a selectable Anthropic model - #995

Merged
doomspork merged 2 commits into
mainfrom
doomspork/add-fable-5-support
Jun 10, 2026
Merged

feat(models): add Fable 5 as a selectable Anthropic model#995
doomspork merged 2 commits into
mainfrom
doomspork/add-fable-5-support

Conversation

@doomspork

Copy link
Copy Markdown
Member

Summary

Adds Fable 5 as a new Opus-class Anthropic model, selectable in the picker without changing the default (Opus 4.8 stays the default). This mirrors the prior Opus 4.8 transition, but for a brand-new, non-aliased name that also ships a 1M-context variant.

  • Registry — two MODELS entries: claude-fable-5 (200K) and claude-fable-5[1m] (1M), plus a NON_1M_FALLBACKS mapping for the 1M → 200K fallback.
  • Capabilities — Fable 5 joins the effort / xhigh / max sets (it is not added to fast mode, which is Opus-4.6-only).
  • Pricingclaude-fable-5 at $30 / $150 per Mtok (2× Opus), for local cost aggregation (e.g. via Pi).
  • Docs + help text — model-selection table, default-model row, --model flag examples, and the xhigh requires Opus 4.7+ strings (CLI help + command palette) now include Fable 5.

The key design choice is the concrete id claude-fable-5 (no bare fable alias). Because it starts with claude-, it passes the one hard allow-list gate (is_claude_code_model_alias in gateway_translate.rs) for free — so no Rust routing/validation or default-model changes were needed. The id flows verbatim to the Claude CLI --model arg, and every picker / /model / command-palette surface renders it automatically from the registry.

flowchart LR
    A["claude-fable-5 in MODELS"] --> B["buildModelRegistry()"]
    B --> C["Picker / /model / palette<br/>(auto-render)"]
    A --> D["--model claude-fable-5"]
    D --> E{"is_claude_code_model_alias?"}
    E -->|"starts_with('claude-') ✓"| F["Claude CLI resolves it"]
    A --> G["modelCapabilities Sets<br/>effort / xhigh / max"]
    A --> H["pricing.rs prefix lookup<br/>covers [1m] too"]
Loading

Complexity Notes

  • The capability Sets are the silent-failure risk. A model omitted from modelCapabilities.ts still works, but its effort/xhigh UI silently disappears. Fable 5 is added to EFFORT, XHIGH, and MAX (both the bare and [1m] ids), with matching tests pinning the exact profile — including an explicit isFastSupported('claude-fable-5') === false to lock in the "no fast mode" decision.
  • One pricing entry covers both ids. pricing::lookup matches by starts_with, so claude-fable-5[1m] resolves to the same claude-fable-5 row. A test asserts both.
  • The 1M variant uses the [1m] suffix, not a bare alias. Unlike the opus alias (whose id lacks [1m] and needs a special case in is1mContextModel), the suffixed id is detected automatically.

Test Steps

  1. Frontend unit: cd src/ui && bun run test — registry + capability suites pass (73 in those two files; 2809 total).
  2. Type-check: cd src/ui && bunx tsc -b — exits 0.
  3. Rust pricing: cargo test -p claudette pricing — includes lookup_fable_5_priced_at_2x_opus (asserts $30/$150 and that claude-fable-5[1m] resolves).
  4. Lint/format: cargo fmt --all --check, RUSTFLAGS="-Dwarnings" cargo clippy -p claudette -p claudette-cli --all-targets --all-features, cd src/ui && bun run lint:css — all clean.
  5. Manual (running app): open the chat model picker → Fable 5 and Fable 5 1M appear as primary (non-legacy) entries → select Fable 5 → the effort selector offers up to XHigh/Max, and fast mode is hidden → /model claude-fable-5 resolves the same way.

Checklist

  • Tests added/updated
  • Documentation updated (if applicable)

Add Fable 5 as a new Opus-class Anthropic model, selectable in the
picker without changing the default (Opus 4.8 stays default). Mirrors
the Opus 4.8 transition but for a brand-new, non-aliased name with a
1M-context variant.

- modelRegistry: add `claude-fable-5` (200K) and `claude-fable-5[1m]`
  (1M) entries plus the 1M -> 200K fallback. The `[1m]` suffix lets
  `is1mContextModel` classify the 1M variant with no special case.
- modelCapabilities: Fable 5 joins the effort, xhigh, and max sets
  (not fast — fast mode is Opus-4.6-only).
- pricing: `claude-fable-5` at $30/$150 per Mtok (2x Opus). The prefix
  `starts_with` lookup means one entry also covers the `[1m]` variant.
- Refresh the `xhigh requires Opus 4.7+` strings (CLI help, command
  palette) to include Fable 5.
- Docs: model table, default-model row, and `--model` flag examples.

The concrete `claude-` prefixed id passes the `is_claude_code_model_alias`
gate for free, so no Rust routing/validation or default-model changes
are required — the id flows verbatim to the Claude CLI `--model` arg and
every picker/slash-command surface renders it from the registry.
Copilot AI review requested due to automatic review settings June 10, 2026 12:41
@doomspork
doomspork requested a review from a team as a code owner June 10, 2026 12:41

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Adds Anthropic Claude Fable 5 (200K + [1m] variant) as a selectable Claude Code model across the UI/CLI surfaces, including capability gating (effort/xhigh/max), 1M→non‑1M fallback behavior, pricing for local aggregation, and docs/help-text updates—without changing the default model.

Changes:

  • Register claude-fable-5 and claude-fable-5[1m] in the UI model registry, including a 1M fallback mapping and coverage in registry tests.
  • Extend model capability allow-lists so Fable 5 supports effort + xhigh + max (but not fast), with targeted unit tests.
  • Add pricing lookup entry + test, and update CLI/help/docs strings to include Fable 5 in model/effort guidance.

Reviewed changes

Copilot reviewed 10 out of 10 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
src/usage/pricing.rs Adds pricing table entry for claude-fable-5 (covers [1m] via prefix match) and a test.
src/ui/src/components/command-palette/commands.ts Updates effort command description text to include Fable 5 for XHigh.
src/ui/src/components/chat/modelRegistry.ts Adds Fable 5 (200K + 1M) to MODELS and adds [1m] fallback mapping.
src/ui/src/components/chat/modelRegistry.test.ts Pins fallback behavior for claude-fable-5[1m] in tests.
src/ui/src/components/chat/modelCapabilities.ts Adds Fable 5 ids to effort/xhigh/max supported sets.
src/ui/src/components/chat/modelCapabilities.test.ts Adds tests ensuring Fable 5 supports effort/xhigh/max and does not support fast mode.
src-cli/src/commands/chat.rs Updates --effort help text to include Fable 5 for xhigh eligibility.
site/src/content/docs/features/settings.mdx Updates the Settings reference to list Fable 5 in the “Default model” description.
site/src/content/docs/features/cli-client.mdx Updates CLI docs: --model examples and --effort xhigh note include Fable 5.
site/src/content/docs/features/agent-configuration.mdx Documents Fable 5 model IDs and updates XHigh availability text.

Comment thread site/src/content/docs/features/agent-configuration.mdx Outdated
@codecov

codecov Bot commented Jun 10, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 81.00%. Comparing base (558b686) to head (6a40faf).

Additional details and impacted files

Impacted file tree graph

@@           Coverage Diff           @@
##             main     #995   +/-   ##
=======================================
  Coverage   81.00%   81.00%           
=======================================
  Files         123      123           
  Lines       46958    46965    +7     
=======================================
+ Hits        38039    38046    +7     
  Misses       8919     8919           
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

…able

The Reasoning Effort table's Max row still read "Opus and Sonnet", but
Fable 5 was added to MAX_EFFORT_MODELS, making the docs inaccurate
(flagged in PR review). Fable 5 is a new model family not covered by
"Opus"/"Sonnet", and it supports effort generally, so list it in the
Low/Medium/High/Max rows too for consistency with the already-updated
XHigh row.
@doomspork
doomspork merged commit a256209 into main Jun 10, 2026
16 checks passed
@doomspork
doomspork deleted the doomspork/add-fable-5-support branch June 10, 2026 17:06
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