Repository navigation
fix: add gemini-omni-flash-preview model alias + fix tool schema loss - #1
Closed
patoangolano wants to merge 1 commit into
Closed
patoangolano wants to merge 1 commit into
patoangolano wants to merge 1 commit into
Conversation
Two bugs fixed: 1. Model 404: 'gemini-omni-flash-preview' was not in MODEL_ALIASES, causing fallback to raw model name which Google API rejects (404). Added mapping to gemini-3-flash (the actual API model name). 2. Tool schema missing (toolDebugMissing: 1): normalizeGeminiTools() created a 'custom' wrapper with input_schema but deleted it at line 332 without ensuring function.input_schema was set first. Now function.input_schema is always populated before custom is stripped, and a fallback empty schema is added if source had none.
There was a problem hiding this comment.
Pull request overview
This PR updates the Gemini transform pipeline to (1) add marketing-name model aliases and (2) make tool schema normalization more defensive so tools don’t lose their schema during Gemini-specific reshaping.
Changes:
- Added
gemini-omni-*marketing aliases to the model alias resolver. - Adjusted
normalizeGeminiTools()ordering/logic so function tools retaininput_schemaeven when temporarycustomwrappers are created and later stripped.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
| src/plugin/transform/model-resolver.ts | Adds marketing aliases for gemini-omni-* names to resolve to upstream Gemini 3 models. |
| src/plugin/transform/gemini.ts | Updates tool normalization to ensure function.input_schema is set before temporary custom wrappers are created/removed. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Comment on lines
286
to
298
| // Always update function.input_schema with transformed schema | ||
| // CRITICAL: This must happen BEFORE custom creation so function tools | ||
| // keep their schema even after custom is stripped (line 332). | ||
| if (newTool.function && schema) { | ||
| (newTool.function as Record<string, unknown>).input_schema = schema; | ||
| } else if (newTool.function && !schema) { | ||
| // Ensure function always has a schema even if source had none | ||
| (newTool.function as Record<string, unknown>).input_schema = { | ||
| type: "OBJECT", | ||
| properties: {}, | ||
| }; | ||
| toolDebugMissing += 1; | ||
| } |
Comment on lines
+51
to
+55
| // Marketing aliases - map to real API model names | ||
| "gemini-omni-flash-preview": "gemini-3-flash", | ||
| "gemini-omni-flash": "gemini-3-flash", | ||
| "gemini-omni-pro-preview": "gemini-3-pro", | ||
| "gemini-omni-pro": "gemini-3-pro", |
Comment on lines
+52
to
+55
| "gemini-omni-flash-preview": "gemini-3-flash", | ||
| "gemini-omni-flash": "gemini-3-flash", | ||
| "gemini-omni-pro-preview": "gemini-3-pro", | ||
| "gemini-omni-pro": "gemini-3-pro", |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
When selecting a model like
gemini-omni-flash-preview, the plugin returns a 404 error from the Google Antigravity API, along withTool Debug Missing: 1in the debug info.Root Cause
Bug 1: Model 404 — Missing alias
gemini-omni-flash-previewis not present inMODEL_ALIASESinmodel-resolver.ts. When a model name isn't found in the alias map, the resolver falls back to the raw model name (baseName), which the Google API rejects with 404 because no such model exists upstream.Bug 2: Tool schema loss —
toolDebugMissing: 1In
normalizeGeminiTools()(transform/gemini.ts), when a tool only has afunctionfield (nocustom), the code:customwrapper withinput_schema(line 297-304)customwrapper (line 332)But if
function.input_schemawas never set (line 287 condition not met), the tool ends up with no schema at all aftercustomis deleted. ThewrapToolsAsFunctionDeclarations()function downstream then uses an empty{ type: "OBJECT", properties: {} }fallback, causing thetoolDebugMissingcounter to increment.Fix
Fix 1:
model-resolver.tsAdded marketing aliases mapping to real API model names:
Fix 2:
transform/gemini.tsEnsured
function.input_schemais always populated beforecustomis stripped:else ifbranch to set a fallback empty schema onfunctionwhen source had no schemafunctiontools now always carry their schema even aftercustomdeletionTesting
gemini-omni-flash-previewnow resolves togemini-3-flash(valid API model)functionfield now retain their schema through the normalization pipelinetoolDebugMissingshould be 0 for tools that have a proper schemaFiles Changed
src/plugin/transform/model-resolver.ts— added 4 model aliasessrc/plugin/transform/gemini.ts— fixed schema assignment order innormalizeGeminiTools()