Conversation
WH-2099
force-pushed
the
feat/anthropic-opus-5-5
branch
from
September 22, 2026 19:53
498c84d to
5c01e55
Compare
Contributor
There was a problem hiding this comment.
Copilot review overview
🟡 Changes recommended
Empty truncated tool arguments can still be replayed, and opaque replay bypasses configured assistant prompt caching.
Get a fresh assessment by requesting another Copilot review.
Review effort: Balanced
Findings: 2
Open (2)
What changed in this PR
Adds Claude Opus 5.5 support and replaces shared thinking state with per-message content replay.
Changes:
- Registers Opus 5.5 with updated capabilities, pricing, and adaptive-thinking defaults.
- Preserves ordered Anthropic content blocks across tool rounds.
- Refreshes dependencies, tests, documentation, and plugin metadata.
| File | Description |
|---|---|
models/anthropic/models/llm/llm.py |
Implements model handling and content replay. |
models/anthropic/models/llm/claude-opus-5-5.yaml |
Defines Opus 5.5 capabilities and pricing. |
models/anthropic/models/llm/_position.yaml |
Adds the model to display ordering. |
models/anthropic/tests/test_thinking_replay.py |
Tests ordered multi-turn replay and truncation. |
models/anthropic/tests/test_opus5_parameters.py |
Tests Opus 5.5 schema and request parameters. |
models/anthropic/tests/test_llm.py |
Tests classification and cache pricing. |
models/anthropic/README.md |
Documents Opus 5.5 behavior. |
models/anthropic/pyproject.toml |
Updates direct dependencies. |
models/anthropic/uv.lock |
Refreshes resolved dependencies. |
models/anthropic/manifest.yaml |
Bumps the plugin version. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Comment on lines
+1312
to
+1320
| for block in content_blocks: | ||
| if block["type"] == "tool_use" and tool_params_by_id.get(block["id"]): | ||
| try: | ||
| block["input"] = json.loads(tool_params_by_id[block["id"]]) | ||
| except json.JSONDecodeError as ex: | ||
| raise InvokeError( | ||
| f"Anthropic returned incomplete tool arguments (stop_reason={finish_reason}). " | ||
| "Increase max_tokens and retry." | ||
| ) from ex |
WH-2099
force-pushed
the
feat/anthropic-opus-5-5
branch
from
September 22, 2026 20:18
5c01e55 to
1c274cb
Compare
Contributor
There was a problem hiding this comment.
Copilot review overview
🟡 Changes recommended
Image retention is applied to every vision provider, regressing providers that only support images on the initial tool-loop request.
Get a fresh assessment by requesting another Copilot review.
Review effort: Balanced
Findings: 2
Open (2)
Resolved since last review (1)
Comment on lines
+896
to
898
| # Keep the original prefix across tool rounds for signed reasoning replay. | ||
| if not supports_vision: | ||
| prompt_messages = self._clear_user_prompt_image_messages(prompt_messages) |
WH-2099
marked this pull request as draft
September 22, 2026 20:49
4 tasks
7 tasks
3 tasks
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.

Summary
Closes #3916.
Adds
claude-opus-5-5using the official specifications and migration requirements.The model has a 1M-token context, 128K-token output limit, always-on adaptive thinking, and a
mediumeffort default.Standard input/output pricing is $4/$20 per million tokens, with cache reads charged at 5% of the input rate.
Existing request handling supplies adaptive thinking, strips unsupported sampling parameters, and reuses native structured output and automatic tool choice.
Preserves each response's complete content in its own assistant message and replays those blocks in their original order.
Function Calling Agent retains this metadata in streaming and non-streaming tool loops, preserves images, freezes tool schemas, and leaves the caller’s initial history list intact.
Function Calling and ReAct check configured or schema-default output budgets before every request and stop on exhausted context without lowering the output limit below a thinking budget.
Replayed text and tool-use blocks retain the configured cache thresholds and TTL, with the existing four-breakpoint limit.
This replaces the shared latest-thinking state, which could inject a later signature into earlier messages and violate Opus 5.5's thinking-prefix binding during multi-turn tool use.
Refreshes direct and transitive dependencies to current stable releases, including Anthropic SDK 1.8.0 and pyrefly 1.3.1.
Cross-repository dependencies
Keep this PR in draft until the replay fixes are released and the complete deployed combination is verified.
The plugin lockfile currently pins SDK commit
5d5799eeceb938eda4337bcd229f3dcf41b27596from SDK #390; replace this source override with its published version before release.The host also requires Graphon #261, Dify #41095, and daemon #828.
Dify currently pins Graphon 0.7, so its review build uses a 0.7 backport rather than the incompatible Graphon 0.8 runtime.
The final minimum Dify version and daemon image must come from actual containing releases; existing manifest minima do not certify this replay support.
Cross-session history restoration is outside this in-memory tool-loop fix.
Release Notes
Change Type
LLM Plugin Checklist
Version
manifest.yamlversion to0.3.33.manifest.yamlversion to0.0.49; upgrade it alongside the Anthropic plugin for the Function Calling Agent fix.dify_plugin>=0.10.2; both plugins lock the immutable SDK fix above.Testing
uv run --locked pytest --ignore=tests/test_llm_live.py -q— 119 passed.uv run --locked pytest -q— 82 passed.uv lock --check, new model validation withAIModelEntity, andgit diff --checkpassed.