Skip to content

feat(zed-integration): Use default model routing for Zed integration#13398

Merged
skeshive merged 3 commits intogoogle-gemini:mainfrom
zed-industries:allow-using-gemini-3-in-zed
Nov 20, 2025
Merged

feat(zed-integration): Use default model routing for Zed integration#13398
skeshive merged 3 commits intogoogle-gemini:mainfrom
zed-industries:allow-using-gemini-3-in-zed

Conversation

@benbrandt
Copy link
Copy Markdown
Contributor

Summary

Refactors the model selection to use the default getEffectiveModel
instead of the custom function in the Zed integration.

This has the benefit of allowing users to use Gemini 3 if they have
enabled the preview features.

Details

Previously @skeshive did some work to allow the Zed integration to utilize the fallback model routing.

This updates this implementation to use the same logic as the core CLI in terms of choosing between fallback models and preview models.

How to Validate

Run npm run build and put the following config in your Zed settings.json

{
  "agent_servers": {
    "jimandi": {
      "command": "/path/to/your/repo/gemini-cli/packages/cli/dist/index.js",
      "args": ["--experimental-acp"]
    }
  }
}

Pre-Merge Checklist

  • Updated relevant documentation and README (if needed)
  • Added/updated tests (if needed)
  • Noted breaking changes (if any)
  • Validated on required platforms/methods:
    • MacOS
      • npm run
      • npx
      • Docker
      • Podman
      • Seatbelt
    • Windows
      • npm run
      • npx
      • Docker
    • Linux
      • npm run
      • npx
      • Docker

@benbrandt benbrandt requested a review from a team as a code owner November 19, 2025 10:18
@gemini-code-assist
Copy link
Copy Markdown
Contributor

Summary of Changes

Hello @benbrandt, 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 refactors the model selection mechanism within the Zed integration to align with the core CLI's approach. By adopting the getEffectiveModel utility, the integration can now dynamically select appropriate models, including preview models like Gemini 3, based on user configuration and enabled features. This change streamlines model management and ensures consistent behavior across the application.

Highlights

  • Unified Model Selection: The Zed integration now utilizes the shared getEffectiveModel utility from @google/gemini-cli-core for determining the appropriate model to use.
  • Removed Custom Logic: The custom resolveModel function, previously responsible for model selection within the Zed integration, has been removed.
  • Preview Feature Support: This change enables the Zed integration to correctly leverage preview features, such as Gemini 3, by aligning its model selection logic with the core CLI's approach.
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
Copy Markdown
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 refactors the model selection logic within the Zed integration to align with the core CLI's behavior. By removing the custom resolveModel function and adopting the centralized getEffectiveModel from @google/gemini-cli-core, the change successfully eliminates code duplication. This is a great improvement for maintainability and ensures that Zed integration users can benefit from consistent model routing, including access to preview models. The implementation is clean, correct, and achieves its stated goal effectively.

@skeshive
Copy link
Copy Markdown
Contributor

@benbrandt Mind resolving the conflicts?

@benbrandt
Copy link
Copy Markdown
Contributor Author

will do!

@benbrandt benbrandt force-pushed the allow-using-gemini-3-in-zed branch from 5ded1a0 to f1feca9 Compare November 20, 2025 15:43
@benbrandt
Copy link
Copy Markdown
Contributor Author

@skeshive done

Refactors the model selection to use the default `getEffectiveModel`
instead of the custom function in the Zed integration.

This has the benefit of allowing users to use Gemini 3 if they have
enabled the preview features.
@benbrandt benbrandt force-pushed the allow-using-gemini-3-in-zed branch from f1feca9 to 478c99c Compare November 20, 2025 15:44
const model = getEffectiveModel(
this.config.isInFallbackMode(),
this.config.getModel(),
this.config.getPreviewFeatures(),
Copy link
Copy Markdown
Contributor

@skeshive skeshive Nov 20, 2025

Choose a reason for hiding this comment

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

is there a way for users to set this via Zed integration (currently previewFeatures isnt exposed via cli flags, its exposed via /settings UI)

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Not currently. It relies on you having used Gemini CLI elsewhere and turning it on.

We could look into letting them set this another way if you prefer. But my hope for now would be at the very least whenever you update the logic to make Gemini 3 the default it would also work here for the users who don't do that

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Not currently. It relies on you having used Gemini CLI elsewhere and turning it on.

Could you explain this a bit more? Would the user have to edit the source code in order to flip this feature on?

If/when we flip the default model to Gemini 3, I believe the existing logic would enable usage of Gemini 3. I'm not strongly opposed to updating the logic but just want to understand the use case

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Sorry I just mean, I got it to work by running gemini cli in my terminal, turning on the preview feature, and then going back and running it in Zed

@skeshive skeshive enabled auto-merge November 20, 2025 18:02
@benbrandt
Copy link
Copy Markdown
Contributor Author

@skeshive do I need to fix something here? Or was it just a flaky CI job?

@skeshive skeshive added this pull request to the merge queue Nov 20, 2025
Merged via the queue into google-gemini:main with commit 83d0bdc Nov 20, 2025
21 checks passed
thacio added a commit to thacio/auditaria that referenced this pull request Nov 23, 2025
werdnum pushed a commit to werdnum/gemini-cli that referenced this pull request Nov 24, 2025
mboshernitsan pushed a commit that referenced this pull request Nov 25, 2025
…13398)

Co-authored-by: Shreya Keshive <shreyakeshive@google.com>
danpalmer pushed a commit to danpalmer/gemini-cli that referenced this pull request Nov 29, 2025
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.

2 participants