Repository navigation
feat(anthropic): add Claude Haiku 5.5 - #4072
Merged
crazywoola merged 2 commits intoOct 19, 2026
Merged
Conversation
Register claude-haiku-5-5 as a predefined model. It shares Claude Opus 5's request shape: adaptive thinking on by default, thinking.type=disabled accepted only at effort high or below, effort and task budgets via output_config, native structured output, and no sampling parameters, budget_tokens or assistant prefill. Unlike Opus 5, the default effort is medium. Add claude-haiku-5 to the adaptive-thinking, default-on, disabled-thinking effort-cap and task-budget model lists, and default the custom-model schema's effort to medium for it. Pricing uses the rates for prompts up to 100K tokens ($0.10 / $0.50 per MTok); the over-100K rate card can't be expressed in the flat pricing schema. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
With thinking.display "omitted" (the default on adaptive-thinking models), the API streams each thinking block as one empty thinking_delta followed by a signature_delta. The stream handler opened the think tag at the first delta of any thinking block, so every streamed answer began with an empty think block, including structured-output JSON. Open the tag on the first non-empty thinking text instead, and close it only if it was opened. Redacted thinking still opens the tag at block start. The block-type state that drove the old close is no longer needed and is removed. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
crazywoola
approved these changes
Oct 19, 2026
6 of 15 tasks
This branch was successfully 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.
Summary
Closes #4071.
Adds
claude-haiku-5-5(released 2026-10-07) as a predefined model, following the official specifications.Haiku 5.5 has the same request shape as Claude Opus 5, which the plugin already supports. Thinking is adaptive and on by default,
thinking.type=disabledis accepted only at efforthighor below, and effort, task budgets and structured output all go throughoutput_config. Sampling parameters,budget_tokensand assistant prefill are rejected with a 400. The main difference from Opus 5 is that the default effort ismedium.So the change is:
claude-opus-5.yaml, with effort defaulting tomedium;claude-haiku-5added to the existing lists inllm.py: adaptive thinking, default-on thinking, the disabled-thinking effort cap, and task budgets. Prefill suppression and native 1M context come with the adaptive-thinking list;mediumfor Haiku 5.5, matching Opus 5.5;<think></think>at the start of every streamed answer when thinking display isomitted. That is the default for adaptive-thinking models, so it affects Opus 5 and Sonnet 5 today and would affect every Haiku 5.5 user.The think-tag fix. With display
omitted, the API streams each thinking block as one emptythinking_deltafollowed by asignature_delta. The handler opened the think tag on the first delta of any thinking block, so the answer began with<think>\n\n</think>\n\n, including structured-output JSON. The tag now opens on the first non-empty thinking text and closes only if it was opened. The block-type variable that drove the old close is no longer read, so it's removed. Summarized thinking streams exactly as before.The model-list part of the
llm.pychange shouldn't conflict with the open Anthropic PRs (#3967, #3976, #4034). The think-tag fix edits the same two close conditions as #3976, so whichever of the two merges second needs a small rebase. I'm happy to do it.Pricing uses the rates for prompts up to 100K tokens ($0.10 / $0.50 per MTok). Longer prompts are billed at $0.50 / $2.50, which the flat
pricingblock can't express; the YAML says so in a comment. Cache reads are 10% of input, which is the plugin's existing default multiplier.Release Notes
mediumdefault, task budgets, and native structured output.omitted.Change Type
LLM Plugin Checklist
Version
manifest.yamlversion to0.3.35.Testing
New
tests/test_haiku55_parameters.py(9 tests) covers:xhigh/maxwith thinking off;All 9 failed before the change.
Three new stream tests in
tests/test_stream_and_hardening.pyuse the event sequence the API sends with displayomitted: thinking followed by text, thinking followed by stop, and an empty first delta followed by real thinking text. The first two failed before the fix. The third passed before and after; it checks that real thinking still opens the tag once.uv run --frozen --python 3.12 pytest --ignore=tests/test_llm_live.py -q: 140 passed. Main has 128 and this PR adds 12.uv lock --checkandgit diff --checkpass.Dify CLI 0.6.11 packages the plugin.
Live, in a self-hosted Dify 1.17.1 against the Anthropic API: a build of this branch ran Haiku 5.5 on two LLM nodes of a chatflow, 111 calls across three settings, and none failed. One node had a structured-output schema; the other answered over prompts of about 11K tokens.
Effort and the thinking toggle took effect. On the answering node, median completion tokens were 1,024 at the default effort
medium, 873 atlowand 337 with thinking off, and median time to first answer text was 7.0 s, 6.1 s and 4.1 s.Structured output went through
output_config.format, and the node parsed it on all 60 calls.Dify's cost tracking matched the rates for prompts up to 100K tokens. No prompt reached 100K.
That run used the branch without the think-tag fix. 15 of its outputs began with an empty
<think></think>, which is how the bug was found. The plugin's stream log showed the event sequence that the new tests reproduce.One other existing behaviour showed up in that run, and this PR doesn't change it because it applies equally to the Opus 5 and Sonnet 5 models already in the plugin. The structured-output schema is passed through unchanged. Anthropic requires
additionalProperties: falseon every object, so a schema without it gets a 400 (output_config.format.schema: For 'object' type, 'additionalProperties' must be explicitly set to false). The same schema works on OpenAI models in Dify, so it shows up when a node is switched over. I can open a separate issue for it.🤖 Generated with Claude Code