@google/gemini-cli-a2a-server 0.45.0-preview.1 → 0.46.0-preview.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -130327,25 +130327,30 @@ var init_types8 = __esm({
130327
130327
  });
130328
130328
 
130329
130329
  // packages/core/dist/src/config/models.js
130330
+ function setFlashModels(preview, defaultFlash) {
130331
+ PREVIEW_GEMINI_FLASH_MODEL = preview;
130332
+ DEFAULT_GEMINI_FLASH_MODEL = defaultFlash;
130333
+ }
130330
130334
  function getAutoModelDescription(hasAccessToPreview, useGemini3_1 = false) {
130331
130335
  const proModel = hasAccessToPreview ? useGemini3_1 ? PREVIEW_GEMINI_3_1_MODEL : PREVIEW_GEMINI_MODEL : DEFAULT_GEMINI_MODEL;
130332
130336
  const flashModel = hasAccessToPreview ? PREVIEW_GEMINI_FLASH_MODEL : DEFAULT_GEMINI_FLASH_MODEL;
130333
130337
  return `Let Gemini CLI decide the best model for the task: ${proModel}, ${flashModel}`;
130334
130338
  }
130335
- function resolveModel(requestedModel, useGemini3_1 = false, useCustomToolModel = false, hasAccessToPreview = true, config3) {
130339
+ function resolveModel(requestedModel, useGemini3_1 = false, useCustomToolModel = false, hasAccessToPreview = true, config3, useGemini3_5Flash = false) {
130336
130340
  const normalizedModel = Array.isArray(requestedModel) ? String(requestedModel.at(-1) ?? "").trim() || "" : typeof requestedModel !== "string" ? String(requestedModel ?? "").trim() || "" : requestedModel.trim() || "";
130337
130341
  if (config3?.getExperimentalDynamicModelConfiguration?.() === true) {
130338
130342
  const resolved2 = config3.modelConfigService.resolveModelId(normalizedModel, {
130339
130343
  useGemini3_1,
130340
130344
  useCustomTools: useCustomToolModel,
130341
- hasAccessToPreview
130345
+ hasAccessToPreview,
130346
+ useGemini3_5Flash
130342
130347
  });
130343
130348
  if (!hasAccessToPreview && isPreviewModel(resolved2, config3)) {
130344
130349
  if (resolved2.includes("flash-lite")) {
130345
130350
  return DEFAULT_GEMINI_FLASH_LITE_MODEL;
130346
130351
  }
130347
130352
  if (resolved2.includes("flash")) {
130348
- return DEFAULT_GEMINI_FLASH_MODEL;
130353
+ return useGemini3_5Flash ? DEFAULT_GEMINI_3_5_FLASH_MODEL : DEFAULT_GEMINI_FLASH_MODEL;
130349
130354
  }
130350
130355
  return DEFAULT_GEMINI_MODEL;
130351
130356
  }
@@ -130374,7 +130379,7 @@ function resolveModel(requestedModel, useGemini3_1 = false, useCustomToolModel =
130374
130379
  break;
130375
130380
  }
130376
130381
  case GEMINI_MODEL_ALIAS_FLASH: {
130377
- resolved = PREVIEW_GEMINI_FLASH_MODEL;
130382
+ resolved = useGemini3_5Flash ? DEFAULT_GEMINI_3_5_FLASH_MODEL : PREVIEW_GEMINI_FLASH_MODEL;
130378
130383
  break;
130379
130384
  }
130380
130385
  case GEMINI_MODEL_ALIAS_FLASH_LITE: {
@@ -130389,10 +130394,13 @@ function resolveModel(requestedModel, useGemini3_1 = false, useCustomToolModel =
130389
130394
  if (resolved === "none") {
130390
130395
  return DEFAULT_GEMINI_FLASH_LITE_MODEL;
130391
130396
  }
130397
+ if (useGemini3_5Flash && isFlashModel(resolved)) {
130398
+ return DEFAULT_GEMINI_3_5_FLASH_MODEL;
130399
+ }
130392
130400
  if (!hasAccessToPreview && isPreviewModel(resolved)) {
130393
130401
  switch (resolved) {
130394
130402
  case PREVIEW_GEMINI_FLASH_MODEL:
130395
- return DEFAULT_GEMINI_FLASH_MODEL;
130403
+ return useGemini3_5Flash ? DEFAULT_GEMINI_3_5_FLASH_MODEL : DEFAULT_GEMINI_FLASH_MODEL;
130396
130404
  case PREVIEW_GEMINI_MODEL:
130397
130405
  case PREVIEW_GEMINI_3_1_MODEL:
130398
130406
  case PREVIEW_GEMINI_3_1_CUSTOM_TOOLS_MODEL:
@@ -130402,31 +130410,38 @@ function resolveModel(requestedModel, useGemini3_1 = false, useCustomToolModel =
130402
130410
  return DEFAULT_GEMINI_FLASH_LITE_MODEL;
130403
130411
  }
130404
130412
  if (resolved.includes("flash")) {
130405
- return DEFAULT_GEMINI_FLASH_MODEL;
130413
+ return useGemini3_5Flash ? DEFAULT_GEMINI_3_5_FLASH_MODEL : DEFAULT_GEMINI_FLASH_MODEL;
130406
130414
  }
130407
130415
  return DEFAULT_GEMINI_MODEL;
130408
130416
  }
130409
130417
  }
130410
130418
  return resolved;
130411
130419
  }
130412
- function resolveClassifierModel(requestedModel, modelAlias, useGemini3_1 = false, useCustomToolModel = false, hasAccessToPreview = true, config3) {
130420
+ function isFlashModel(model) {
130421
+ return model === DEFAULT_GEMINI_FLASH_MODEL || model === PREVIEW_GEMINI_FLASH_MODEL || model === DEFAULT_GEMINI_3_5_FLASH_MODEL || model === "flash" || model.endsWith("flash");
130422
+ }
130423
+ function resolveClassifierModel(requestedModel, modelAlias, useGemini3_1 = false, useCustomToolModel = false, hasAccessToPreview = true, config3, useGemini3_5Flash = false) {
130413
130424
  if (config3?.getExperimentalDynamicModelConfiguration?.() === true) {
130414
130425
  return config3.modelConfigService.resolveClassifierModelId(modelAlias, requestedModel, {
130415
130426
  useGemini3_1,
130416
130427
  useCustomTools: useCustomToolModel,
130417
- hasAccessToPreview
130428
+ hasAccessToPreview,
130429
+ useGemini3_5Flash
130418
130430
  });
130419
130431
  }
130420
130432
  if (modelAlias === GEMINI_MODEL_ALIAS_FLASH) {
130421
130433
  if (requestedModel === DEFAULT_GEMINI_MODEL_AUTO || requestedModel === DEFAULT_GEMINI_MODEL) {
130422
- return DEFAULT_GEMINI_FLASH_MODEL;
130434
+ return useGemini3_5Flash ? DEFAULT_GEMINI_3_5_FLASH_MODEL : DEFAULT_GEMINI_FLASH_MODEL;
130423
130435
  }
130424
130436
  if (requestedModel === PREVIEW_GEMINI_MODEL_AUTO || requestedModel === PREVIEW_GEMINI_MODEL || requestedModel === GEMINI_MODEL_ALIAS_AUTO) {
130437
+ if (useGemini3_5Flash) {
130438
+ return DEFAULT_GEMINI_3_5_FLASH_MODEL;
130439
+ }
130425
130440
  return hasAccessToPreview ? PREVIEW_GEMINI_FLASH_MODEL : DEFAULT_GEMINI_FLASH_MODEL;
130426
130441
  }
130427
- return resolveModel(GEMINI_MODEL_ALIAS_FLASH, false, false, hasAccessToPreview);
130442
+ return resolveModel(GEMINI_MODEL_ALIAS_FLASH, false, false, hasAccessToPreview, config3, useGemini3_5Flash);
130428
130443
  }
130429
- return resolveModel(requestedModel, useGemini3_1, useCustomToolModel, hasAccessToPreview, config3);
130444
+ return resolveModel(requestedModel, useGemini3_1, useCustomToolModel, hasAccessToPreview, config3, useGemini3_5Flash);
130430
130445
  }
130431
130446
  function getDisplayString(model, config3) {
130432
130447
  if (config3?.getExperimentalDynamicModelConfiguration?.() === true) {
@@ -130509,7 +130524,7 @@ function supportsMultimodalFunctionResponse(model, config3) {
130509
130524
  }
130510
130525
  return model.startsWith("gemini-3-");
130511
130526
  }
130512
- var PREVIEW_GEMINI_MODEL, PREVIEW_GEMINI_3_1_MODEL, PREVIEW_GEMINI_3_1_CUSTOM_TOOLS_MODEL, PREVIEW_GEMINI_FLASH_MODEL, DEFAULT_GEMINI_MODEL, DEFAULT_GEMINI_FLASH_MODEL, DEFAULT_GEMINI_FLASH_LITE_MODEL, PREVIEW_GEMINI_FLASH_LITE_MODEL, GEMMA_4_31B_IT_MODEL, GEMMA_4_26B_A4B_IT_MODEL, PREVIEW_GEMINI_MODEL_AUTO, DEFAULT_GEMINI_MODEL_AUTO, GEMINI_MODEL_ALIAS_AUTO, GEMINI_MODEL_ALIAS_PRO, GEMINI_MODEL_ALIAS_FLASH, GEMINI_MODEL_ALIAS_FLASH_LITE, DEFAULT_GEMINI_EMBEDDING_MODEL, DEFAULT_THINKING_MODE;
130527
+ var PREVIEW_GEMINI_MODEL, PREVIEW_GEMINI_3_1_MODEL, PREVIEW_GEMINI_3_1_CUSTOM_TOOLS_MODEL, PREVIEW_GEMINI_FLASH_MODEL, DEFAULT_GEMINI_MODEL, DEFAULT_GEMINI_FLASH_MODEL, DEFAULT_GEMINI_3_5_FLASH_MODEL, DEFAULT_GEMINI_FLASH_LITE_MODEL, PREVIEW_GEMINI_FLASH_LITE_MODEL, GEMMA_4_31B_IT_MODEL, GEMMA_4_26B_A4B_IT_MODEL, PREVIEW_GEMINI_MODEL_AUTO, DEFAULT_GEMINI_MODEL_AUTO, GEMINI_MODEL_ALIAS_AUTO, GEMINI_MODEL_ALIAS_PRO, GEMINI_MODEL_ALIAS_FLASH, GEMINI_MODEL_ALIAS_FLASH_LITE, DEFAULT_GEMINI_EMBEDDING_MODEL, DEFAULT_THINKING_MODE;
130513
130528
  var init_models = __esm({
130514
130529
  "packages/core/dist/src/config/models.js"() {
130515
130530
  "use strict";
@@ -130519,6 +130534,7 @@ var init_models = __esm({
130519
130534
  PREVIEW_GEMINI_FLASH_MODEL = "gemini-3-flash-preview";
130520
130535
  DEFAULT_GEMINI_MODEL = "gemini-2.5-pro";
130521
130536
  DEFAULT_GEMINI_FLASH_MODEL = "gemini-2.5-flash";
130537
+ DEFAULT_GEMINI_3_5_FLASH_MODEL = "gemini-3.5-flash";
130522
130538
  DEFAULT_GEMINI_FLASH_LITE_MODEL = "gemini-3.1-flash-lite";
130523
130539
  PREVIEW_GEMINI_FLASH_LITE_MODEL = "none";
130524
130540
  GEMMA_4_31B_IT_MODEL = "gemma-4-31b-it";
@@ -211638,8 +211654,8 @@ var GIT_COMMIT_INFO, CLI_VERSION;
211638
211654
  var init_git_commit = __esm({
211639
211655
  "packages/core/dist/src/generated/git-commit.js"() {
211640
211656
  "use strict";
211641
- GIT_COMMIT_INFO = "5a0bee901";
211642
- CLI_VERSION = "0.45.0-preview.1";
211657
+ GIT_COMMIT_INFO = "cfcecebe8";
211658
+ CLI_VERSION = "0.46.0-preview.0";
211643
211659
  }
211644
211660
  });
211645
211661
 
@@ -332664,7 +332680,7 @@ function getVersion() {
332664
332680
  }
332665
332681
  versionPromise = (async () => {
332666
332682
  const pkgJson = await getPackageJson(__dirname4);
332667
- return "0.45.0-preview.1";
332683
+ return "0.46.0-preview.0";
332668
332684
  })();
332669
332685
  return versionPromise;
332670
332686
  }
@@ -333503,7 +333519,7 @@ var init_errorClassification = __esm({
333503
333519
  function getModelPolicyChain(options) {
333504
333520
  const isAuto = options.isAutoSelection ?? false;
333505
333521
  if (options.previewEnabled) {
333506
- const proModel = resolveModel(PREVIEW_GEMINI_MODEL, options.useGemini31, options.useCustomToolModel);
333522
+ const proModel = resolveModel(PREVIEW_GEMINI_MODEL, options.useGemini31, options.useCustomToolModel, true, void 0, options.useGemini3_5Flash);
333507
333523
  return [
333508
333524
  definePolicy({
333509
333525
  model: proModel,
@@ -333631,15 +333647,17 @@ function resolvePolicyChain(config3, preferredModel, wrapsAround = false) {
333631
333647
  const useGemini31 = config3.getGemini31LaunchedSync?.() ?? false;
333632
333648
  const useCustomToolModel = config3.getUseCustomToolModelSync?.() ?? false;
333633
333649
  const hasAccessToPreview = config3.getHasAccessToPreviewModel?.() ?? false;
333650
+ const useGemini3_5Flash = config3.hasGemini35FlashGAAccess?.() ?? false;
333634
333651
  const isOriginallyGemini3 = isGemini3Model(modelFromConfig, config3);
333635
- const resolvedModel = normalizeModelId(resolveModel(modelFromConfig, useGemini31, useCustomToolModel, hasAccessToPreview, config3));
333652
+ const resolvedModel = normalizeModelId(resolveModel(modelFromConfig, useGemini31, useCustomToolModel, hasAccessToPreview, config3, useGemini3_5Flash));
333636
333653
  const isAutoPreferred = normalizedPreferredModel ? isAutoModel(normalizedPreferredModel, config3) : false;
333637
333654
  const isAutoConfigured = isAutoModel(configuredModel, config3);
333638
333655
  const effectiveWrapsAround = wrapsAround || isAutoPreferred || isAutoConfigured || isOriginallyGemini3;
333639
333656
  if (config3.getExperimentalDynamicModelConfiguration?.() === true) {
333640
333657
  const context2 = {
333641
333658
  useGemini3_1: useGemini31,
333642
- useCustomTools: useCustomToolModel
333659
+ useCustomTools: useCustomToolModel,
333660
+ useGemini3_5Flash
333643
333661
  };
333644
333662
  if (resolvedModel === DEFAULT_GEMINI_FLASH_LITE_MODEL) {
333645
333663
  chain2 = config3.modelConfigService.resolveChain("lite", context2);
@@ -333671,7 +333689,8 @@ function resolvePolicyChain(config3, preferredModel, wrapsAround = false) {
333671
333689
  isAutoSelection,
333672
333690
  userTier: config3.getUserTier(),
333673
333691
  useGemini31,
333674
- useCustomToolModel
333692
+ useCustomToolModel,
333693
+ useGemini3_5Flash
333675
333694
  });
333676
333695
  } else {
333677
333696
  chain2 = getModelPolicyChain({
@@ -333679,7 +333698,8 @@ function resolvePolicyChain(config3, preferredModel, wrapsAround = false) {
333679
333698
  isAutoSelection,
333680
333699
  userTier: config3.getUserTier(),
333681
333700
  useGemini31,
333682
- useCustomToolModel
333701
+ useCustomToolModel,
333702
+ useGemini3_5Flash
333683
333703
  });
333684
333704
  }
333685
333705
  } else {
@@ -337747,7 +337767,7 @@ async function createContentGenerator(config3, gcConfig, sessionId) {
337747
337767
  return new LoggingContentGenerator(fakeGenerator, gcConfig);
337748
337768
  }
337749
337769
  const version4 = await getVersion();
337750
- const model = resolveModel(gcConfig.getModel(), config3.authType === AuthType2.USE_GEMINI || config3.authType === AuthType2.USE_VERTEX_AI || (await gcConfig.getGemini31Launched?.() ?? false), false, gcConfig.getHasAccessToPreviewModel?.() ?? true, gcConfig);
337770
+ const model = resolveModel(gcConfig.getModel(), config3.authType === AuthType2.USE_GEMINI || config3.authType === AuthType2.USE_VERTEX_AI || (await gcConfig.getGemini31Launched?.() ?? false), false, gcConfig.getHasAccessToPreviewModel?.() ?? true, gcConfig, gcConfig.hasGemini35FlashGAAccess?.() ?? false);
337751
337771
  const customHeadersEnv = process.env["GEMINI_CLI_CUSTOM_HEADERS"] || void 0;
337752
337772
  const clientName = gcConfig.getClientName();
337753
337773
  const surface = determineSurface2();
@@ -354920,16 +354940,18 @@ ${result2.output}`;
354920
354940
  }
354921
354941
  signal.removeEventListener("abort", onAbort);
354922
354942
  timeoutController.signal.removeEventListener("abort", onAbort);
354923
- if (tempFilePath) {
354924
- try {
354925
- await fsPromises9.unlink(tempFilePath);
354926
- } catch {
354943
+ if (!this.params.is_background) {
354944
+ if (tempFilePath) {
354945
+ try {
354946
+ await fsPromises9.unlink(tempFilePath);
354947
+ } catch {
354948
+ }
354927
354949
  }
354928
- }
354929
- if (tempDir) {
354930
- try {
354931
- await fsPromises9.rm(tempDir, { recursive: true, force: true });
354932
- } catch {
354950
+ if (tempDir) {
354951
+ try {
354952
+ await fsPromises9.rm(tempDir, { recursive: true, force: true });
354953
+ } catch {
354954
+ }
354933
354955
  }
354934
354956
  }
354935
354957
  }
@@ -362255,9 +362277,9 @@ var init_geminiChat = __esm({
362255
362277
  const apiCall = async () => {
362256
362278
  const useGemini3_1 = await this.context.config.getGemini31Launched?.() ?? false;
362257
362279
  const hasAccessToPreview = this.context.config.getHasAccessToPreviewModel?.() ?? true;
362258
- let modelToUse = resolveModel(lastModelToUse, useGemini3_1, false, hasAccessToPreview, this.context.config);
362280
+ let modelToUse = resolveModel(lastModelToUse, useGemini3_1, false, hasAccessToPreview, this.context.config, this.context.config.hasGemini35FlashGAAccess?.() ?? false);
362259
362281
  if (this.context.config.getActiveModel() !== initialActiveModel) {
362260
- modelToUse = resolveModel(this.context.config.getActiveModel(), useGemini3_1, false, hasAccessToPreview, this.context.config);
362282
+ modelToUse = resolveModel(this.context.config.getActiveModel(), useGemini3_1, false, hasAccessToPreview, this.context.config, this.context.config.hasGemini35FlashGAAccess?.() ?? false);
362261
362283
  }
362262
362284
  if (modelToUse !== lastModelToUse) {
362263
362285
  const { generateContentConfig: newConfig } = this.context.config.modelConfigService.getResolvedConfig({
@@ -362296,7 +362318,7 @@ var init_geminiChat = __esm({
362296
362318
  throw new AgentExecutionBlockedError(beforeModelResult.reason || "Model call blocked by hook", syntheticResponse);
362297
362319
  }
362298
362320
  if (beforeModelResult.modifiedModel) {
362299
- modelToUse = resolveModel(beforeModelResult.modifiedModel, useGemini3_1, false, hasAccessToPreview, this.context.config);
362321
+ modelToUse = resolveModel(beforeModelResult.modifiedModel, useGemini3_1, false, hasAccessToPreview, this.context.config, this.context.config.hasGemini35FlashGAAccess?.() ?? false);
362300
362322
  lastModelToUse = modelToUse;
362301
362323
  contentsToUse = supportsModernFeatures(modelToUse) ? [...contentsForPreviewModel] : [...requestContents];
362302
362324
  }
@@ -364694,7 +364716,7 @@ var init_promptProvider = __esm({
364694
364716
  const isTopicUpdateNarrationEnabled = topicUpdateNarrationOverride ?? context2.config.isTopicUpdateNarrationEnabled();
364695
364717
  const enabledToolNames = new Set(toolNames);
364696
364718
  const approvedPlanPath = context2.config.getApprovedPlanPath();
364697
- const desiredModel = resolveModel(context2.config.getActiveModel(), context2.config.getGemini31LaunchedSync?.() ?? false, false, context2.config.getHasAccessToPreviewModel?.() ?? true, context2.config);
364719
+ const desiredModel = resolveModel(context2.config.getActiveModel(), context2.config.getGemini31LaunchedSync?.() ?? false, false, context2.config.getHasAccessToPreviewModel?.() ?? true, context2.config, context2.config.hasGemini35FlashGAAccess?.() ?? false);
364698
364720
  const isModernModel = supportsModernFeatures(desiredModel);
364699
364721
  const activeSnippets = isModernModel ? snippets_exports : snippets_legacy_exports;
364700
364722
  const contextFilenames = getAllGeminiMdFilenames();
@@ -364812,7 +364834,7 @@ var init_promptProvider = __esm({
364812
364834
  return sanitizedPrompt;
364813
364835
  }
364814
364836
  getCompressionPrompt(context2) {
364815
- const desiredModel = resolveModel(context2.config.getActiveModel(), context2.config.getGemini31LaunchedSync?.() ?? false, false, context2.config.getHasAccessToPreviewModel?.() ?? true, context2.config);
364837
+ const desiredModel = resolveModel(context2.config.getActiveModel(), context2.config.getGemini31LaunchedSync?.() ?? false, false, context2.config.getHasAccessToPreviewModel?.() ?? true, context2.config, context2.config.hasGemini35FlashGAAccess?.() ?? false);
364816
364838
  const isModernModel = supportsModernFeatures(desiredModel);
364817
364839
  const activeSnippets = isModernModel ? snippets_exports : snippets_legacy_exports;
364818
364840
  return activeSnippets.getCompressionPrompt(context2.config.getApprovedPlanPath());
@@ -374244,6 +374266,8 @@ var init_modelConfigService = __esm({
374244
374266
  return value === context2.useGemini3_1;
374245
374267
  case "useGemini3_1FlashLite":
374246
374268
  return value === context2.useGemini3_1FlashLite;
374269
+ case "useGemini3_5Flash":
374270
+ return value === context2.useGemini3_5Flash;
374247
374271
  case "useCustomTools":
374248
374272
  return value === context2.useCustomTools;
374249
374273
  case "hasAccessToPreview":
@@ -380801,7 +380825,7 @@ var init_client4 = __esm({
380801
380825
  if (this.currentSequenceModel) {
380802
380826
  return this.currentSequenceModel;
380803
380827
  }
380804
- return resolveModel(this.config.getActiveModel(), this.config.getGemini31LaunchedSync?.() ?? false, false, this.config.getHasAccessToPreviewModel?.() ?? true, this.config);
380828
+ return resolveModel(this.config.getActiveModel(), this.config.getGemini31LaunchedSync?.() ?? false, false, this.config.getHasAccessToPreviewModel?.() ?? true, this.config, this.config.hasGemini35FlashGAAccess?.() ?? false);
380805
380829
  }
380806
380830
  async *processTurn(request, signal, prompt_id, boundedTurns, displayContent) {
380807
380831
  let turn = new Turn(this.getChat(), prompt_id);
@@ -394730,7 +394754,7 @@ var init_defaultStrategy = __esm({
394730
394754
  DefaultStrategy = class {
394731
394755
  name = "default";
394732
394756
  async route(_context, config3, _baseLlmClient, _localLiteRtLmClient) {
394733
- const defaultModel = resolveModel(config3.getModel(), config3.getGemini31LaunchedSync?.() ?? false, false, config3.getHasAccessToPreviewModel?.() ?? true, config3);
394757
+ const defaultModel = resolveModel(config3.getModel(), config3.getGemini31LaunchedSync?.() ?? false, false, config3.getHasAccessToPreviewModel?.() ?? true, config3, config3.hasGemini35FlashGAAccess?.() ?? false);
394734
394758
  return {
394735
394759
  model: defaultModel,
394736
394760
  metadata: {
@@ -395152,7 +395176,7 @@ var init_fallbackStrategy = __esm({
395152
395176
  name = "fallback";
395153
395177
  async route(context2, config3, _baseLlmClient, _localLiteRtLmClient) {
395154
395178
  const requestedModel = context2.requestedModel ?? config3.getModel();
395155
- const resolvedModel = resolveModel(requestedModel, config3.getGemini31LaunchedSync?.() ?? false, false, config3.getHasAccessToPreviewModel?.() ?? true, config3);
395179
+ const resolvedModel = resolveModel(requestedModel, config3.getGemini31LaunchedSync?.() ?? false, false, config3.getHasAccessToPreviewModel?.() ?? true, config3, config3.hasGemini35FlashGAAccess?.() ?? false);
395156
395180
  const service = config3.getModelAvailabilityService();
395157
395181
  const snapshot = service.snapshot(resolvedModel);
395158
395182
  if (snapshot.available) {
@@ -395189,7 +395213,7 @@ var init_overrideStrategy = __esm({
395189
395213
  return null;
395190
395214
  }
395191
395215
  return {
395192
- model: resolveModel(overrideModel, config3.getGemini31LaunchedSync?.() ?? false, false, config3.getHasAccessToPreviewModel?.() ?? true, config3),
395216
+ model: resolveModel(overrideModel, config3.getGemini31LaunchedSync?.() ?? false, false, config3.getHasAccessToPreviewModel?.() ?? true, config3, config3.hasGemini35FlashGAAccess?.() ?? false),
395193
395217
  metadata: {
395194
395218
  source: this.name,
395195
395219
  latencyMs: 0,
@@ -395463,6 +395487,12 @@ var init_defaultModelConfigs = __esm({
395463
395487
  model: "gemini-3.1-flash-lite"
395464
395488
  }
395465
395489
  },
395490
+ "gemini-3.5-flash": {
395491
+ extends: "chat-base-3",
395492
+ modelConfig: {
395493
+ model: "gemini-3.5-flash"
395494
+ }
395495
+ },
395466
395496
  "gemma-4-31b-it": {
395467
395497
  extends: "chat-base-3",
395468
395498
  modelConfig: {
@@ -395488,6 +395518,12 @@ var init_defaultModelConfigs = __esm({
395488
395518
  model: "gemini-3-flash-preview"
395489
395519
  }
395490
395520
  },
395521
+ "gemini-3.5-flash-base": {
395522
+ extends: "base",
395523
+ modelConfig: {
395524
+ model: "gemini-3.5-flash"
395525
+ }
395526
+ },
395491
395527
  classifier: {
395492
395528
  extends: "base",
395493
395529
  modelConfig: {
@@ -395695,6 +395731,13 @@ var init_defaultModelConfigs = __esm({
395695
395731
  isVisible: true,
395696
395732
  features: { thinking: false, multimodalToolUse: true }
395697
395733
  },
395734
+ "gemini-3.5-flash": {
395735
+ tier: "flash",
395736
+ family: "gemini-3",
395737
+ isPreview: false,
395738
+ isVisible: true,
395739
+ features: { thinking: false, multimodalToolUse: true }
395740
+ },
395698
395741
  "gemini-2.5-pro": {
395699
395742
  tier: "pro",
395700
395743
  family: "gemini-2.5",
@@ -395797,12 +395840,32 @@ var init_defaultModelConfigs = __esm({
395797
395840
  "gemini-3-flash-preview": {
395798
395841
  default: "gemini-3-flash-preview",
395799
395842
  contexts: [
395843
+ { condition: { useGemini3_5Flash: true }, target: "gemini-3.5-flash" },
395800
395844
  {
395801
395845
  condition: { hasAccessToPreview: false },
395802
395846
  target: "gemini-2.5-flash"
395803
395847
  }
395804
395848
  ]
395805
395849
  },
395850
+ "gemini-3.5-flash": {
395851
+ default: "gemini-3.5-flash",
395852
+ contexts: [
395853
+ {
395854
+ condition: { useGemini3_5Flash: false, hasAccessToPreview: false },
395855
+ target: "gemini-2.5-flash"
395856
+ },
395857
+ {
395858
+ condition: { useGemini3_5Flash: false },
395859
+ target: "gemini-3-flash-preview"
395860
+ }
395861
+ ]
395862
+ },
395863
+ "gemini-2.5-flash": {
395864
+ default: "gemini-2.5-flash",
395865
+ contexts: [
395866
+ { condition: { useGemini3_5Flash: true }, target: "gemini-3.5-flash" }
395867
+ ]
395868
+ },
395806
395869
  "gemini-3-pro-preview": {
395807
395870
  default: "gemini-3-pro-preview",
395808
395871
  contexts: [
@@ -395851,6 +395914,7 @@ var init_defaultModelConfigs = __esm({
395851
395914
  flash: {
395852
395915
  default: "gemini-3-flash-preview",
395853
395916
  contexts: [
395917
+ { condition: { useGemini3_5Flash: true }, target: "gemini-3.5-flash" },
395854
395918
  {
395855
395919
  condition: { hasAccessToPreview: false },
395856
395920
  target: "gemini-2.5-flash"
@@ -395882,6 +395946,7 @@ var init_defaultModelConfigs = __esm({
395882
395946
  flash: {
395883
395947
  default: "gemini-3-flash-preview",
395884
395948
  contexts: [
395949
+ { condition: { useGemini3_5Flash: true }, target: "gemini-3.5-flash" },
395885
395950
  {
395886
395951
  condition: { hasAccessToPreview: false },
395887
395952
  target: "gemini-2.5-flash"
@@ -399350,7 +399415,8 @@ var init_flagNames = __esm({
399350
399415
  MASKING_PROTECT_LATEST_TURN: 45758819,
399351
399416
  GEMINI_3_1_PRO_LAUNCHED: 45760185,
399352
399417
  PRO_MODEL_NO_ACCESS: 45768879,
399353
- DEFAULT_REQUEST_TIMEOUT: 45773134
399418
+ DEFAULT_REQUEST_TIMEOUT: 45773134,
399419
+ GEMINI_3_5_FLASH_GA_LAUNCHED: 45780819
399354
399420
  };
399355
399421
  }
399356
399422
  });
@@ -410418,7 +410484,7 @@ var init_config4 = __esm({
410418
410484
  if (!isAutoModel(model, this)) {
410419
410485
  return {};
410420
410486
  }
410421
- const primaryModel = resolveModel(model, this.getGemini31LaunchedSync(), this.getUseCustomToolModelSync(), this.getHasAccessToPreviewModel(), this);
410487
+ const primaryModel = resolveModel(model, this.getGemini31LaunchedSync(), this.getUseCustomToolModelSync(), this.getHasAccessToPreviewModel(), this, this.hasGemini35FlashGAAccess());
410422
410488
  const isPreview = isPreviewModel(primaryModel, this);
410423
410489
  const proModel = primaryModel;
410424
410490
  const flashModel = isPreview ? PREVIEW_GEMINI_FLASH_MODEL : DEFAULT_GEMINI_FLASH_MODEL;
@@ -410439,7 +410505,7 @@ var init_config4 = __esm({
410439
410505
  if (pooled.remaining !== void 0) {
410440
410506
  return pooled.remaining;
410441
410507
  }
410442
- const primaryModel = resolveModel(this.getModel(), this.getGemini31LaunchedSync(), this.getUseCustomToolModelSync(), this.getHasAccessToPreviewModel(), this);
410508
+ const primaryModel = resolveModel(this.getModel(), this.getGemini31LaunchedSync(), this.getUseCustomToolModelSync(), this.getHasAccessToPreviewModel(), this, this.hasGemini35FlashGAAccess());
410443
410509
  return this.modelQuotas.get(primaryModel)?.remaining;
410444
410510
  }
410445
410511
  getQuotaLimit() {
@@ -410447,7 +410513,7 @@ var init_config4 = __esm({
410447
410513
  if (pooled.limit !== void 0) {
410448
410514
  return pooled.limit;
410449
410515
  }
410450
- const primaryModel = resolveModel(this.getModel(), this.getGemini31LaunchedSync(), this.getUseCustomToolModelSync(), this.getHasAccessToPreviewModel(), this);
410516
+ const primaryModel = resolveModel(this.getModel(), this.getGemini31LaunchedSync(), this.getUseCustomToolModelSync(), this.getHasAccessToPreviewModel(), this, this.hasGemini35FlashGAAccess());
410451
410517
  return this.modelQuotas.get(primaryModel)?.limit;
410452
410518
  }
410453
410519
  getQuotaResetTime() {
@@ -410455,7 +410521,7 @@ var init_config4 = __esm({
410455
410521
  if (pooled.resetTime !== void 0) {
410456
410522
  return pooled.resetTime;
410457
410523
  }
410458
- const primaryModel = resolveModel(this.getModel(), this.getGemini31LaunchedSync(), this.getUseCustomToolModelSync(), this.getHasAccessToPreviewModel(), this);
410524
+ const primaryModel = resolveModel(this.getModel(), this.getGemini31LaunchedSync(), this.getUseCustomToolModelSync(), this.getHasAccessToPreviewModel(), this, this.hasGemini35FlashGAAccess());
410459
410525
  return this.modelQuotas.get(primaryModel)?.resetTime;
410460
410526
  }
410461
410527
  getEmbeddingModel() {
@@ -411439,6 +411505,26 @@ ${sections.join("\n")}
411439
411505
  isGemini31LaunchedForAuthType(authType) {
411440
411506
  return authType === AuthType2.USE_GEMINI || authType === AuthType2.USE_VERTEX_AI || authType === AuthType2.GATEWAY;
411441
411507
  }
411508
+ /**
411509
+ * Returns whether Gemini 3.5 Flash GA has been launched.
411510
+ *
411511
+ * Note: This method should only be called after startup, once experiments have been loaded.
411512
+ */
411513
+ hasGemini35FlashGAAccess() {
411514
+ const authType = this.contentGeneratorConfig?.authType;
411515
+ const hasAccess = (() => {
411516
+ if (this.isGemini31LaunchedForAuthType(authType)) {
411517
+ return true;
411518
+ }
411519
+ return this.experiments?.flags[ExperimentFlags.GEMINI_3_5_FLASH_GA_LAUNCHED]?.boolValue ?? false;
411520
+ })();
411521
+ if (hasAccess) {
411522
+ setFlashModels("gemini-3.5-flash", "gemini-3.5-flash");
411523
+ } else {
411524
+ setFlashModels("gemini-3-flash-preview", "gemini-2.5-flash");
411525
+ }
411526
+ return hasAccess;
411527
+ }
411442
411528
  /**
411443
411529
  * Returns whether Gemini 3.1 has been launched.
411444
411530
  *