🎼 feat: Add Claude Sonnet 5.5 Support - #16460
Merged
Merged
Conversation
Sonnet 5.5 (`claude-sonnet-5-5`) rejects `thinking.type: disabled` and takes `between_tools` as its lowest thinking setting, binds thinking blocks to the conversation prefix, caps effort at `high` while thinking is off, rejects sampling parameters, supports the `updates` thinking display, and ships with 128k output / 1M context at Sonnet 5 pricing. Family gates in data-provider now use "5.5 or later" semantics so Opus 5.6+, Sonnet 5.6+ and the Mythos-class line (Fable) inherit the newest contract instead of falling back to the Opus 5 / Sonnet 5 paths.
Collaborator
Author
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
Codex Review: Didn't find any major issues. Swish! 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 file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Claude Sonnet 5.5 (
claude-sonnet-5-5) changed the thinking contract that LibreChat's Sonnet 5 handling relies on. With the Sonnet 5 path, turning thinking off sendsthinking: { type: 'disabled' }, which Sonnet 5.5 rejects with a 400 ("Usethinking.type.between_toolsfor the lowest thinking setting"). Effortxhigh/maxwith thinking off is also rejected, and the model rejectstemperature/top_p/top_k, binds thinking blocks to the conversation prefix, and supports a newupdatesthinking display.This PR adds Sonnet 5.5 support across the Anthropic, Bedrock and Vertex paths. The thinking toggle stays visible and "off" now maps to
between_tools. Effort is clamped tohighwhile thinking is off. Adaptive thinking carriesblock_binding: { prefix_mismatch_behavior: 'drop_block' }with thethinking-binding-controls-2026-08-01beta, so edited or compacted history drops only the invalidated blocks instead of failing. Thought Visibility gains anUpdatesoption, which adds thethinking-display-updates-2026-08-18beta. Sampling and thinking-budget controls are hidden. Token limits are 1M context and 128k output, and pricing matches Sonnet 5 ($2 in, $10 out, $2.50 cache write, $0.20 cache read).The family gates previously matched
major === 5 && minor === 5exactly, so Opus 5.6+/6 and Sonnet 5.6+/6 would have fallen back to the Opus 5 / Sonnet 5 paths (explicitdisabled→ 400, no binding, 64k output, wrong controls). The gates now mean "5.5 or later". The Mythos-class line (Fable/Mythos), which live probes show has the same always-on, bound contract as Opus 5.5, uses the same path. Before this change, turning thinking off for Fable was silently ignored. The toggle is now hidden and binding is sent.Related to LibreChat-AI/agents#575 and LibreChat-AI/agents#576 (existing SDK issues this model makes more visible: server web search turns dropped from replayed history, and the structured title method forcing
tool_choice).How it works
The Opus 5.5–specific checks become two capability gates, and everything else derives from them:
Resulting wire shapes for
claude-sonnet-5-5:thinking: { type: 'adaptive', display: 'summarized', block_binding: { prefix_mismatch_behavior: 'drop_block' } }, betathinking-binding-controls-2026-08-01,max_tokens: 128000thinking: { type: 'between_tools' },output_config.effort: 'high'display: 'updates', adds betathinking-display-updates-2026-08-18Type of change
Testing
Checked against the live API with
claude-sonnet-5-5: adaptive + binding + summarized → 200;between_tools+ efforthigh→ 200;display: 'updates'→ 200;disabled,between_tools+ effortmax, andtemperature→ 400 (the shapes this PR never sends). Tested end to end in the running app during launch preparation: thinking on/off, effort clamp, Updates display, built-in web search, a four-round code-tool loop with signed thinking blocks replayed, and editing the system prompt mid-conversation (binding drops blocks rather than 400ing).Fable 5.1 checked on the direct API and on Bedrock (
global.anthropic.claude-fable-5-1,us-west-2) using the exactadditionalModelRequestFieldsthe Bedrock parser produces (adaptive + binding + beta) → 200.block_bindingwithout the beta,disabled, andbetween_tools→ 400. Opus 5.5 returned the same validation errors on Bedrock. Its valid shapes passed validation but hitServiceUnavailable(capacity) on this account.Tested environments/configuration:
claude-sonnet-5-5,claude-opus-5-5,claude-fable-5-1; Bedrockglobal.anthropic.claude-fable-5-1Automated tests:
packages/data-provider:specs/bedrock.spec.ts,src/parameterSettings.spec.ts,src/config.spec.ts(497 passed), including later-release cases (claude-sonnet-5-6,claude-sonnet-6,claude-opus-6,claude-6-opus) and Opus 5 keeping its own pathpackages/api:src/endpoints/anthropic,src/utils/tokens.spec.ts,src/endpoints/openai/config.anthropic.spec.ts(235 passed)packages/data-schemas:src/methods/tx.spec.ts(284 passed)client: Anthropic settings, parameters panel and agent panel suites (64 passed)npx tsc --noEmitin data-provider, api and data-schemas;npm run static-checks -- --against origin/devpassesScreenshots / recordings
The only visible change is a new
Updatesstop on the Thought Visibility slider and new description text for the Thinking toggle on Sonnet 5.5 (and later) explaining that off keeps thinking between tool calls. For Opus 5.5 and later and for Fable/Mythos, the Thinking toggle is now hidden, as it already was for Opus 5.5.Risk / compatibility
Stored conversations and presets with
thinking: falseon Fable/Mythos now send adaptive thinking instead of an ignored "off". This matches what the API already did, because those models cannot run with thinking off. Bedrock Fable/Mythos requests now includeblock_bindingand the binding beta; verified live on Bedrock. Future Opus/Sonnet releases inherit the 5.5 contract by default. If a later model changes it again, it will need its own gate.Checklist