🤖 feat: promote Claude Sonnet 5.1 as the sonnet model - #3992
Conversation
|
@codex review |
|
Codex Review: Didn't find any major issues. You're on a roll. Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
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". |
This comment has been minimized.
This comment has been minimized.
…-5 until 5.1 exists
|
@codex review |
There was a problem hiding this comment.
💡 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".
This comment has been minimized.
This comment has been minimized.
|
@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. |
This comment has been minimized.
This comment has been minimized.
There was a problem hiding this comment.
💡 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".
|
@codex review Addressed the round-3 P2: the live-test flip-back to |
|
Codex Review: Didn't find any major issues. Keep it up! Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
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". |
Summary
Prepares Xum for a hypothetical Claude Sonnet 5.1 drop: promotes Sonnet 5.1 (
anthropic:claude-sonnet-5-1) to theSONNETknown model, so thesonnetalias, the/sonnetcommand, 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 stringanthropic:claude-sonnet-5and 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:
claude-sonnet-5-1.tests/ipc/streaming/sendMessage.reasoning.test.tsback toKNOWN_MODELS.SONNET.id(TODO(sonnet-5-1-release)marker) so live integration coverage exercises the promoted id.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:
claude-sonnet-5-1(dash form, dateless, matching the 5-generation convention ofclaude-sonnet-5/claude-opus-5, the dash style ofclaude-haiku-4-5, and the assumedclaude-fable-5-1in 🤖 feat: promote Claude Fable 5.1 as the fable model #3988).thinking: {type: "disabled"}still accepted (sooffstays 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 thesonnetalias and tokenizer warming; tokenizer override stays on the Sonnet 4.5 approximation). The retiredanthropic:claude-sonnet-5id joinsLEGACY_TOKENIZER_MODEL_OVERRIDESso 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 forclaude-fable-5/claude-opus-4-8).models-extra.ts: newclaude-sonnet-5-1pricing/limits entry; the Sonnet 5 entry is retained.models.ts:claude-sonnet-5-1added to the native-1M patterns — the existingclaude-sonnet-5pattern only tolerates date suffixes, not-1, exactly the trap 🤖 feat: promote Claude Fable 5.1 as the fable model #3988 documents for Fable.anthropicSupportsNativeXhighmatches anyclaude-sonnet-5+;anthropicRejectsDisabledThinkingcorrectly 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.DEFAULT_MODEL_FALLBACKShas noSONNETkey (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 nodefaultModelFallbacksSeededSonnet51flag is introduced; 🤖 feat: promote Claude Fable 5.1 as the fable model #3988'sdefaultModelFallbacksSeededFable51machinery andLEGACY_DEFAULT_MODEL_FALLBACKSare 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.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.tests/ipc/streaming/sendMessage.reasoning.test.tssends real Anthropic requests viaKNOWN_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-liveanthropic:claude-sonnet-5with a comment to flip back toKNOWN_MODELS.SONNET.idonce Sonnet 5.1 is live — a release-day follow-up item.Validation
Sonnet 5.1), 6-level thinking policy withoffpreserved (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.claude-sonnet-5fixtures 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
sonnetalias and/sonnetroute 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