Skip to content

🎼 feat: Add Claude Sonnet 5.5 Support - #16460

Merged
danny-avila merged 1 commit into
devfrom
danny-avila/claude-sonnet-5-5
Sep 28, 2026
Merged

danny-avila merged 1 commit into
devfrom
danny-avila/claude-sonnet-5-5

Conversation

@danny-avila

Copy link
Copy Markdown
Collaborator

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 sends thinking: { type: 'disabled' }, which Sonnet 5.5 rejects with a 400 ("Use thinking.type.between_tools for the lowest thinking setting"). Effort xhigh/max with thinking off is also rejected, and the model rejects temperature/top_p/top_k, binds thinking blocks to the conversation prefix, and supports a new updates thinking 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 to high while thinking is off. Adaptive thinking carries block_binding: { prefix_mismatch_behavior: 'drop_block' } with the thinking-binding-controls-2026-08-01 beta, so edited or compacted history drops only the invalidated blocks instead of failing. Thought Visibility gains an Updates option, which adds the thinking-display-updates-2026-08-18 beta. 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 === 5 exactly, so Opus 5.6+/6 and Sonnet 5.6+/6 would have fallen back to the Opus 5 / Sonnet 5 paths (explicit disabled → 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:

packages/data-provider/src/bedrock.ts
├── isAtLeast(version, major, minor)      # shared version comparison
├── hasAlwaysOnThinking                   # Opus ≥ 5.5, Fable/Mythos: toggle hidden, no off config
├── hasBetweenToolsThinkingFloor          # Sonnet ≥ 5.5: off → { type: 'between_tools' }
├── bindsThinkingBlocks                   # union of the two → block_binding + binding beta
├── supportsOutput128k                    # used by packages/api/src/utils/tokens.ts
├── resolveThinkingOffConfig              # between_tools | disabled (Opus 5 / Sonnet 5) | omit
└── capsEffortWhenThinkingDisabled        # Opus 5, Sonnet ≥ 5.5 → clamp xhigh/max to high

Resulting wire shapes for claude-sonnet-5-5:

UI setting Request
Thinking on (default) thinking: { type: 'adaptive', display: 'summarized', block_binding: { prefix_mismatch_behavior: 'drop_block' } }, beta thinking-binding-controls-2026-08-01, max_tokens: 128000
Thinking off, effort Max thinking: { type: 'between_tools' }, output_config.effort: 'high'
Thought Visibility: Updates display: 'updates', adds beta thinking-display-updates-2026-08-18

Type of change

  • Feature

Testing

Checked against the live API with claude-sonnet-5-5: adaptive + binding + summarized → 200; between_tools + effort high → 200; display: 'updates' → 200; disabled, between_tools + effort max, and temperature → 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 exact additionalModelRequestFields the Bedrock parser produces (adaptive + binding + beta) → 200. block_binding without the beta, disabled, and between_tools → 400. Opus 5.5 returned the same validation errors on Bedrock. Its valid shapes passed validation but hit ServiceUnavailable (capacity) on this account.

Tested environments/configuration:

  • Provider/model: Anthropic claude-sonnet-5-5, claude-opus-5-5, claude-fable-5-1; Bedrock global.anthropic.claude-fable-5-1
  • Browser: Chromium, localhost

Automated 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 path
  • packages/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 --noEmit in data-provider, api and data-schemas; npm run static-checks -- --against origin/dev passes

Screenshots / recordings

The only visible change is a new Updates stop 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: false on 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 include block_binding and 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

  • I reviewed my own changes
  • Relevant tests have been added or updated
  • Existing relevant tests pass
  • The change does not introduce new warnings or errors
  • User-facing or complex behavior is documented where necessary
  • Required dependency changes have been merged/published
  • Required documentation PR: N/A

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.
@danny-avila

Copy link
Copy Markdown
Collaborator Author

@codex review e31ae67

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Sep 28, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-09-28T18:24:04.462698Z e31ae67 Manual request
ℹ️ 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" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Swish!

Reviewed commit: e31ae67d24

ℹ️ 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".

@danny-avila
danny-avila merged commit 40bb16e into dev Sep 28, 2026
44 checks passed
@danny-avila
danny-avila deleted the danny-avila/claude-sonnet-5-5 branch September 28, 2026 19:35
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