Repository navigation
Conversation
Haiku 5.5+ runs adaptive thinking by default, binds thinking blocks to the conversation prefix, rejects non-default sampling parameters, and supports a 1M context window and 128K output. None of the model-name gates recognized Haiku, so it received budget thinking (400), no explicit disabled config, no block_binding (400 on edited history), sampling params, and a 100K context fallback. Fixes LibreChat-AI#16911 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Contributor
|
👋 Thanks for the contribution! LibreChat merges all changes into Nothing is needed from you; your commits, reviews and discussion are unchanged. If the diff now shows files you did not touch, rebase onto git remote add upstream https://github.com/LibreChat-AI/LibreChat.git
git fetch upstream dev
git rebase upstream/dev
git push --force-with-leaseMaintainers: apply the |
1 task done
This branch has not been deployed
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.
Pull Request
Summary
Claude Haiku 5.5 is not recognized by any of the model-name gates in
packages/data-provider/src/bedrock.ts, which only parse Opus and Sonnet versions (plus Mythos-class). Because the Anthropic, Bedrock and customprovider: anthropicendpoints all share these helpers, Haiku 5.5 is treated as a legacy Claude 4 model everywhere.That produces several failures. With thinking on, the request sends
{ type: "enabled", budget_tokens }, which Haiku 5.5 rejects with a 400. With thinking off, the field is omitted, so Haiku 5.5 still thinks, because it runs adaptive thinking by default. Thinking blocks are bound to the conversation prefix on Haiku 5.5, but the request carries neitherblock_binding: { prefix_mismatch_behavior: "drop_block" }nor thethinking-binding-controls-2026-08-01beta. Any conversation whose earlier turns LibreChat has edited or compacted therefore fails withInvalid signature in thinking block. The block is bound to a different conversation.Sampling parameters are sent although Haiku 5.5 rejects non-default values, thinking text comes back empty becausedisplayis never set tosummarized, and the context window falls back to the 100Kclaude-default instead of 1M.This PR adds a Haiku version parser and treats Haiku 5.5+ like the other current models in
supportsAdaptiveThinking,bindsThinkingBlocks,omitsThinkingByDefault,omitsSamplingParameters,requiresExplicitThinkingDisabled,capsEffortWhenThinkingDisabled,supportsContext1mandsupportsOutput128k. Haiku 4.5 and earlier are unchanged.Fixes #16911
How it works
Haiku 5.5 sits between Sonnet 5 and Sonnet 5.5 in the thinking contract. Omitting
thinkingruns adaptive thinking, and{ type: "disabled" }is accepted only at efforthighor below, as on Opus 5. Like Sonnet 5.5, it binds thinking blocks to the conversation. It does not acceptbetween_tools. Because of that,hasAlwaysOnThinkingandhasBetweenToolsThinkingFloorare left alone, and Haiku goes through the same explicit-disabled path as Opus 5 and Sonnet 5. Thinking off sends{ type: "disabled" }withoutblock_binding, which Haiku 5.5 rejects alongsidedisabled. That ordering already exists inconfigureReasoning.Type of change
Testing
Reproduced against
claude-haiku-5-5on Microsoft Foundry through a customprovider: anthropicendpoint. A follow-up turn in a conversation whose history had changed failed with the binding 400 above. With this change deployed, the same follow-up turn on Haiku 5.5 succeeds in production.Tested environments/configuration:
claude-haiku-5-5(custom endpoint,provider: anthropic)Automated tests:
packages/data-provider/specs/bedrock.spec.tsandpackages/api/src/utils/tokens.spec.ts, and confirmed that Haiku 4.5 keeps manual thinking.anthropic.claude-haiku-6to assert manual budget thinking. It now usesanthropic.claude-haiku-4-5, which keeps the test's intent (no context-1m beta), because Haiku 6 would fall under the 5.5+ contract.packages/data-providerfull suite andpackages/apisrc/utils/tokens.spec.ts+src/endpoints/anthropicpass.Screenshots / recordings
No user-facing change
Risk / compatibility
The gate is open-ended (Haiku ≥ 5.5), matching the Opus/Sonnet gates, so future Haiku versions inherit the modern contract.
Checklist
🤖 Generated with Claude Code