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

Co-authored-by: Shreya Keshive <shreyakeshive@google.com>
This commit is contained in:
Ben Brandt
2025-11-20 20:08:37 +00:00
committed by GitHub
parent d15970e12c
commit 83d0bdc32e

View File

@@ -27,11 +27,9 @@ import {
DiscoveredMCPTool,
StreamEventType,
ToolCallEvent,
DEFAULT_GEMINI_MODEL,
DEFAULT_GEMINI_MODEL_AUTO,
DEFAULT_GEMINI_FLASH_MODEL,
debugLogger,
ReadManyFilesTool,
getEffectiveModel,
} from '@google/gemini-cli-core';
import * as acp from './acp.js';
import { AcpFileSystemService } from './fileSystemService.js';
@@ -47,19 +45,6 @@ import { randomUUID } from 'node:crypto';
import type { CliArgs } from '../config/config.js';
import { loadCliConfig } from '../config/config.js';
/**
* Resolves the model to use based on the current configuration.
*
* If the model is set to "auto", it will use the flash model if in fallback
* mode, otherwise it will use the default model.
*/
export function resolveModel(model: string, isInFallbackMode: boolean): string {
if (model === DEFAULT_GEMINI_MODEL_AUTO) {
return isInFallbackMode ? DEFAULT_GEMINI_FLASH_MODEL : DEFAULT_GEMINI_MODEL;
}
return model;
}
export async function runZedIntegration(
config: Config,
settings: LoadedSettings,
@@ -264,9 +249,10 @@ class Session {
const functionCalls: FunctionCall[] = [];
try {
const model = resolveModel(
this.config.getModel(),
const model = getEffectiveModel(
this.config.isInFallbackMode(),
this.config.getModel(),
this.config.getPreviewFeatures(),
);
const responseStream = await chat.sendMessageStream(
{ model },