Skip to content

fix(zed): Fix broken 'auto' model selection in Zed integration#9769

Merged
skeshive merged 2 commits into
mainfrom
fix-zed-model
Sep 25, 2025
Merged

fix(zed): Fix broken 'auto' model selection in Zed integration#9769
skeshive merged 2 commits into
mainfrom
fix-zed-model

Conversation

@skeshive

Copy link
Copy Markdown
Contributor

This PR fixes the Zed integration, which is broken when using the auto model setting. The integration communicates directly with the Gemini Chat service, bypassing the internal model routing logic that normally handles the auto selection.

This change re-implements the necessary model selection logic within the Zed integration path, ensuring it correctly falls back to the flash model when appropriate.

@skeshive skeshive requested a review from a team as a code owner September 25, 2025 18:36
@gemini-code-assist

Copy link
Copy Markdown
Contributor

Summary of Changes

Hello @skeshive, 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 a critical issue in the Zed integration where the 'auto' model selection for the Gemini Chat service was not being honored. The fix re-implements the necessary model routing logic directly within the integration path, ensuring that the system correctly determines whether to use the default Gemini model or fall back to the flash model based on the current configuration. This change restores the intended behavior for automatic model selection.

Highlights

  • Model Selection Logic: A new resolveModel utility function has been introduced to correctly handle the 'auto' model setting within the Zed integration.
  • Fallback Mechanism: The resolveModel function ensures that when 'auto' is selected, it intelligently falls back to the flash model if the system is in fallback mode, otherwise it defaults to the standard Gemini model.
  • Integration Update: The Zed integration's Session class now utilizes the resolveModel function when sending messages to the Gemini Chat service, ensuring the 'auto' model selection is properly applied.
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.

@gemini-code-assist gemini-code-assist Bot left a comment

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.

Code Review

This pull request correctly addresses a bug in the Zed integration where the auto model selection was not working. The fix introduces a resolveModel helper function to handle this logic. My review includes suggestions to simplify this new function and its usage to remove redundant logic and improve maintainability by better separating concerns. The proposed changes make the code cleaner while preserving the correctness of the fix.

Comment thread packages/cli/src/zed-integration/zedIntegration.ts
Comment thread packages/cli/src/zed-integration/zedIntegration.ts
@github-actions

Copy link
Copy Markdown

Size Change: +241 B (0%)

Total Size: 17.4 MB

ℹ️ View Unchanged
Filename Size Change
./bundle/gemini.js 17.4 MB +241 B (0%)
./bundle/sandbox-macos-permissive-closed.sb 1.03 kB 0 B
./bundle/sandbox-macos-permissive-open.sb 830 B 0 B
./bundle/sandbox-macos-permissive-proxied.sb 1.31 kB 0 B
./bundle/sandbox-macos-restrictive-closed.sb 3.29 kB 0 B
./bundle/sandbox-macos-restrictive-open.sb 3.36 kB 0 B
./bundle/sandbox-macos-restrictive-proxied.sb 3.56 kB 0 B

compressed-size-action

@skeshive skeshive enabled auto-merge September 25, 2025 18:39
@skeshive skeshive added this pull request to the merge queue Sep 25, 2025
Merged via the queue into main with commit f885375 Sep 25, 2025
17 of 18 checks passed
@skeshive skeshive deleted the fix-zed-model branch September 25, 2025 18:51
geoffdowns pushed a commit to geoffdowns/gemini-cli that referenced this pull request Sep 26, 2025
thacio added a commit to thacio/auditaria that referenced this pull request Oct 4, 2025
giraffe-tree pushed a commit to giraffe-tree/gemini-cli that referenced this pull request Oct 10, 2025
@sripasg sripasg added the size/s A small PR label Jun 2, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size/s A small PR

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants