Skip to content

🤖 feat: promote Claude Sonnet 5.1 as the sonnet model - #3992

Open
ThomasK33 wants to merge 3 commits into
mike/fable-5-1-dropfrom
sonnet-51-prep
Open

🤖 feat: promote Claude Sonnet 5.1 as the sonnet model#3992
ThomasK33 wants to merge 3 commits into
mike/fable-5-1-dropfrom
sonnet-51-prep

Conversation

@ThomasK33

@ThomasK33 ThomasK33 commented Aug 27, 2026

Copy link
Copy Markdown
Member

Summary

Prepares Xum for a hypothetical Claude Sonnet 5.1 drop: promotes Sonnet 5.1 (anthropic:claude-sonnet-5-1) to the SONNET known model, so the sonnet alias, the /sonnet command, tokenizer warming, and the first-time mux-gateway default model list all route to the new model. Sonnet 5 stays usable as the custom model string anthropic:claude-sonnet-5 and keeps its metadata entry and tokenizer approximation.

Stacked on #3988 (base branch mike/fable-5-1-drop), so this diff is Sonnet-only and does not touch the Fable 5.1 work.

Important

Merge gate: hold until Anthropic officially announces Sonnet 5.1, then verify the assumptions below against the announcement before merging. Merging early would break sonnet-alias sends (the API id would not exist yet).

Release-day checklist before merging:

  1. Confirm the API id is exactly claude-sonnet-5-1.
  2. Confirm pricing and envelope against the announcement (assumptions below).
  3. Flip tests/ipc/streaming/sendMessage.reasoning.test.ts back to KNOWN_MODELS.SONNET.id (TODO(sonnet-5-1-release) marker) so live integration coverage exercises the promoted id.
  4. If Sonnet 5.1 ships safeguard classifiers (unlike Sonnet 5), add a refusal-fallback chain + one-shot seed flag first (see Implementation).

Sonnet 5.1 is the most speculative of the three 5.1 prep PRs (Fable #3988, Opus, Sonnet): rumors point at Fable 5.1 with Opus 5.1 as likely and Sonnet 5.1 as possible. This model may never ship; if the announcement omits it, close this PR unmerged.

Background

Sonnet 5.1 is not announced; leak reports around the Fable 5.1 drop only possibly include it. This PR is prepared ahead of the drop (same play as #3988 for Fable 5.1 and #3750 for Opus 5), with assumptions to confirm on release day. All three are guesses extrapolated from Anthropic's current conventions and from Sonnet 5's published envelope — none is confirmed by any announcement:

  • API id (guess, by convention): claude-sonnet-5-1 (dash form, dateless, matching the 5-generation convention of claude-sonnet-5 / claude-opus-5, the dash style of claude-haiku-4-5, and the assumed claude-fable-5-1 in 🤖 feat: promote Claude Fable 5.1 as the fable model #3988).
  • Pricing (guess, no signal either way): unchanged from Sonnet 5's standard rate, $3/M input, $15/M output (cache write 1.25x input, cache read 0.1x input). Assumes no introductory discount like Sonnet 5's $2/$10 launch promo; if 5.1 launches with one, we list the standard rate anyway (same choice as the Sonnet 5 entry) so estimates stay correct once a promo ends.
  • Envelope (guess, mirrors Sonnet 5): native 1M context, 128K max output, full 6-level effort ladder with native xhigh, adaptive thinking with thinking: {type: "disabled"} still accepted (so off stays available — Sonnet's ladder deliberately differs from Fable/Mythos, which reject disabled thinking), and no safeguard classifiers (so no default refusal-fallback chain; see below).

Implementation

Mirrors #3988's Fable promotion, adjusted for what the Sonnet 5 entry does today:

  • knownModels.ts: SONNET -> claude-sonnet-5-1 (keeps the sonnet alias and tokenizer warming; tokenizer override stays on the Sonnet 4.5 approximation). The retired anthropic:claude-sonnet-5 id joins LEGACY_TOKENIZER_MODEL_OVERRIDES so exact-id lookup keeps its approximate tokenizer instead of warning and falling back to the generic per-provider tokenizer (the trap 🤖 feat: promote Claude Fable 5.1 as the fable model #3988 round 1 fixed for claude-fable-5/claude-opus-4-8).
  • models-extra.ts: new claude-sonnet-5-1 pricing/limits entry; the Sonnet 5 entry is retained.
  • models.ts: claude-sonnet-5-1 added to the native-1M patterns — the existing claude-sonnet-5 pattern only tolerates date suffixes, not -1, exactly the trap 🤖 feat: promote Claude Fable 5.1 as the fable model #3988 documents for Fable.
  • No wire-format changes needed for thinking/effort: the wildcard matchers already cover the new id (anthropicSupportsNativeXhigh matches any claude-sonnet-5+; anthropicRejectsDisabledThinking correctly does NOT match Sonnet, which is Mythos-class-only) and native web-fetch id parsing handles the two-segment id. Tests now pin all of that rather than assuming.
  • No fallback seed migration needed — deliberate divergence from 🤖 feat: promote Claude Fable 5.1 as the fable model #3988: DEFAULT_MODEL_FALLBACKS has no SONNET key (refusal fallback exists for Fable's safeguard classifiers; Sonnet 5 has none, and we assume 5.1 keeps none). With no default chain keyed by the moving id, there is no seed gap, so no defaultModelFallbacksSeededSonnet51 flag is introduced; 🤖 feat: promote Claude Fable 5.1 as the fable model #3988's defaultModelFallbacksSeededFable51 machinery and LEGACY_DEFAULT_MODEL_FALLBACKS are untouched, user-edited chains are never rewritten, and legacy chains stay byte-identical on disk. If the announcement reveals Sonnet 5.1 ships safeguard classifiers, this PR must grow the equivalent chain + one-shot flag before merge.
  • First-time mux-gateway default models list moves anthropic/claude-sonnet-5 -> anthropic/claude-sonnet-5-1 (precedent: 🤖 feat: add support for Claude Opus 5 #3750 did the same for the Opus 4.8 -> 5 move). Existing configured model lists are untouched.
  • Docs model table and built-in skill content regenerated.
  • Live-API integration tests pinned: tests/ipc/streaming/sendMessage.reasoning.test.ts sends real Anthropic requests via KNOWN_MODELS.SONNET.id, which would 404 until the announcement (the merge-gate problem, but biting PR CI immediately). Those tests are pinned to the still-live anthropic:claude-sonnet-5 with a comment to flip back to KNOWN_MODELS.SONNET.id once Sonnet 5.1 is live — a release-day follow-up item.

Validation

  • Behavioral coverage added for the new id: native-1M classification (including the gateway-prefixed form and the date-suffix-only pattern trap), display formatting (Sonnet 5.1), 6-level thinking policy with off preserved (pinning that Sonnet does NOT get the Mythos-class off-clamp), provider options (adaptive + summarized display, native xhigh/max effort, off -> thinking: {type: "disabled"}), no Xum-internal effort header, and native web-fetch support for the two-segment id.
  • The alias flip was caught by (and updated in) the slash-command parser test, the task-tool alias resolution test, the mux-gateway first-time seed test, and the e2e slash-command scenario + mock router.
  • Remaining claude-sonnet-5 fixtures were audited and stay valid as explicit custom model strings (story fixture, legacy-id assertions, retained metadata entry).

Risks

Low mechanically: additive registry/metadata changes with no config migration. The main user-visible effect is that the sonnet alias and /sonnet route to Sonnet 5.1 — until the model exists at the API, those sends would 404, which is why the merge gate above matters (and why it is stricter here: this model is not confirmed to exist at all). Existing Sonnet 5 selections keep working via the custom model string, and cost estimates for it keep resolving through the legacy tokenizer override. Stacked-base risk: if #3988 changes shape before merge, this branch must rebase onto it.


Generated with xum • Model: anthropic:claude-fable-5 • Thinking: xhigh

@ThomasK33

Copy link
Copy Markdown
Member Author

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. You're on a roll.

Reviewed commit: e01cbaf168

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@chatgpt-codex-connector

This comment has been minimized.

@ThomasK33

Copy link
Copy Markdown
Member Author

@codex review

@chatgpt-codex-connector chatgpt-codex-connector 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.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: da0aa90201

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread src/common/constants/knownModels.ts
@chatgpt-codex-connector

This comment has been minimized.

@ThomasK33

Copy link
Copy Markdown
Member Author

@codex review

Please take another look. Re: the round-2 P1 ("keep the sonnet alias on an available model"): the alias flip is the deliberate purpose of this prep PR and is guarded by the human-held merge gate in the PR description (HOLD until Anthropic officially announces Sonnet 5.1; close unmerged if it never ships) — the same accepted pattern as #3988 (Fable 5.1) and #3750 (Opus 5). Responded inline and resolved the thread; no code change made.

@chatgpt-codex-connector

This comment has been minimized.

@chatgpt-codex-connector chatgpt-codex-connector 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.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: da0aa90201

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread tests/ipc/streaming/sendMessage.reasoning.test.ts
@ThomasK33

Copy link
Copy Markdown
Member Author

@codex review

Addressed the round-3 P2: the live-test flip-back to KNOWN_MODELS.SONNET.id is now an explicit release-day merge-gate item — TODO(sonnet-5-1-release) marker in sendMessage.reasoning.test.ts (4ca4353) plus a release-day checklist in the PR description. It cannot flip in this PR because the id does not exist at the API yet.

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Keep it up!

Reviewed commit: 4ca4353ad4

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@chatgpt-codex-connector

This comment has been minimized.

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