OpenRouter Model ID Bug In Roo Code (v3.33.2+)

by Alex Johnson 47 views

Experiencing issues with OpenRouter models in Roo Code since version v3.33.2? You're not alone! This article dives into a bug where certain model IDs, like those in the GPT-5.1 series, Gemini-3, and Grok-4.1-Fast, are not being recognized by the OpenRouter provider in Roo Code. We'll explore the problem, who it affects, how to reproduce it, and potential solutions. If you're encountering this frustrating issue, read on to learn more and hopefully find a fix.

Problem: Model IDs Not Found in OpenRouter Provider

Since the release of Roo Code version v3.33.2, users have reported a significant bug affecting the OpenRouter provider. Specifically, certain model IDs that do exist within OpenRouter are not being recognized within Roo Code. This issue persists in the latest version, v3.34.4, causing considerable disruption for users relying on these models. Currently, the identified models affected by this bug include the GPT-5.1 series, Gemini-3, and Grok-4.1-Fast. It's important to note that this may not be an exhaustive list, and other models could potentially be affected as well. This erroneous behavior makes it impossible to properly configure and utilize these specific models within the Roo Code environment. An intriguing aspect of this bug is its intermittent nature. In the initial minutes after launching Roo Code, the model configuration appears to function correctly. Users can successfully select and configure models like the GPT-5.1 series without issue. However, after a period of time, when revisiting the model configuration page, the system incorrectly indicates that these models (e.g., the GPT-5.1 series) do not exist. Consequently, the configured model is automatically switched to Claude Sonnet 4.5, which can disrupt workflows and cause unexpected results. This unpredictable behavior adds complexity to the issue, making it even more challenging for users to manage their model configurations within Roo Code. The inability to consistently access and utilize specific models hinders the reliability and predictability of the platform, thereby impacting user productivity and potentially diminishing the overall user experience.

Context: Who is Affected and When?

This OpenRouter model ID bug impacts all users running versions of Roo Code subsequent to v3.33.1 when configuring specific models from OpenRouter. The models known to be affected are the gpt-5.1 series, gemini-3, and grok-4.1-fast. If you rely on these models for your projects, you're likely experiencing this issue. The time-sensitive nature of this bug adds another layer of complexity. As mentioned earlier, the bug doesn't manifest immediately after opening Roo Code. There's a window of opportunity, typically within the first few minutes, where model configuration functions as expected. This can lead to a false sense of security, as users might initially believe the issue is resolved. However, the bug reappears after a certain period, causing the configured model to be replaced with Claude Sonnet 4.5 without explicit user intervention. This automatic switching can be particularly problematic for users who have set up specific workflows or have projects dependent on the unique capabilities of the affected models. The unexpected change in models can lead to inconsistencies in output, potentially compromising the integrity and reliability of the work being done. Furthermore, the fact that the issue surfaces after a delay makes it difficult to diagnose and troubleshoot. Users may not immediately associate the model change with a bug, potentially leading to wasted time and effort in attempting to rectify the configuration manually. This can be a significant source of frustration and can impact the overall efficiency of using Roo Code in conjunction with OpenRouter.

Reproduction Steps: How to Trigger the Bug

To reproduce this OpenRouter model ID bug in Roo Code, follow these steps:

  1. Open Roo Code's settings interface: Navigate to the settings section within the Roo Code application.
  2. Create a new configuration and select OpenRouter: Add a new configuration profile and choose "openrouter" as the provider.
  3. Set the model to "gpt-5.1" (or another affected model): Initially, you should be able to successfully set the model to one of the affected models, such as "gpt-5.1." This is because the bug doesn't immediately manifest.
  4. Wait for a period of time: This is a crucial step. Allow Roo Code to run for a while (e.g., several minutes or longer) after successfully configuring the model.
  5. Reopen the model configuration: After the waiting period, revisit the model configuration you created earlier.
  6. Observe the error: You should now see an error message indicating that the originally configured model (e.g., "gpt-5.1") does not exist. The model will have been automatically switched to "Claude sonnet 4.5."

These steps highlight the specific conditions under which the bug surfaces. The delay between the initial configuration and the error manifestation is a key characteristic of this issue. Understanding these reproduction steps is vital for developers and users alike, as it allows for consistent testing and verification of potential fixes or workarounds. By following these steps, users can confirm whether they are indeed encountering the bug and can provide valuable information to the Roo Code development team for debugging and resolution purposes. Moreover, this detailed procedure serves as a clear and concise guide for anyone seeking to replicate the issue, fostering collaborative efforts in identifying the root cause and implementing effective solutions.

Expected Result vs. Actual Result

Expected Result: The desired outcome is to configure and utilize the specified models (gpt-5.1 series, gemini-3, and grok-4.1-fast) from OpenRouter within Roo Code without encountering any errors or unexpected model substitutions. Users expect that when they select a particular model ID in the configuration settings, Roo Code will reliably use that model for its tasks and operations. This expectation stems from the fundamental functionality of a well-integrated platform, where model selections are honored consistently and without disruptive glitches. The ability to reliably select and use specific models is critical for users who have tailored their workflows and projects to the unique capabilities of these models. It ensures predictability in performance and output, fostering confidence in the platform's stability and trustworthiness.

Actual Result: The actual result deviates significantly from the expected behavior. Instead of retaining the user-specified model configuration, the model configuration page erroneously indicates that the selected model does not exist in OpenRouter. As a consequence, the system automatically switches the model to "Claude sonnet 4.5," a different model altogether. This unexpected model substitution disrupts the user's intended workflow, potentially leading to inconsistent results and undermining the reliability of the output. The incorrect error message and the subsequent automatic model change can cause considerable confusion and frustration, especially for users who are not immediately aware of the bug's existence. They may spend valuable time troubleshooting their configurations or attempting to reselect the original model, only to have it replaced again later. This deviation from the expected result highlights a critical flaw in the integration between Roo Code and OpenRouter, demanding immediate attention and resolution to restore the platform's usability and maintain user satisfaction.

App Version, API Provider, and Model Used

  • App Version: This bug has been observed in all versions of Roo Code after v3.33.1.
  • API Provider: The issue is specific to the OpenRouter API provider.
  • Model Used: The models confirmed to be affected include the gpt-5.1 series, gemini-3, and grok-4.1-fast.

This information provides essential context for developers and users investigating the bug. Knowing the affected app versions helps narrow down the scope of the problem and ensures that efforts are focused on the relevant codebase. The fact that the issue is specific to the OpenRouter API provider suggests that the integration between Roo Code and OpenRouter may be the root cause. This could involve discrepancies in how model IDs are handled or potential issues with API calls and responses. Identifying the affected models is equally crucial, as it allows for targeted testing and the implementation of workarounds for users who specifically rely on these models. By clearly outlining these details, this section contributes to a comprehensive understanding of the bug, facilitating more efficient troubleshooting and resolution efforts.

Conclusion

The OpenRouter model ID bug in Roo Code (v3.33.2+) is a significant issue that affects users relying on specific models like the GPT-5.1 series, Gemini-3, and Grok-4.1-Fast. The bug causes these models to be incorrectly identified as non-existent, leading to automatic model substitutions and workflow disruptions. Understanding the reproduction steps and the affected versions is crucial for both users and developers in addressing this problem. We hope this article has shed light on the issue and provided valuable information for troubleshooting and resolution.

For more information on OpenRouter and its models, you can visit the official OpenRouter website. This external resource offers comprehensive documentation and details about the platform, its features, and the models available, which can be valuable for users seeking to understand the underlying technology and potentially find workarounds or solutions for the bug.