Skip to content

Conversation

@Shironex
Copy link
Collaborator

@Shironex Shironex commented Jan 14, 2026

Changes from branch feature/v0.11.0rc-1768420878341-xzhv

- Introduced `getProviderForModelWithExplicit` method in ProviderFactory to allow explicit provider specification, enhancing flexibility in provider selection.
- Updated `simpleQuery` and `streamingQuery` functions to utilize the new method for improved provider handling.
- Modified `PhaseModelSelector` to pass explicit provider information during model selection.
- Enhanced `PhaseModelEntry` and related interfaces to support optional provider fields for dynamic model routing.
@coderabbitai
Copy link

coderabbitai bot commented Jan 14, 2026

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.


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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@gemini-code-assist
Copy link
Contributor

Summary of Changes

Hello @Shironex, 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 resolves an issue where custom models, particularly those not easily identifiable by their model ID patterns, were not being correctly utilized during spec regeneration. The core solution involves introducing an explicit provider field within the model configuration, allowing direct specification of the intended provider. This explicit provider information is now propagated throughout the system, from UI selection to the underlying query services, ensuring accurate routing and proper functioning of dynamic and custom models.

Highlights

  • Explicit Provider Routing: Introduced an optional provider field in PhaseModelEntry and SimpleQueryOptions to explicitly specify the model provider, bypassing model ID pattern-based detection. This is crucial for dynamic or custom models like OpenCode.
  • New Provider Factory Method: Added ProviderFactory.getProviderForModelWithExplicit which prioritizes an explicitly provided provider name, falling back to model ID detection if none is given. This method also includes improved error handling for disconnected providers.
  • Integration into Query Services: The simpleQuery and streamingQuery functions now utilize the new explicit provider method, ensuring that the correct provider is used when an explicit one is specified in the query options.
  • UI Updates for Provider Selection: The PhaseModelSelector component in the UI has been updated to explicitly store the provider (e.g., 'codex', 'opencode', 'cursor', 'claude') alongside the model ID when a user selects a model in the settings.
  • Spec Regeneration Fix: The spec regeneration process now correctly extracts and passes the explicit provider from the resolved phase model to the streamingQuery, resolving the issue where custom models were not being used.

🧠 New Feature in Public Preview: You can now enable Memory to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console.

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.

@Shironex Shironex self-assigned this Jan 14, 2026
@Shironex Shironex added Bug Something isn't working Testers-Requested Request for others to test an enhancement or bug fix/etc. Do Not Merge Use this label if something should not be merged. labels Jan 14, 2026
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 introduces a useful feature to allow specifying an explicit model provider, which is particularly helpful for custom models. The changes are well-implemented across the server, UI, and shared type libraries.

I have one main piece of feedback regarding the new getProviderForModelWithExplicit method in provider-factory.ts. The current implementation silently falls back to the 'claude' provider if an explicit provider is not found, which could mask configuration issues. I've suggested a change to throw an error in this case for more robust error handling. I also noted some code duplication that could be addressed to improve maintainability.

Comment on lines +174 to +181
if (!provider) {
// Fallback to claude if provider not found
const claudeReg = providerRegistry.get('claude');
if (claudeReg) {
return claudeReg.factory();
}
throw new Error(`No provider found for model: ${modelId}`);
}
Copy link
Contributor

Choose a reason for hiding this comment

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

high

When an explicitProvider is given but not found, the code silently falls back to the 'claude' provider. This can hide configuration errors and lead to unexpected behavior. If a user explicitly specifies a provider, it's better to throw an error if that provider is not found.

Additionally, the logic in this if (!provider) block is identical to the one in the getProviderForModel method (lines 120-127). The disconnection check logic is also duplicated. Consider refactoring the common parts into a private helper method to reduce code duplication and improve maintainability.

    if (!provider) {
      if (explicitProvider) {
        throw new Error("Explicitly specified provider '" + explicitProvider + "' not found.");
      }
      // Fallback to claude if provider not found
      const claudeReg = providerRegistry.get('claude');
      if (claudeReg) {
        return claudeReg.factory();
      }
      throw new Error("No provider found for model: " + modelId);
    }

Base automatically changed from v0.11.0rc to main January 15, 2026 01:31
@Shironex Shironex closed this Jan 16, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Bug Something isn't working Do Not Merge Use this label if something should not be merged. Testers-Requested Request for others to test an enhancement or bug fix/etc.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: Spec regeneration doesn't usercustom models

2 participants