-
-
Notifications
You must be signed in to change notification settings - Fork 890
feat: Add Claude Opus 4.5 model via OpenRouter #350
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
base: main
Are you sure you want to change the base?
Conversation
- Add anthropic/claude-opus-4.5 with aliases: opus, opus4.5, claude-opus - Set intelligence_score to 18 (matching Gemini 3 Pro) - Update Opus 4.1 to use opus4.1 alias only - Update tests to reflect new alias mappings Note: supports_function_calling and supports_json_mode set to false following existing project pattern for Claude models, despite OpenRouter API support for these features.
Summary of ChangesHello @brt-h, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request integrates the new Anthropic Claude Opus 4.5 model into the system via OpenRouter, expanding the range of available AI models. It reconfigures existing model aliases to prioritize the new Opus version while maintaining access to the previous one, and includes comprehensive test updates to validate these changes and ensure system stability. Highlights
Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here. You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension. Footnotes
|
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.
Code Review
This pull request adds support for the Claude Opus 4.5 model via OpenRouter, which includes updating the model configuration and relevant tests. The changes are well-implemented and the test updates are thorough. My feedback focuses on enhancing the test coverage to be even more comprehensive, ensuring all new aliases and capabilities are fully validated.
| # Test known model (opus alias now points to 4.5) | ||
| caps = registry.get_capabilities("opus") | ||
| assert caps is not None | ||
| assert caps.model_name == "anthropic/claude-opus-4.1" | ||
| assert caps.model_name == "anthropic/claude-opus-4.5" | ||
| assert caps.context_window == 200000 # Claude's context window | ||
|
|
||
| # Test using full model name | ||
| # Test using full model name for 4.1 | ||
| caps = registry.get_capabilities("anthropic/claude-opus-4.1") | ||
| assert caps is not None | ||
| assert caps.model_name == "anthropic/claude-opus-4.1" | ||
|
|
||
| # Test opus4.1 alias still works | ||
| caps = registry.get_capabilities("opus4.1") | ||
| assert caps is not None | ||
| assert caps.model_name == "anthropic/claude-opus-4.1" |
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.
The test for get_capabilities is good, but it could be more comprehensive. It currently tests opus, anthropic/claude-opus-4.1, and opus4.1. To ensure full coverage for the new model, I suggest also testing anthropic/claude-opus-4.5 by its full name and its other new alias opus4.5.
# Test known model (opus alias now points to 4.5)
caps = registry.get_capabilities("opus")
assert caps is not None
assert caps.model_name == "anthropic/claude-opus-4.5"
assert caps.context_window == 200000 # Claude's context window
# Test using full model name for 4.5
caps = registry.get_capabilities("anthropic/claude-opus-4.5")
assert caps is not None
assert caps.model_name == "anthropic/claude-opus-4.5"
# Test opus4.5 alias
caps = registry.get_capabilities("opus4.5")
assert caps is not None
assert caps.model_name == "anthropic/claude-opus-4.5"
# Test using full model name for 4.1
caps = registry.get_capabilities("anthropic/claude-opus-4.1")
assert caps is not None
assert caps.model_name == "anthropic/claude-opus-4.1"
# Test opus4.1 alias still works
caps = registry.get_capabilities("opus4.1")
assert caps is not None
assert caps.model_name == "anthropic/claude-opus-4.1"| ("opus", "anthropic/claude-opus-4.5"), # opus now points to 4.5 | ||
| ("OPUS", "anthropic/claude-opus-4.5"), # Case insensitive | ||
| ("opus4.5", "anthropic/claude-opus-4.5"), | ||
| ("opus4.1", "anthropic/claude-opus-4.1"), # 4.1 still accessible |
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.
The test_cases for alias resolution are good. However, the claude-opus alias, which was migrated to claude-opus-4.5, is not tested. It would be good to add a test case for it to ensure all aliases for the new model are covered.
| ("opus", "anthropic/claude-opus-4.5"), # opus now points to 4.5 | |
| ("OPUS", "anthropic/claude-opus-4.5"), # Case insensitive | |
| ("opus4.5", "anthropic/claude-opus-4.5"), | |
| ("opus4.1", "anthropic/claude-opus-4.1"), # 4.1 still accessible | |
| ("opus", "anthropic/claude-opus-4.5"), # opus now points to 4.5 | |
| ("OPUS", "anthropic/claude-opus-4.5"), # Case insensitive | |
| ("claude-opus", "anthropic/claude-opus-4.5"), | |
| ("opus4.5", "anthropic/claude-opus-4.5"), | |
| ("opus4.1", "anthropic/claude-opus-4.1"), # 4.1 still accessible |
Address review feedback: - Add test for claude-opus alias in test_alias_resolution - Add tests for anthropic/claude-opus-4.5 full name and opus4.5 alias in test_registry_capabilities
|
/gemini review |
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.
Code Review
This pull request adds support for the Claude Opus 4.5 model via OpenRouter, updating the opus alias to point to this new model and introducing opus4.1 for the previous version. The changes in conf/openrouter_models.json are correct, and the test suites in tests/test_openrouter_provider.py and tests/test_openrouter_registry.py have been updated accordingly to reflect these new model mappings. The changes are well-documented in the PR description. I have one suggestion to improve the test code by reducing duplication, which will enhance maintainability.
| # Test known model (opus alias now points to 4.5) | ||
| caps = registry.get_capabilities("opus") | ||
| assert caps is not None | ||
| assert caps.model_name == "anthropic/claude-opus-4.1" | ||
| assert caps.model_name == "anthropic/claude-opus-4.5" | ||
| assert caps.context_window == 200000 # Claude's context window | ||
|
|
||
| # Test using full model name | ||
| # Test using full model name for 4.5 | ||
| caps = registry.get_capabilities("anthropic/claude-opus-4.5") | ||
| assert caps is not None | ||
| assert caps.model_name == "anthropic/claude-opus-4.5" | ||
|
|
||
| # Test opus4.5 alias | ||
| caps = registry.get_capabilities("opus4.5") | ||
| assert caps is not None | ||
| assert caps.model_name == "anthropic/claude-opus-4.5" | ||
|
|
||
| # Test using full model name for 4.1 | ||
| caps = registry.get_capabilities("anthropic/claude-opus-4.1") | ||
| assert caps is not None | ||
| assert caps.model_name == "anthropic/claude-opus-4.1" | ||
|
|
||
| # Test opus4.1 alias still works | ||
| caps = registry.get_capabilities("opus4.1") | ||
| assert caps is not None | ||
| assert caps.model_name == "anthropic/claude-opus-4.1" |
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.
To improve maintainability and reduce code duplication, you could parameterize these test cases. This would make the test more concise and easier to extend in the future. You can group the tests for Opus 4.5 and 4.1 variants using a loop.
| # Test known model (opus alias now points to 4.5) | |
| caps = registry.get_capabilities("opus") | |
| assert caps is not None | |
| assert caps.model_name == "anthropic/claude-opus-4.1" | |
| assert caps.model_name == "anthropic/claude-opus-4.5" | |
| assert caps.context_window == 200000 # Claude's context window | |
| # Test using full model name | |
| # Test using full model name for 4.5 | |
| caps = registry.get_capabilities("anthropic/claude-opus-4.5") | |
| assert caps is not None | |
| assert caps.model_name == "anthropic/claude-opus-4.5" | |
| # Test opus4.5 alias | |
| caps = registry.get_capabilities("opus4.5") | |
| assert caps is not None | |
| assert caps.model_name == "anthropic/claude-opus-4.5" | |
| # Test using full model name for 4.1 | |
| caps = registry.get_capabilities("anthropic/claude-opus-4.1") | |
| assert caps is not None | |
| assert caps.model_name == "anthropic/claude-opus-4.1" | |
| # Test opus4.1 alias still works | |
| caps = registry.get_capabilities("opus4.1") | |
| assert caps is not None | |
| assert caps.model_name == "anthropic/claude-opus-4.1" | |
| # Test Opus 4.5 variants (alias, versioned alias, and full name) | |
| for name in ["opus", "opus4.5", "anthropic/claude-opus-4.5"]: | |
| caps = registry.get_capabilities(name) | |
| assert caps is not None | |
| assert caps.model_name == "anthropic/claude-opus-4.5" | |
| assert caps.context_window == 200000 | |
| # Test Opus 4.1 variants (versioned alias and full name) | |
| for name in ["opus4.1", "anthropic/claude-opus-4.1"]: | |
| caps = registry.get_capabilities(name) | |
| assert caps is not None | |
| assert caps.model_name == "anthropic/claude-opus-4.1" | |
| assert caps.context_window == 200000 |
|
Thanks for the review feedback! I've addressed the first two suggestions by adding tests for Regarding the refactoring suggestion to use loops: I checked the existing test patterns in the codebase and found that I'll leave the current structure as-is to maintain consistency with the existing test patterns in the file, but happy to refactor if the maintainers prefer the loop style. |
Summary
Adds support for Claude Opus 4.5 via OpenRouter, Anthropic's frontier reasoning model for complex software engineering and agentic workflows.
Changes
anthropic/claude-opus-4.5toconf/openrouter_models.jsonopus,opus4.5,claude-opus(migrated from Opus 4.1)opus4.1alias onlyConfiguration Notes
supports_function_callingandsupports_json_modeare set tofalsefollowing the existing project pattern for Claude models, despite OpenRouter API support for these features. This maintains consistency with other Anthropic models in the configuration.Validation
opus) and full model name (anthropic/claude-opus-4.5) resolve correctlyChecklist
./code_quality_checks.sh(all checks passed)