feat(gemini): support mid-session model change (#379)

This commit is contained in:
Junmo Kim
2026-04-01 11:15:11 +08:00
committed by GitHub
parent fa0ce1ca94
commit 4eb88c5d7e
13 changed files with 277 additions and 26 deletions
@@ -1,6 +1,7 @@
import { spawn, type ChildProcessWithoutNullStreams } from 'node:child_process';
import { logger } from '@/ui/logger';
import { killProcessByChildProcess } from '@/utils/process';
import { GEMINI_MODEL_PRESETS } from '@hapi/protocol';
interface JsonRpcRequest {
jsonrpc: '2.0';
@@ -303,7 +304,7 @@ export class AcpStdioTransport {
if (lowerText.includes('status 404') || lowerText.includes('model not found') || lowerText.includes('not_found')) {
this.stderrErrorHandler({
type: 'model_not_found',
message: 'Model not found. Available models: gemini-3.1-pro-preview, gemini-3-flash-preview, gemini-2.5-pro, gemini-2.5-flash, gemini-2.5-flash-lite',
message: `Model not found. Available models: ${GEMINI_MODEL_PRESETS.join(', ')}`,
raw: text
});
return;