Skip to content

Conversation

@brt-h
Copy link

@brt-h brt-h commented Nov 29, 2025

Summary

Adds support for Claude Opus 4.5 via OpenRouter, Anthropic's frontier reasoning model for complex software engineering and agentic workflows.

Changes

  • Added anthropic/claude-opus-4.5 to conf/openrouter_models.json
  • Aliases: opus, opus4.5, claude-opus (migrated from Opus 4.1)
  • Intelligence score: 18 (matching Gemini 3 Pro)
  • Context window: 200,000 tokens, max output: 64,000 tokens
  • Updated Opus 4.1 to use opus4.1 alias only
  • Updated tests to reflect new alias mappings

Configuration Notes

supports_function_calling and supports_json_mode are set to false following 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

  • All 851 unit tests pass
  • Code quality checks pass (ruff, black, isort)
  • Live validation with OpenRouter API confirmed working
  • Both alias (opus) and full model name (anthropic/claude-opus-4.5) resolve correctly

Checklist

  • PR title follows conventional commit format
  • Ran ./code_quality_checks.sh (all checks passed)
  • Tests added/updated for changes
  • Self-review completed

- 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.
@gemini-code-assist
Copy link
Contributor

Summary of Changes

Hello @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

  • New Model Integration: Added support for Anthropic's Claude Opus 4.5 model via OpenRouter, enhancing the available AI model capabilities.
  • Alias Management Update: The primary aliases 'opus' and 'claude-opus' now point to Claude Opus 4.5, while Claude Opus 4.1 is now specifically accessible via the 'opus4.1' alias.
  • Model Configuration: Claude Opus 4.5 is configured with a 200,000 token context window, 64,000 max output tokens, and an intelligence score of 18, matching Gemini 3 Pro.
  • Test Suite Updates: Existing unit tests for model alias resolution and registry capabilities have been updated to reflect the new alias mappings and model configurations, ensuring correct behavior.
Using Gemini Code Assist

The 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 /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

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 .gemini/ folder in the base of the repository. Detailed instructions can be found here.

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

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

Copy link
Contributor

@gemini-code-assist gemini-code-assist bot left a 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.

Comment on lines 310 to 324
# 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"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

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"

Comment on lines 91 to 94
("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
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

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.

Suggested change
("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
@brt-h
Copy link
Author

brt-h commented Nov 29, 2025

/gemini review

Copy link
Contributor

@gemini-code-assist gemini-code-assist bot left a 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.

Comment on lines +310 to +334
# 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"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

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.

Suggested change
# 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

@brt-h
Copy link
Author

brt-h commented Nov 30, 2025

Thanks for the review feedback! I've addressed the first two suggestions by adding tests for claude-opus, opus4.5, and anthropic/claude-opus-4.5.

Regarding the refactoring suggestion to use loops: I checked the existing test patterns in the codebase and found that test_registry_capabilities in this file uses individual assertions (consistent with other tests in the same file like test_get_capabilities), while test_alias_resolution already uses the loop pattern with test_cases.

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant