@google/gemini-cli 0.54.0-preview.0 → 0.54.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.
Files changed (50) hide show
  1. package/bundle/{chunk-PMUWVEQP.js → chunk-2MRUXBJ5.js} +7 -7
  2. package/bundle/{chunk-XTGYOEM3.js → chunk-43HYOV6F.js} +1 -1
  3. package/bundle/{chunk-CPVZILP2.js → chunk-5SMD2SLQ.js} +2 -2
  4. package/bundle/{chunk-K7T2IFNS.js → chunk-BBNFLOXC.js} +1 -1
  5. package/bundle/{chunk-UOZMJZMA.js → chunk-F6IU45OZ.js} +180 -39
  6. package/bundle/{chunk-KU7W3PYO.js → chunk-G7VQ6O6G.js} +1 -1
  7. package/bundle/{chunk-4GNXWN36.js → chunk-GOQJOV4P.js} +1 -1
  8. package/bundle/{chunk-HM6J5QFA.js → chunk-HS7THREL.js} +208 -42
  9. package/bundle/{chunk-GMYSSSFG.js → chunk-IM5WJKYT.js} +1 -1
  10. package/bundle/{chunk-JKXIXUUH.js → chunk-JPCDQXHB.js} +1 -1
  11. package/bundle/{chunk-I2F6JPKA.js → chunk-LH73BY77.js} +7 -7
  12. package/bundle/{chunk-ZJJUEIJO.js → chunk-MOGTJC2T.js} +1 -1
  13. package/bundle/{chunk-CZ6IKC6W.js → chunk-MZBH35ZS.js} +1 -1
  14. package/bundle/{chunk-HYGO4QEK.js → chunk-NZ6P6XKP.js} +2 -2
  15. package/bundle/{chunk-24AZRO3S.js → chunk-OYZ2XVON.js} +3 -3
  16. package/bundle/{chunk-S2XDE4E6.js → chunk-RHINAWEP.js} +7 -7
  17. package/bundle/{chunk-X7LEASVK.js → chunk-SHZORH3T.js} +1 -1
  18. package/bundle/{chunk-5X6WKNCA.js → chunk-SQWRALPF.js} +1 -1
  19. package/bundle/{chunk-ANCJ47GY.js → chunk-TZAOURRV.js} +1 -1
  20. package/bundle/{chunk-KFW7GOXJ.js → chunk-UTXCUPDT.js} +2 -2
  21. package/bundle/{chunk-BMD42WWR.js → chunk-UW4NSSB6.js} +3 -3
  22. package/bundle/{chunk-QZ32DOIY.js → chunk-VIQEWLM4.js} +1 -1
  23. package/bundle/{chunk-YVWOOS5D.js → chunk-WJKZRJIC.js} +3 -3
  24. package/bundle/{chunk-YOK6TS2W.js → chunk-YYWWE5GW.js} +208 -42
  25. package/bundle/{cleanup-CI4EZBGK.js → cleanup-5UYKVLIF.js} +2 -2
  26. package/bundle/{cleanup-NW33L7BG.js → cleanup-6OO5MA6W.js} +2 -2
  27. package/bundle/{cleanup-WCECJVAH.js → cleanup-ODOGWYRM.js} +2 -2
  28. package/bundle/{core-X6AKTKZS.js → core-JL633Z4N.js} +15 -1
  29. package/bundle/{dist-FM4XWKSV.js → core-S5B3NEKC.js} +15 -1
  30. package/bundle/{devtoolsService-HT4GPBRA.js → devtoolsService-FUTPYP6V.js} +2 -2
  31. package/bundle/{devtoolsService-YWDOWAQ7.js → devtoolsService-NZQZUVCI.js} +2 -2
  32. package/bundle/{devtoolsService-I4VSDXDZ.js → devtoolsService-YWNTGRUE.js} +2 -2
  33. package/bundle/{core-JXOKFSQM.js → dist-DB6LWOKZ.js} +15 -1
  34. package/bundle/{gemini-6QYTVAVR.js → gemini-AQASGK5V.js} +84 -20
  35. package/bundle/{gemini-LAE4PTZV.js → gemini-D3BRVDVJ.js} +84 -20
  36. package/bundle/{gemini-M37ESLGX.js → gemini-PPNY5YY6.js} +84 -20
  37. package/bundle/gemini.js +7 -7
  38. package/bundle/{interactiveCli-353YNM5T.js → interactiveCli-CXCZMXKQ.js} +99 -9
  39. package/bundle/{interactiveCli-D26FIBDY.js → interactiveCli-P7QQLIDS.js} +99 -9
  40. package/bundle/{interactiveCli-OZI3EOZ3.js → interactiveCli-RU7LCVXL.js} +99 -9
  41. package/bundle/{liteRtServerManager-CHOKKKD7.js → liteRtServerManager-FIVLVXQJ.js} +4 -4
  42. package/bundle/{liteRtServerManager-QZER65XK.js → liteRtServerManager-ISKYY742.js} +4 -4
  43. package/bundle/{liteRtServerManager-5L6ZKYIO.js → liteRtServerManager-MPPOFOTR.js} +4 -4
  44. package/bundle/{oauth2-provider-DOSOCLE2.js → oauth2-provider-DOIL6PEC.js} +1 -1
  45. package/bundle/{oauth2-provider-2DMHCM63.js → oauth2-provider-G6DF4NEU.js} +1 -1
  46. package/bundle/{oauth2-provider-RYXZZKGA.js → oauth2-provider-XR5UQYQV.js} +1 -1
  47. package/bundle/{start-GSFOK3MC.js → start-AJW7OVPU.js} +6 -6
  48. package/bundle/{start-H6TOQQTQ.js → start-S77W5RNK.js} +6 -6
  49. package/bundle/{start-6KDQYY22.js → start-YWT3TSZW.js} +6 -6
  50. package/package.json +1 -1
@@ -157,10 +157,10 @@ import {
157
157
  widestLineFromStyledChars,
158
158
  wordBreakStyledChars,
159
159
  wrapStyledChars
160
- } from "./chunk-PMUWVEQP.js";
160
+ } from "./chunk-2MRUXBJ5.js";
161
161
  import {
162
162
  require_source
163
- } from "./chunk-ZJJUEIJO.js";
163
+ } from "./chunk-G7VQ6O6G.js";
164
164
  import {
165
165
  appEvents
166
166
  } from "./chunk-5PS3AYFU.js";
@@ -214,24 +214,24 @@ import {
214
214
  stripAnsi,
215
215
  stripUnsafeCharacters,
216
216
  toCodePoints
217
- } from "./chunk-4GNXWN36.js";
217
+ } from "./chunk-GOQJOV4P.js";
218
218
  import {
219
219
  handleAutoUpdate,
220
220
  isDevelopment,
221
221
  relaunchApp,
222
222
  setUpdateHandler
223
- } from "./chunk-HYGO4QEK.js";
223
+ } from "./chunk-5SMD2SLQ.js";
224
224
  import {
225
225
  isTodoList,
226
226
  mapCoreStatusToDisplayStatus,
227
227
  require_react
228
- } from "./chunk-CZ6IKC6W.js";
228
+ } from "./chunk-MZBH35ZS.js";
229
229
  import {
230
230
  registerCleanup,
231
231
  removeCleanup,
232
232
  runExitCleanup,
233
233
  setupTtyCheck
234
- } from "./chunk-X7LEASVK.js";
234
+ } from "./chunk-IM5WJKYT.js";
235
235
  import {
236
236
  ACTIVATE_SKILL_TOOL_NAME,
237
237
  AGENT_TOOL_NAME,
@@ -275,12 +275,14 @@ import {
275
275
  LegacyAgentProtocol,
276
276
  LlmRole,
277
277
  Logger,
278
+ MAX_TOKENS_EXCEEDED_SUGGESTION,
278
279
  MCPDiscoveryState,
279
280
  MCPServerStatus,
280
281
  MessageBusType,
281
282
  MessageSenderType,
282
283
  ModelNotFoundError,
283
284
  ModelSlashCommandEvent,
285
+ OTHER_BLOCKED_MESSAGE,
284
286
  OverageMenuShownEvent,
285
287
  OverageOptionSelectedEvent,
286
288
  PREVIEW_GEMINI_3_1_CUSTOM_TOOLS_MODEL,
@@ -293,8 +295,10 @@ import {
293
295
  QuestionType,
294
296
  READ_FILE_DISPLAY_NAME,
295
297
  READ_MANY_FILES_DISPLAY_NAME,
298
+ RECITATION_BLOCKED_MESSAGE,
296
299
  RELEASE_CHANNEL_STABILITY,
297
300
  ROOT_SCHEDULER_ID,
301
+ SAFETY_BLOCKED_MESSAGE,
298
302
  SHELL_TOOL_NAME,
299
303
  Scheduler,
300
304
  SessionEndReason,
@@ -303,9 +307,11 @@ import {
303
307
  SlashCommandStatus,
304
308
  Storage,
305
309
  SubagentState,
310
+ THINKING_ONLY_COMPRESS_SUGGESTION,
306
311
  TOPIC_PARAM_STRATEGIC_INTENT,
307
312
  TOPIC_PARAM_SUMMARY,
308
313
  TOPIC_PARAM_TITLE,
314
+ TRUE_EMPTY_RESPONSE_MESSAGE,
309
315
  TerminalQuotaError,
310
316
  ToolConfirmationOutcome,
311
317
  ToolErrorType,
@@ -431,7 +437,7 @@ import {
431
437
  validatePlanContent,
432
438
  validatePlanPath,
433
439
  writeToStdout
434
- } from "./chunk-UOZMJZMA.js";
440
+ } from "./chunk-F6IU45OZ.js";
435
441
  import "./chunk-664ZODQF.js";
436
442
  import "./chunk-IUUIT4SU.js";
437
443
  import "./chunk-TUDYL3X4.js";
@@ -8050,6 +8056,18 @@ function areModelMetricsEqual(a, b) {
8050
8056
  if (a.api.totalRequests !== b.api.totalRequests || a.api.totalErrors !== b.api.totalErrors || a.api.totalLatencyMs !== b.api.totalLatencyMs) {
8051
8057
  return false;
8052
8058
  }
8059
+ const errorsA = a.api.errorsByType || {};
8060
+ const errorsB = b.api.errorsByType || {};
8061
+ const keysA = Object.keys(errorsA);
8062
+ const keysB = Object.keys(errorsB);
8063
+ if (keysA.length !== keysB.length) {
8064
+ return false;
8065
+ }
8066
+ for (const key of keysA) {
8067
+ if (errorsA[key] !== errorsB[key]) {
8068
+ return false;
8069
+ }
8070
+ }
8053
8071
  if (a.tokens.input !== b.tokens.input || a.tokens.prompt !== b.tokens.prompt || a.tokens.candidates !== b.tokens.candidates || a.tokens.total !== b.tokens.total || a.tokens.cached !== b.tokens.cached || a.tokens.thoughts !== b.tokens.thoughts || a.tokens.tool !== b.tokens.tool) {
8054
8072
  return false;
8055
8073
  }
@@ -27765,6 +27783,52 @@ var useGeminiStream = (geminiClient, history, addItem, config, settings, onDebug
27765
27783
  maybeAddLowVerbosityFailureNote
27766
27784
  ]
27767
27785
  );
27786
+ const handleInvalidStreamEvent = (0, import_react99.useCallback)(
27787
+ (eventValue, userMessageTimestamp) => {
27788
+ if (pendingHistoryItemRef.current) {
27789
+ addItem(pendingHistoryItemRef.current, userMessageTimestamp);
27790
+ setPendingHistoryItem(null);
27791
+ }
27792
+ maybeAddSuppressedToolErrorNote(userMessageTimestamp);
27793
+ let text = eventValue?.message?.trim() || "Invalid stream received from model";
27794
+ if (eventValue?.type === "NO_RESPONSE_TEXT") {
27795
+ text = TRUE_EMPTY_RESPONSE_MESSAGE;
27796
+ } else if (eventValue?.type === "THINKING_ONLY_RESPONSE") {
27797
+ text = THINKING_ONLY_COMPRESS_SUGGESTION;
27798
+ } else if (eventValue?.type === "MAX_TOKENS_EXCEEDED") {
27799
+ text = MAX_TOKENS_EXCEEDED_SUGGESTION;
27800
+ } else if (eventValue?.type === "SAFETY_BLOCKED") {
27801
+ text = SAFETY_BLOCKED_MESSAGE;
27802
+ } else if (eventValue?.type === "RECITATION_BLOCKED") {
27803
+ text = RECITATION_BLOCKED_MESSAGE;
27804
+ } else if (eventValue?.type === "OTHER_BLOCKED") {
27805
+ text = OTHER_BLOCKED_MESSAGE;
27806
+ }
27807
+ uiTelemetryService.recordSemanticValidationError(
27808
+ geminiClient.getCurrentSequenceModel() ?? config.getModel(),
27809
+ eventValue?.type || "INVALID_STREAM"
27810
+ );
27811
+ addItem(
27812
+ {
27813
+ type: "error" /* ERROR */,
27814
+ text
27815
+ },
27816
+ userMessageTimestamp
27817
+ );
27818
+ maybeAddLowVerbosityFailureNote(userMessageTimestamp);
27819
+ setThought(null);
27820
+ },
27821
+ [
27822
+ addItem,
27823
+ pendingHistoryItemRef,
27824
+ setPendingHistoryItem,
27825
+ setThought,
27826
+ maybeAddSuppressedToolErrorNote,
27827
+ maybeAddLowVerbosityFailureNote,
27828
+ config,
27829
+ geminiClient
27830
+ ]
27831
+ );
27768
27832
  const handleCitationEvent = (0, import_react99.useCallback)(
27769
27833
  (text, userMessageTimestamp) => {
27770
27834
  if (!showCitations(settings)) {
@@ -28020,7 +28084,9 @@ var useGeminiStream = (geminiClient, history, addItem, config, settings, onDebug
28020
28084
  loopDetectedRef.current = true;
28021
28085
  break;
28022
28086
  case GeminiEventType.Retry:
28087
+ break;
28023
28088
  case GeminiEventType.InvalidStream:
28089
+ handleInvalidStreamEvent(event.value, userMessageTimestamp);
28024
28090
  break;
28025
28091
  default: {
28026
28092
  const unreachable = event;
@@ -28052,6 +28118,7 @@ var useGeminiStream = (geminiClient, history, addItem, config, settings, onDebug
28052
28118
  handleChatModelEvent,
28053
28119
  handleAgentExecutionStoppedEvent,
28054
28120
  handleAgentExecutionBlockedEvent,
28121
+ handleInvalidStreamEvent,
28055
28122
  addItem,
28056
28123
  pendingHistoryItemRef,
28057
28124
  setPendingHistoryItem,
@@ -28294,6 +28361,28 @@ var useGeminiStream = (geminiClient, history, addItem, config, settings, onDebug
28294
28361
  return false;
28295
28362
  }
28296
28363
  );
28364
+ if (turnCancelledRef.current) {
28365
+ setIsResponding(false);
28366
+ const geminiTools2 = completedAndReadyToSubmitTools.filter(
28367
+ (t) => !t.request.isClientInitiated
28368
+ );
28369
+ if (geminiClient && geminiTools2.length > 0) {
28370
+ const combinedParts = geminiTools2.flatMap(
28371
+ (toolCall) => toolCall.response.responseParts
28372
+ );
28373
+ if (combinedParts.length > 0) {
28374
+ geminiClient.addHistory({
28375
+ role: "user",
28376
+ parts: combinedParts
28377
+ });
28378
+ }
28379
+ }
28380
+ const callIdsToMarkAsSubmitted2 = toolCalls.map(
28381
+ (toolCall) => toolCall.request.callId
28382
+ );
28383
+ markToolsAsSubmitted(callIdsToMarkAsSubmitted2);
28384
+ return;
28385
+ }
28297
28386
  const clientTools = completedAndReadyToSubmitTools.filter(
28298
28387
  (t) => t.request.isClientInitiated
28299
28388
  );
@@ -28431,7 +28520,8 @@ var useGeminiStream = (geminiClient, history, addItem, config, settings, onDebug
28431
28520
  isLowErrorVerbosity,
28432
28521
  maybeAddSuppressedToolErrorNote,
28433
28522
  maybeAddLowVerbosityFailureNote,
28434
- setIsResponding
28523
+ setIsResponding,
28524
+ toolCalls
28435
28525
  ]
28436
28526
  );
28437
28527
  const pendingHistoryItems = (0, import_react99.useMemo)(
@@ -33797,7 +33887,7 @@ ${queuedText}` : queuedText;
33797
33887
  if (keyMatchers["app.showErrorDetails" /* SHOW_ERROR_DETAILS */](key)) {
33798
33888
  if (settings.merged.general.devtools) {
33799
33889
  void (async () => {
33800
- const { toggleDevToolsPanel } = await import("./devtoolsService-I4VSDXDZ.js");
33890
+ const { toggleDevToolsPanel } = await import("./devtoolsService-YWNTGRUE.js");
33801
33891
  await toggleDevToolsPanel(
33802
33892
  config,
33803
33893
  showErrorDetails,
@@ -157,10 +157,10 @@ import {
157
157
  widestLineFromStyledChars,
158
158
  wordBreakStyledChars,
159
159
  wrapStyledChars
160
- } from "./chunk-S2XDE4E6.js";
160
+ } from "./chunk-RHINAWEP.js";
161
161
  import {
162
162
  require_source
163
- } from "./chunk-KU7W3PYO.js";
163
+ } from "./chunk-BBNFLOXC.js";
164
164
  import {
165
165
  appEvents
166
166
  } from "./chunk-5PS3AYFU.js";
@@ -214,24 +214,24 @@ import {
214
214
  stripAnsi,
215
215
  stripUnsafeCharacters,
216
216
  toCodePoints
217
- } from "./chunk-QZ32DOIY.js";
217
+ } from "./chunk-VIQEWLM4.js";
218
218
  import {
219
219
  handleAutoUpdate,
220
220
  isDevelopment,
221
221
  relaunchApp,
222
222
  setUpdateHandler
223
- } from "./chunk-KFW7GOXJ.js";
223
+ } from "./chunk-UTXCUPDT.js";
224
224
  import {
225
225
  isTodoList,
226
226
  mapCoreStatusToDisplayStatus,
227
227
  require_react
228
- } from "./chunk-ANCJ47GY.js";
228
+ } from "./chunk-SQWRALPF.js";
229
229
  import {
230
230
  registerCleanup,
231
231
  removeCleanup,
232
232
  runExitCleanup,
233
233
  setupTtyCheck
234
- } from "./chunk-XTGYOEM3.js";
234
+ } from "./chunk-43HYOV6F.js";
235
235
  import {
236
236
  ACTIVATE_SKILL_TOOL_NAME,
237
237
  AGENT_TOOL_NAME,
@@ -268,8 +268,10 @@ import {
268
268
  LegacyAgentProtocol,
269
269
  LlmRole,
270
270
  Logger,
271
+ MAX_TOKENS_EXCEEDED_SUGGESTION,
271
272
  ModelNotFoundError,
272
273
  ModelSlashCommandEvent,
274
+ OTHER_BLOCKED_MESSAGE,
273
275
  OverageMenuShownEvent,
274
276
  OverageOptionSelectedEvent,
275
277
  PREVIEW_GEMINI_3_1_CUSTOM_TOOLS_MODEL,
@@ -281,16 +283,20 @@ import {
281
283
  ProjectIdRequiredError,
282
284
  READ_FILE_DISPLAY_NAME,
283
285
  READ_MANY_FILES_DISPLAY_NAME,
286
+ RECITATION_BLOCKED_MESSAGE,
284
287
  RELEASE_CHANNEL_STABILITY,
285
288
  ROOT_SCHEDULER_ID,
289
+ SAFETY_BLOCKED_MESSAGE,
286
290
  SHELL_TOOL_NAME,
287
291
  Scheduler,
288
292
  ShellExecutionService,
289
293
  SlashCommandStatus,
290
294
  Storage,
295
+ THINKING_ONLY_COMPRESS_SUGGESTION,
291
296
  TOPIC_PARAM_STRATEGIC_INTENT,
292
297
  TOPIC_PARAM_SUMMARY,
293
298
  TOPIC_PARAM_TITLE,
299
+ TRUE_EMPTY_RESPONSE_MESSAGE,
294
300
  TerminalQuotaError,
295
301
  TranscriptionFactory,
296
302
  UPDATE_TOPIC_DISPLAY_NAME,
@@ -412,7 +418,7 @@ import {
412
418
  validatePlanContent,
413
419
  validatePlanPath,
414
420
  writeToStdout
415
- } from "./chunk-YOK6TS2W.js";
421
+ } from "./chunk-HS7THREL.js";
416
422
  import "./chunk-664ZODQF.js";
417
423
  import "./chunk-IUUIT4SU.js";
418
424
  import "./chunk-TUDYL3X4.js";
@@ -8031,6 +8037,18 @@ function areModelMetricsEqual(a, b) {
8031
8037
  if (a.api.totalRequests !== b.api.totalRequests || a.api.totalErrors !== b.api.totalErrors || a.api.totalLatencyMs !== b.api.totalLatencyMs) {
8032
8038
  return false;
8033
8039
  }
8040
+ const errorsA = a.api.errorsByType || {};
8041
+ const errorsB = b.api.errorsByType || {};
8042
+ const keysA = Object.keys(errorsA);
8043
+ const keysB = Object.keys(errorsB);
8044
+ if (keysA.length !== keysB.length) {
8045
+ return false;
8046
+ }
8047
+ for (const key of keysA) {
8048
+ if (errorsA[key] !== errorsB[key]) {
8049
+ return false;
8050
+ }
8051
+ }
8034
8052
  if (a.tokens.input !== b.tokens.input || a.tokens.prompt !== b.tokens.prompt || a.tokens.candidates !== b.tokens.candidates || a.tokens.total !== b.tokens.total || a.tokens.cached !== b.tokens.cached || a.tokens.thoughts !== b.tokens.thoughts || a.tokens.tool !== b.tokens.tool) {
8035
8053
  return false;
8036
8054
  }
@@ -27746,6 +27764,52 @@ var useGeminiStream = (geminiClient, history, addItem, config, settings, onDebug
27746
27764
  maybeAddLowVerbosityFailureNote
27747
27765
  ]
27748
27766
  );
27767
+ const handleInvalidStreamEvent = (0, import_react99.useCallback)(
27768
+ (eventValue, userMessageTimestamp) => {
27769
+ if (pendingHistoryItemRef.current) {
27770
+ addItem(pendingHistoryItemRef.current, userMessageTimestamp);
27771
+ setPendingHistoryItem(null);
27772
+ }
27773
+ maybeAddSuppressedToolErrorNote(userMessageTimestamp);
27774
+ let text = eventValue?.message?.trim() || "Invalid stream received from model";
27775
+ if (eventValue?.type === "NO_RESPONSE_TEXT") {
27776
+ text = TRUE_EMPTY_RESPONSE_MESSAGE;
27777
+ } else if (eventValue?.type === "THINKING_ONLY_RESPONSE") {
27778
+ text = THINKING_ONLY_COMPRESS_SUGGESTION;
27779
+ } else if (eventValue?.type === "MAX_TOKENS_EXCEEDED") {
27780
+ text = MAX_TOKENS_EXCEEDED_SUGGESTION;
27781
+ } else if (eventValue?.type === "SAFETY_BLOCKED") {
27782
+ text = SAFETY_BLOCKED_MESSAGE;
27783
+ } else if (eventValue?.type === "RECITATION_BLOCKED") {
27784
+ text = RECITATION_BLOCKED_MESSAGE;
27785
+ } else if (eventValue?.type === "OTHER_BLOCKED") {
27786
+ text = OTHER_BLOCKED_MESSAGE;
27787
+ }
27788
+ uiTelemetryService.recordSemanticValidationError(
27789
+ geminiClient.getCurrentSequenceModel() ?? config.getModel(),
27790
+ eventValue?.type || "INVALID_STREAM"
27791
+ );
27792
+ addItem(
27793
+ {
27794
+ type: "error" /* ERROR */,
27795
+ text
27796
+ },
27797
+ userMessageTimestamp
27798
+ );
27799
+ maybeAddLowVerbosityFailureNote(userMessageTimestamp);
27800
+ setThought(null);
27801
+ },
27802
+ [
27803
+ addItem,
27804
+ pendingHistoryItemRef,
27805
+ setPendingHistoryItem,
27806
+ setThought,
27807
+ maybeAddSuppressedToolErrorNote,
27808
+ maybeAddLowVerbosityFailureNote,
27809
+ config,
27810
+ geminiClient
27811
+ ]
27812
+ );
27749
27813
  const handleCitationEvent = (0, import_react99.useCallback)(
27750
27814
  (text, userMessageTimestamp) => {
27751
27815
  if (!showCitations(settings)) {
@@ -28001,7 +28065,9 @@ var useGeminiStream = (geminiClient, history, addItem, config, settings, onDebug
28001
28065
  loopDetectedRef.current = true;
28002
28066
  break;
28003
28067
  case "retry" /* Retry */:
28068
+ break;
28004
28069
  case "invalid_stream" /* InvalidStream */:
28070
+ handleInvalidStreamEvent(event.value, userMessageTimestamp);
28005
28071
  break;
28006
28072
  default: {
28007
28073
  const unreachable = event;
@@ -28033,6 +28099,7 @@ var useGeminiStream = (geminiClient, history, addItem, config, settings, onDebug
28033
28099
  handleChatModelEvent,
28034
28100
  handleAgentExecutionStoppedEvent,
28035
28101
  handleAgentExecutionBlockedEvent,
28102
+ handleInvalidStreamEvent,
28036
28103
  addItem,
28037
28104
  pendingHistoryItemRef,
28038
28105
  setPendingHistoryItem,
@@ -28275,6 +28342,28 @@ var useGeminiStream = (geminiClient, history, addItem, config, settings, onDebug
28275
28342
  return false;
28276
28343
  }
28277
28344
  );
28345
+ if (turnCancelledRef.current) {
28346
+ setIsResponding(false);
28347
+ const geminiTools2 = completedAndReadyToSubmitTools.filter(
28348
+ (t) => !t.request.isClientInitiated
28349
+ );
28350
+ if (geminiClient && geminiTools2.length > 0) {
28351
+ const combinedParts = geminiTools2.flatMap(
28352
+ (toolCall) => toolCall.response.responseParts
28353
+ );
28354
+ if (combinedParts.length > 0) {
28355
+ geminiClient.addHistory({
28356
+ role: "user",
28357
+ parts: combinedParts
28358
+ });
28359
+ }
28360
+ }
28361
+ const callIdsToMarkAsSubmitted2 = toolCalls.map(
28362
+ (toolCall) => toolCall.request.callId
28363
+ );
28364
+ markToolsAsSubmitted(callIdsToMarkAsSubmitted2);
28365
+ return;
28366
+ }
28278
28367
  const clientTools = completedAndReadyToSubmitTools.filter(
28279
28368
  (t) => t.request.isClientInitiated
28280
28369
  );
@@ -28412,7 +28501,8 @@ var useGeminiStream = (geminiClient, history, addItem, config, settings, onDebug
28412
28501
  isLowErrorVerbosity,
28413
28502
  maybeAddSuppressedToolErrorNote,
28414
28503
  maybeAddLowVerbosityFailureNote,
28415
- setIsResponding
28504
+ setIsResponding,
28505
+ toolCalls
28416
28506
  ]
28417
28507
  );
28418
28508
  const pendingHistoryItems = (0, import_react99.useMemo)(
@@ -33778,7 +33868,7 @@ ${queuedText}` : queuedText;
33778
33868
  if (keyMatchers["app.showErrorDetails" /* SHOW_ERROR_DETAILS */](key)) {
33779
33869
  if (settings.merged.general.devtools) {
33780
33870
  void (async () => {
33781
- const { toggleDevToolsPanel } = await import("./devtoolsService-HT4GPBRA.js");
33871
+ const { toggleDevToolsPanel } = await import("./devtoolsService-FUTPYP6V.js");
33782
33872
  await toggleDevToolsPanel(
33783
33873
  config,
33784
33874
  showErrorDetails,
@@ -157,10 +157,10 @@ import {
157
157
  widestLineFromStyledChars,
158
158
  wordBreakStyledChars,
159
159
  wrapStyledChars
160
- } from "./chunk-I2F6JPKA.js";
160
+ } from "./chunk-LH73BY77.js";
161
161
  import {
162
162
  require_source
163
- } from "./chunk-K7T2IFNS.js";
163
+ } from "./chunk-MOGTJC2T.js";
164
164
  import {
165
165
  appEvents
166
166
  } from "./chunk-5PS3AYFU.js";
@@ -214,24 +214,24 @@ import {
214
214
  stripAnsi,
215
215
  stripUnsafeCharacters,
216
216
  toCodePoints
217
- } from "./chunk-JKXIXUUH.js";
217
+ } from "./chunk-JPCDQXHB.js";
218
218
  import {
219
219
  handleAutoUpdate,
220
220
  isDevelopment,
221
221
  relaunchApp,
222
222
  setUpdateHandler
223
- } from "./chunk-CPVZILP2.js";
223
+ } from "./chunk-NZ6P6XKP.js";
224
224
  import {
225
225
  isTodoList,
226
226
  mapCoreStatusToDisplayStatus,
227
227
  require_react
228
- } from "./chunk-5X6WKNCA.js";
228
+ } from "./chunk-TZAOURRV.js";
229
229
  import {
230
230
  registerCleanup,
231
231
  removeCleanup,
232
232
  runExitCleanup,
233
233
  setupTtyCheck
234
- } from "./chunk-GMYSSSFG.js";
234
+ } from "./chunk-SHZORH3T.js";
235
235
  import {
236
236
  ACTIVATE_SKILL_TOOL_NAME,
237
237
  AGENT_TOOL_NAME,
@@ -268,8 +268,10 @@ import {
268
268
  LegacyAgentProtocol,
269
269
  LlmRole,
270
270
  Logger,
271
+ MAX_TOKENS_EXCEEDED_SUGGESTION,
271
272
  ModelNotFoundError,
272
273
  ModelSlashCommandEvent,
274
+ OTHER_BLOCKED_MESSAGE,
273
275
  OverageMenuShownEvent,
274
276
  OverageOptionSelectedEvent,
275
277
  PREVIEW_GEMINI_3_1_CUSTOM_TOOLS_MODEL,
@@ -281,16 +283,20 @@ import {
281
283
  ProjectIdRequiredError,
282
284
  READ_FILE_DISPLAY_NAME,
283
285
  READ_MANY_FILES_DISPLAY_NAME,
286
+ RECITATION_BLOCKED_MESSAGE,
284
287
  RELEASE_CHANNEL_STABILITY,
285
288
  ROOT_SCHEDULER_ID,
289
+ SAFETY_BLOCKED_MESSAGE,
286
290
  SHELL_TOOL_NAME,
287
291
  Scheduler,
288
292
  ShellExecutionService,
289
293
  SlashCommandStatus,
290
294
  Storage,
295
+ THINKING_ONLY_COMPRESS_SUGGESTION,
291
296
  TOPIC_PARAM_STRATEGIC_INTENT,
292
297
  TOPIC_PARAM_SUMMARY,
293
298
  TOPIC_PARAM_TITLE,
299
+ TRUE_EMPTY_RESPONSE_MESSAGE,
294
300
  TerminalQuotaError,
295
301
  TranscriptionFactory,
296
302
  UPDATE_TOPIC_DISPLAY_NAME,
@@ -412,7 +418,7 @@ import {
412
418
  validatePlanContent,
413
419
  validatePlanPath,
414
420
  writeToStdout
415
- } from "./chunk-HM6J5QFA.js";
421
+ } from "./chunk-YYWWE5GW.js";
416
422
  import "./chunk-664ZODQF.js";
417
423
  import "./chunk-IUUIT4SU.js";
418
424
  import "./chunk-TUDYL3X4.js";
@@ -8031,6 +8037,18 @@ function areModelMetricsEqual(a, b) {
8031
8037
  if (a.api.totalRequests !== b.api.totalRequests || a.api.totalErrors !== b.api.totalErrors || a.api.totalLatencyMs !== b.api.totalLatencyMs) {
8032
8038
  return false;
8033
8039
  }
8040
+ const errorsA = a.api.errorsByType || {};
8041
+ const errorsB = b.api.errorsByType || {};
8042
+ const keysA = Object.keys(errorsA);
8043
+ const keysB = Object.keys(errorsB);
8044
+ if (keysA.length !== keysB.length) {
8045
+ return false;
8046
+ }
8047
+ for (const key of keysA) {
8048
+ if (errorsA[key] !== errorsB[key]) {
8049
+ return false;
8050
+ }
8051
+ }
8034
8052
  if (a.tokens.input !== b.tokens.input || a.tokens.prompt !== b.tokens.prompt || a.tokens.candidates !== b.tokens.candidates || a.tokens.total !== b.tokens.total || a.tokens.cached !== b.tokens.cached || a.tokens.thoughts !== b.tokens.thoughts || a.tokens.tool !== b.tokens.tool) {
8035
8053
  return false;
8036
8054
  }
@@ -27746,6 +27764,52 @@ var useGeminiStream = (geminiClient, history, addItem, config, settings, onDebug
27746
27764
  maybeAddLowVerbosityFailureNote
27747
27765
  ]
27748
27766
  );
27767
+ const handleInvalidStreamEvent = (0, import_react99.useCallback)(
27768
+ (eventValue, userMessageTimestamp) => {
27769
+ if (pendingHistoryItemRef.current) {
27770
+ addItem(pendingHistoryItemRef.current, userMessageTimestamp);
27771
+ setPendingHistoryItem(null);
27772
+ }
27773
+ maybeAddSuppressedToolErrorNote(userMessageTimestamp);
27774
+ let text = eventValue?.message?.trim() || "Invalid stream received from model";
27775
+ if (eventValue?.type === "NO_RESPONSE_TEXT") {
27776
+ text = TRUE_EMPTY_RESPONSE_MESSAGE;
27777
+ } else if (eventValue?.type === "THINKING_ONLY_RESPONSE") {
27778
+ text = THINKING_ONLY_COMPRESS_SUGGESTION;
27779
+ } else if (eventValue?.type === "MAX_TOKENS_EXCEEDED") {
27780
+ text = MAX_TOKENS_EXCEEDED_SUGGESTION;
27781
+ } else if (eventValue?.type === "SAFETY_BLOCKED") {
27782
+ text = SAFETY_BLOCKED_MESSAGE;
27783
+ } else if (eventValue?.type === "RECITATION_BLOCKED") {
27784
+ text = RECITATION_BLOCKED_MESSAGE;
27785
+ } else if (eventValue?.type === "OTHER_BLOCKED") {
27786
+ text = OTHER_BLOCKED_MESSAGE;
27787
+ }
27788
+ uiTelemetryService.recordSemanticValidationError(
27789
+ geminiClient.getCurrentSequenceModel() ?? config.getModel(),
27790
+ eventValue?.type || "INVALID_STREAM"
27791
+ );
27792
+ addItem(
27793
+ {
27794
+ type: "error" /* ERROR */,
27795
+ text
27796
+ },
27797
+ userMessageTimestamp
27798
+ );
27799
+ maybeAddLowVerbosityFailureNote(userMessageTimestamp);
27800
+ setThought(null);
27801
+ },
27802
+ [
27803
+ addItem,
27804
+ pendingHistoryItemRef,
27805
+ setPendingHistoryItem,
27806
+ setThought,
27807
+ maybeAddSuppressedToolErrorNote,
27808
+ maybeAddLowVerbosityFailureNote,
27809
+ config,
27810
+ geminiClient
27811
+ ]
27812
+ );
27749
27813
  const handleCitationEvent = (0, import_react99.useCallback)(
27750
27814
  (text, userMessageTimestamp) => {
27751
27815
  if (!showCitations(settings)) {
@@ -28001,7 +28065,9 @@ var useGeminiStream = (geminiClient, history, addItem, config, settings, onDebug
28001
28065
  loopDetectedRef.current = true;
28002
28066
  break;
28003
28067
  case "retry" /* Retry */:
28068
+ break;
28004
28069
  case "invalid_stream" /* InvalidStream */:
28070
+ handleInvalidStreamEvent(event.value, userMessageTimestamp);
28005
28071
  break;
28006
28072
  default: {
28007
28073
  const unreachable = event;
@@ -28033,6 +28099,7 @@ var useGeminiStream = (geminiClient, history, addItem, config, settings, onDebug
28033
28099
  handleChatModelEvent,
28034
28100
  handleAgentExecutionStoppedEvent,
28035
28101
  handleAgentExecutionBlockedEvent,
28102
+ handleInvalidStreamEvent,
28036
28103
  addItem,
28037
28104
  pendingHistoryItemRef,
28038
28105
  setPendingHistoryItem,
@@ -28275,6 +28342,28 @@ var useGeminiStream = (geminiClient, history, addItem, config, settings, onDebug
28275
28342
  return false;
28276
28343
  }
28277
28344
  );
28345
+ if (turnCancelledRef.current) {
28346
+ setIsResponding(false);
28347
+ const geminiTools2 = completedAndReadyToSubmitTools.filter(
28348
+ (t) => !t.request.isClientInitiated
28349
+ );
28350
+ if (geminiClient && geminiTools2.length > 0) {
28351
+ const combinedParts = geminiTools2.flatMap(
28352
+ (toolCall) => toolCall.response.responseParts
28353
+ );
28354
+ if (combinedParts.length > 0) {
28355
+ geminiClient.addHistory({
28356
+ role: "user",
28357
+ parts: combinedParts
28358
+ });
28359
+ }
28360
+ }
28361
+ const callIdsToMarkAsSubmitted2 = toolCalls.map(
28362
+ (toolCall) => toolCall.request.callId
28363
+ );
28364
+ markToolsAsSubmitted(callIdsToMarkAsSubmitted2);
28365
+ return;
28366
+ }
28278
28367
  const clientTools = completedAndReadyToSubmitTools.filter(
28279
28368
  (t) => t.request.isClientInitiated
28280
28369
  );
@@ -28412,7 +28501,8 @@ var useGeminiStream = (geminiClient, history, addItem, config, settings, onDebug
28412
28501
  isLowErrorVerbosity,
28413
28502
  maybeAddSuppressedToolErrorNote,
28414
28503
  maybeAddLowVerbosityFailureNote,
28415
- setIsResponding
28504
+ setIsResponding,
28505
+ toolCalls
28416
28506
  ]
28417
28507
  );
28418
28508
  const pendingHistoryItems = (0, import_react99.useMemo)(
@@ -33778,7 +33868,7 @@ ${queuedText}` : queuedText;
33778
33868
  if (keyMatchers["app.showErrorDetails" /* SHOW_ERROR_DETAILS */](key)) {
33779
33869
  if (settings.merged.general.devtools) {
33780
33870
  void (async () => {
33781
- const { toggleDevToolsPanel } = await import("./devtoolsService-YWDOWAQ7.js");
33871
+ const { toggleDevToolsPanel } = await import("./devtoolsService-NZQZUVCI.js");
33782
33872
  await toggleDevToolsPanel(
33783
33873
  config,
33784
33874
  showErrorDetails,
@@ -3,11 +3,11 @@ import {
3
3
  DEFAULT_PORT,
4
4
  getBinaryPath,
5
5
  isServerRunning
6
- } from "./chunk-QZ32DOIY.js";
7
- import "./chunk-ANCJ47GY.js";
6
+ } from "./chunk-VIQEWLM4.js";
7
+ import "./chunk-SQWRALPF.js";
8
8
  import {
9
9
  debugLogger
10
- } from "./chunk-YOK6TS2W.js";
10
+ } from "./chunk-HS7THREL.js";
11
11
  import "./chunk-664ZODQF.js";
12
12
  import "./chunk-IUUIT4SU.js";
13
13
  import "./chunk-TUDYL3X4.js";
@@ -41,7 +41,7 @@ var LiteRtServerManager = class {
41
41
  `[LiteRtServerManager] Auto-starting LiteRT server on port ${port}...`
42
42
  );
43
43
  try {
44
- const { startServer } = await import("./start-GSFOK3MC.js");
44
+ const { startServer } = await import("./start-YWT3TSZW.js");
45
45
  const started = await startServer(binaryPath, port);
46
46
  if (started) {
47
47
  debugLogger.log(`[LiteRtServerManager] Server started on port ${port}`);