Repository navigation
fix(core): support multimodal function response for dotted Gemini 3 models and aliases - #29611
bodapatisaikrishna wants to merge 1 commit into
Conversation
|
📊 PR Size: size/M
|
Summary of ChangesHello, 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 addresses issues with multimodal function responses for Gemini 3 models by improving how model identifiers are resolved and matched. By correctly identifying dotted model versions and aliases, the system now avoids generating invalid sibling parts that previously caused API errors, ensuring that multimodal content is properly nested within function responses. Highlights
Using Gemini Code AssistThe 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
Customization To customize the 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 Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counterproductive. 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. Footnotes
|
There was a problem hiding this comment.
Code Review
This pull request updates supportsMultimodalFunctionResponse to resolve model aliases and names using resolveModel before performing capability checks, and expands the test coverage for Gemini 3 models and aliases. A review comment points out that calling resolveModel in the fallback path without passing the config context or the preview access flag can lead to incorrect model resolution (e.g., resolving to a preview model when the user does not have preview access), and suggests passing the context and preview flags to ensure accurate capability detection.
| const resolved = resolveModel(model); | ||
| return /^gemini-3(\.|-|$)/.test(resolved); |
There was a problem hiding this comment.
In the fallback path of supportsMultimodalFunctionResponse, calling resolveModel(model) without passing the config context or hasAccessToPreview flag can lead to incorrect model resolution. For example, if a user does not have preview access, 'pro' should resolve to gemini-2.5-pro (which does not support multimodal function responses). However, without passing hasAccessToPreview, it will default to true and resolve to gemini-3-pro-preview, incorrectly returning true and potentially causing HTTP 400 errors at runtime. Passing the context and preview access flags ensures accurate capability detection.
const hasAccessToPreview = config?.getHasAccessToPreviewModel?.() ?? true;
const resolved = resolveModel(
model,
false,
false,
hasAccessToPreview,
config,
);
return /^gemini-3(\|-|$)/.test(resolved);There was a problem hiding this comment.
Good catch, updated to pass preview access and config in both paths and added a test for it.
…odels and aliases
supportsMultimodalFunctionResponse checked startsWith('gemini-3-'), which excluded dotted model versions like gemini-3.8-flash and aliases like auto. Resolve model IDs and respect preview access in both static and dynamic configuration paths so multimodal output stays nested in functionResponse.
a969ab4 to
df02d03
Compare
|
Hi there! Thank you for your interest in contributing to Gemini CLI. To ensure we maintain high code quality and focus on our prioritized roadmap, we only guarantee review and consideration of pull requests for issues that are explicitly labeled as 'help wanted'. This PR will be closed in 7 days if it remains without that designation. We encourage you to find and contribute to existing 'help wanted' issues in our backlog! Thank you for your understanding. |
|
This pull request is being closed as it has been open for 14 days without a 'help wanted' designation. We encourage you to find and contribute to existing 'help wanted' issues in our backlog! Thank you for your understanding. |
Summary
Resolve model aliases and support dotted Gemini 3 model versions in
supportsMultimodalFunctionResponse(). This prevents multimodal tool outputs (such as images read viaread_file) from being emitted as invalid sibling parts on Gemini 3 models likegemini-3.8-flash, which triggers HTTP 400 errors.Details
supportsMultimodalFunctionResponsecheckedmodel.startsWith('gemini-3-'), which missed dotted model versions (gemini-3.8-flash,gemini-3.5-flash,gemini-3.1-*) and aliases likeauto. When it evaluated to false,convertToFunctionResponse()pushed binary parts tosiblingPartsoutsidefunctionResponse, causing Vertex / Gemini API calls to fail.The check now resolves the model identifier in both static and dynamic configuration paths and uses
/^gemini-3(\.|-|$)/consistent withisGemini3Model().Related Issues
Fixes #29574
How to Validate
Pre-Merge Checklist