-
Notifications
You must be signed in to change notification settings - Fork 82
Backport anthropic models #2393
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Backport anthropic models #2393
Conversation
This commit introduces support for the Anthropic Claude Opus 4.5 model, including its integration into the language model registry, toolbar, and node conversion utilities. It also adds necessary fallback logic for model ID parsing and updates pricing information. Co-authored-by: satoshi.toyama <[email protected]>
|
Cursor Agent can help with this pull request. Just |
|
|
Finished running flow.
|
||||||||||||||||||
WalkthroughAdds support for Anthropic Claude Opus 4.5: model definition, pricing, parsing/fallback handling, UI inclusion in the toolbar for non-free users, node registry mappings and fixtures, and tests covering parsing and node-conversion round-trips. Changes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes
Poem
Pre-merge checks and finishing touches❌ Failed checks (1 warning, 1 inconclusive)
✅ Passed checks (1 passed)
✨ Finishing touches
🧪 Generate unit tests (beta)
📜 Recent review detailsConfiguration used: CodeRabbit UI Review profile: CHILL Plan: Pro 📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (3)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
This comment was marked as outdated.
This comment was marked as outdated.
|
Finished running flow.
|
||||||||||||||||||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
This PR backports Claude Opus 4.5 from the language-model-registry to the language-model package, enabling its use in classic text-generation nodes and the UI. The key changes include adding the model definition with pricing, implementing fallback parsing logic for various model name aliases, and updating the UI to display it as a recommended option for pro users.
Key Changes:
- Added
claude-opus-4.5model definition with capabilities, tier restrictions, and pricing ($5/$25 per mega-token for input/output) - Implemented bidirectional conversion between text-generation and content-generation node formats to prevent model downgrading
- Updated UI to include the new model in the recommended Anthropic models list for pro users
Reviewed changes
Copilot reviewed 7 out of 7 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
packages/language-model/src/anthropic.ts |
Added model definition, fallback regex patterns for aliases, and exported the model in the models array |
packages/language-model/src/costs/model-prices.ts |
Defined pricing structure with effective date of March 31, 2025 |
packages/language-model/src/anthropic.test.ts |
Added test cases for parsing the new model ID and its various alias patterns |
packages/node-registry/src/node-conversion.ts |
Updated conversion helpers to correctly map claude-opus-4.5 bidirectionally without downgrading |
packages/node-registry/src/node-conversion.test.ts |
Added test cases for model conversion and round-trip preservation |
packages/node-registry/src/__fixtures__/node-conversion/nodes.ts |
Created fixture data for the new model with sample configuration |
internal-packages/workflow-designer-ui/src/editor/tool/toolbar/toolbar.tsx |
Added the model to the recommended list for pro users in the UI |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
PR Compliance Guide 🔍Below is a summary of compliance checks for this PR:
Compliance status legend🟢 - Fully Compliant🟡 - Partial Compliant 🔴 - Not Compliant ⚪ - Requires Further Human Verification 🏷️ - Compliance label |
|||||||||||||||||||||||
PR Code Suggestions ✨Explore these optional code suggestions:
|
||||||||||||
🔍 QA Testing Assistant by Giselle📋 Manual QA ChecklistBased on the changes in this PR, here are the key areas to test manually:
✨ Prompt for AI AgentsUse the following prompts with Cursor or Claude Code to automate E2E testing: 📝 E2E Test Generation Prompt |
shige
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you! 🆕
| prices: [ | ||
| { | ||
| validFrom: "2025-03-31T00:00:00Z", | ||
| price: { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Co-authored-by: Tadashi Shigeoka <[email protected]>
| "claude-opus-4.5": { | ||
| prices: [ | ||
| { | ||
| validFrom: "2025-11-25T00:00:00Z", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Bug: Incorrect pricing valid date for Claude Opus 4.5
The validFrom date for claude-opus-4.5 pricing is set to "2025-11-25T00:00:00Z" (November 25, 2025), but Claude Opus 4.5 was officially released on November 24, 2025 according to Anthropic's announcement. This off-by-one date discrepancy could cause pricing lookups to fail for usage on the release day, since getValidPricing filters by new Date(price.validFrom) <= now.

User description
Summary
Backports the latest Anthropic model, Claude Opus 4.5, from
language-model-registrytolanguage-model, enabling its use in classic text-generation nodes and the UI.Related Issue
Referenced #2391 for context on adding Anthropic models.
Changes
packages/language-model: Definedclaude-opus-4.5model, pricing, and parsing logic, including fallbacks for various aliases.packages/node-registry: Updated model conversion helpers and added tests to correctly mapclaude-opus-4.5between node formats without downgrading.internal-packages/workflow-designer-ui: Addedclaude-opus-4.5to the recommended Anthropic model list for pro users in the UI.Testing
pnpm install,pnpm format,pnpm build-sdk,pnpm check-types,pnpm tidy, andpnpm testcommands all succeeded.Other Information
This implementation focuses on the minimal changes required to integrate the new model, avoiding deeper structural or design changes as per the task instructions.
PR Type
Enhancement
Description
Add Claude Opus 4.5 model support across language model packages
Implement model ID parsing with fallback logic for various aliases
Update pricing information for Claude Opus 4.5 model
Add comprehensive unit tests for model conversion and round-trip validation
Include Claude Opus 4.5 in UI toolbar for pro users
Diagram Walkthrough
File Walkthrough
anthropic.ts
Add Claude Opus 4.5 model definition and parsingpackages/language-model/src/anthropic.ts
claude-opus-4.5to the enum of supported Anthropic model IDs(
claude-opus-4-5-*,claude-4-5-opus-*,claude-4.5-opus-*)claude45Opusmodel definition with TextGeneration, Reasoning,and file input capabilities
toolbar.tsx
Add Claude Opus 4.5 to UI toolbarinternal-packages/workflow-designer-ui/src/editor/tool/toolbar/toolbar.tsx
claude-opus-4.5to the list of available Anthropic models forpro users
anthropic.test.ts
Add model ID parsing tests for Claude Opus 4.5packages/language-model/src/anthropic.test.ts
claude-opus-4.5enum value4.5 alias formats
claude-opus-4-5-*,claude-4-5-opus-*, andclaude-4.5-opus-*patternsnodes.ts
Add Claude Opus 4.5 test fixture nodepackages/node-registry/src/fixtures/node-conversion/nodes.ts
anthropicClaudeOpus45fixture node with Claude Opus 4.5 modelconfiguration
prompt
node-conversion.test.ts
Add Claude Opus 4.5 node conversion testspackages/node-registry/src/node-conversion.test.ts
anthropicClaudeOpus45fixtureContentGeneration format
ContentGeneration to TextGeneration format
bidirectional conversion
model-prices.ts
Add Claude Opus 4.5 pricing informationpackages/language-model/src/costs/model-prices.ts
claude-opus-4.5modeltoken
node-conversion.ts
Fix Claude Opus 4.5 model conversion mappingpackages/node-registry/src/node-conversion.ts
claude-opus-4.5in TextGeneration to ContentGenerationconversion mapping
claude-opus-4.5instead ofdowngrading to
claude-opus-4-1-20250805Summary by CodeRabbit
New Features
Tests
Chores
✏️ Tip: You can customize this high-level summary in your review settings.
Note
Adds Anthropic
claude-opus-4.5across model registry, pricing, node conversions, and UI, with robust ID parsing and tests.claude-opus-4.5toAnthropicLanguageModelIdwith alias fallbacks and defaulting.capabilities,tier) and include in exportedmodels.claude-opus-4.5inpackages/language-model/src/costs/model-prices.ts.claude-opus-4.5in both conversion directions without downgrading; add fixture node.claude-opus-4.5in pro-tier Anthropic recommendations ininternal-packages/workflow-designer-ui/src/editor/tool/toolbar/toolbar.tsx.AnthropicLanguageModelIdfallbacks.claude-opus-4.5.Written by Cursor Bugbot for commit d51a467. This will update automatically on new commits. Configure here.