Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 10 additions & 1 deletion src/plugin/transform/gemini.ts
Original file line number Diff line number Diff line change
Expand Up @@ -284,16 +284,25 @@ export function normalizeGeminiTools(payload: RequestPayload): {
`tool-${toolIndex}`;

// 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 286 to 298

// Always update custom.input_schema with transformed schema
if (newTool.custom && schema) {
(newTool.custom as Record<string, unknown>).input_schema = schema;
}

// Create custom from function if missing
// Create custom from function if missing (temporary, stripped later)
if (!newTool.custom && newTool.function) {
const fn = newTool.function as Record<string, unknown>;
newTool.custom = {
Expand Down
6 changes: 6 additions & 0 deletions src/plugin/transform/model-resolver.ts
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,12 @@ export const MODEL_ALIASES: Record<string, string> = {
"gemini-3-flash-medium": "gemini-3-flash",
"gemini-3-flash-high": "gemini-3-flash",

// 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 +51 to +55
Comment on lines +52 to +55

// Gemini 3.5 Flash - upstream uses tiered names (no bare model exists).
// Each tier maps to a distinct upstream model ID (probed 200 OK).
"gemini-3.5-flash": "gemini-3.5-flash-low", // default → Medium tier
Expand Down