Skip to content

feat: recognize Fable/Mythos model families with 1M context window - #133

Open
coocon wants to merge 2 commits into
Haleclipse:masterfrom
coocon:feat/fable-mythos-1m-context
Open

feat: recognize Fable/Mythos model families with 1M context window#133
coocon wants to merge 2 commits into
Haleclipse:masterfrom
coocon:feat/fable-mythos-1m-context

Conversation

@coocon

@coocon coocon commented Aug 14, 2026

Copy link
Copy Markdown

Problem

Claude Fable 5 / Mythos 5 (claude-fable-5, claude-mythos-5) don't match any built-in model family, so get_context_limit() falls back to the 200k default. These models ship with a 1M-token context window by default — no beta header needed, and the model ID carries no [1m] suffix, so the existing context modifier never triggers either.

Verified against a real Claude Code session: the statusline stdin reports model.id = "claude-fable-5", and the context bar renders used/200k instead of used/1M (e.g. 38% shown when the real usage is 7%).

Reference: Anthropic context windows docs — Fable 5 / Mythos 5 have a 1M window at standard pricing, on by default.

Change

Add two built-in families, reusing the existing version-extraction regex and keeping list order (specific third-party entries and context modifiers still take priority):

BuiltinModelFamily::new("fable", "Fable", 1_000_000),
BuiltinModelFamily::new("mythos", "Mythos", 1_000_000),

Regex behavior (verified with the generated pattern):

model id display name context limit
claude-fable-5 Fable 5 1,000,000
claude-fable-5-20260609 Fable 5 1,000,000
claude-fable-5-latest Fable 5 1,000,000
claude-mythos-5 Mythos 5 1,000,000
claude-sonnet-5 (unchanged) (unchanged)

Also updated the two comments listing recognized families (models.toml template + Default impl).

Not in scope

Newer Opus/Sonnet versions (Opus 4.6+/5, Sonnet 4.6/5) also moved to 1M-by-default on the API, but the BuiltinModelFamily struct has a single limit per family and older versions of those families are still 200k — making that version-aware is a larger design change, left out of this PR. Fable/Mythos are clean cases: every model in these families is 1M.

🤖 Generated with Claude Code

Summary by Sourcery

Add built-in recognition of Claude Fable and Mythos model families with correct 1M-token context limits.

New Features:

  • Recognize Claude Fable and Mythos model families as built-in models with a 1M-token context window.

Documentation:

  • Update configuration comments and template text to mention automatic recognition of Fable and Mythos alongside existing Claude families.

Claude Fable 5 / Mythos 5 (claude-fable-5, claude-mythos-5) are not
matched by any built-in family, so the context window falls back to
the 200k default while these models ship with a 1M-token context
window by default (no [1m] suffix in the model ID to trigger the
context modifier).

Add fable/mythos built-in families with a 1_000_000 limit, reusing
the existing version-extraction regex (claude-fable-5 -> "Fable 5").

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@sourcery-ai

sourcery-ai Bot commented Aug 14, 2026

Copy link
Copy Markdown
Reviewer's guide (collapsed on small PRs)

Reviewer's Guide

Adds new built-in model families for Anthropic Claude Fable and Mythos models with 1M-token context windows and updates documentation comments describing which Claude families are auto-recognized.

File-Level Changes

Change Details Files
Recognize Fable/Mythos Claude model families as built-in with 1M context limits.
  • Extend the built-in Claude model family list with Fable and Mythos entries using the existing BuiltinModelFamily::new helper and a 1,000,000-token limit.
  • Rely on the existing regex-based version extraction so that claude-fable-5 and claude-mythos-5 variants (including date-suffixed and -latest forms) resolve to these families and get the correct context window.
src/config/models.rs
Update inline documentation to reflect the new auto-recognized families.
  • Adjust the models.toml template comment to list Fable and Mythos alongside Sonnet, Opus, and Haiku as automatically recognized Claude families.
  • Update the ModelConfig::default comment so it notes that Claude Fable and Mythos models are handled by built-in regex families and do not need explicit entries.
src/config/models.rs

Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it. You can also reply to a
    review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
    pull request to resolve all Sourcery comments. Useful if you've already
    addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
    request to dismiss all existing Sourcery reviews. Especially useful if you
    want to start fresh with a new review - don't forget to comment
    @sourcery-ai review to trigger a new review!

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

@sourcery-ai sourcery-ai 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.

Hey - I've left some high level feedback:

  • Consider extracting the 1,000,000 context limit into a named constant so that future 1M families (or changes to the default window) can be updated in one place rather than hard-coded per family.
  • The new comment "Mythos-class models (Fable 5 / Mythos 5)" may be confusing; consider rephrasing to more directly match Anthropic’s terminology (e.g., "Fable 5 and Mythos 5 models") for clarity.
Prompt for AI Agents
Please address the comments from this code review:

## Overall Comments
- Consider extracting the 1,000,000 context limit into a named constant so that future 1M families (or changes to the default window) can be updated in one place rather than hard-coded per family.
- The new comment "Mythos-class models (Fable 5 / Mythos 5)" may be confusing; consider rephrasing to more directly match Anthropic’s terminology (e.g., "Fable 5 and Mythos 5 models") for clarity.

Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@coocon

coocon commented Aug 14, 2026

Copy link
Copy Markdown
Author

Addressed the review:

  • Comment wording: reworded to "Fable 5 and Mythos 5 models ship with a 1M-token context window by default" (20491db).
  • Named constant for 1,000,000: opted to keep the inline literal — the surrounding built-in family list and the Default impl already use inline limits (200_000 ×3, 1_000_000 in the [1m] modifier), so a constant for just these two entries would be inconsistent with local style. Happy to extract one for all limits if the maintainer prefers.

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.

1 participant