@google/gemini-cli 0.69.0-preview.0 → 0.70.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.
Files changed (75) hide show
  1. package/bundle/{chunk-LYKP3S67.js → chunk-65MRMUKB.js} +625 -22
  2. package/bundle/{chunk-CGQSFR2I.js → chunk-6XLLXGZQ.js} +1 -1
  3. package/bundle/{chunk-U5FJ6OGB.js → chunk-AMGYQYS7.js} +35 -29
  4. package/bundle/{chunk-SYOIMUZI.js → chunk-BCL7DJOQ.js} +1165 -21669
  5. package/bundle/{chunk-6KCLIS6W.js → chunk-BOYVA4SV.js} +1 -1
  6. package/bundle/{chunk-YODS6HR2.js → chunk-CJ7YZ55P.js} +3 -3
  7. package/bundle/{chunk-BRHBBQC5.js → chunk-CMUPNBQQ.js} +35 -29
  8. package/bundle/{chunk-V7L3FMBE.js → chunk-ECLDXLDB.js} +3 -3
  9. package/bundle/{chunk-VQTELFV3.js → chunk-F6P6PQSG.js} +1 -1
  10. package/bundle/{chunk-CWHEOJXF.js → chunk-FDIF7V5C.js} +1 -1
  11. package/bundle/{chunk-UW3ZS3BH.js → chunk-FGTABIOQ.js} +1 -1
  12. package/bundle/{chunk-2ONJU4V7.js → chunk-HBTS2REO.js} +1 -1
  13. package/bundle/{chunk-DWMZSQYG.js → chunk-I5QSCSQU.js} +65559 -51236
  14. package/bundle/{chunk-4SOPZCNA.js → chunk-IS5SQ7HP.js} +625 -22
  15. package/bundle/{chunk-RBDD6IBU.js → chunk-L5UVIFFB.js} +1165 -21669
  16. package/bundle/{chunk-IUUIT4SU.js → chunk-N7J54YNL.js} +1 -0
  17. package/bundle/{chunk-PH5XENTH.js → chunk-NFAJ5FW5.js} +1 -1
  18. package/bundle/{chunk-GQ7FZNO2.js → chunk-NFBC76U4.js} +1 -1
  19. package/bundle/{chunk-KUXCUQKX.js → chunk-O2DXIYZO.js} +65411 -51125
  20. package/bundle/{chunk-C5BED6L6.js → chunk-O5EBPO5F.js} +35 -29
  21. package/bundle/{chunk-2KKDGWF2.js → chunk-RTIGPATB.js} +1 -1
  22. package/bundle/{chunk-JJWPYMIO.js → chunk-RVYQZ73V.js} +3 -3
  23. package/bundle/{chunk-MP4TVGOP.js → chunk-SA2VIQNQ.js} +65559 -51236
  24. package/bundle/{chunk-GDCMMKZ2.js → chunk-STY67ND2.js} +1 -1
  25. package/bundle/{chunk-3HEOCQDN.js → chunk-SXOGAWDG.js} +1 -1
  26. package/bundle/{chunk-UAHZWXSG.js → chunk-T7277DWX.js} +1 -1
  27. package/bundle/{chunk-U3FFDEKY.js → chunk-TX3SX2WI.js} +625 -22
  28. package/bundle/{chunk-664ZODQF.js → chunk-W2AJR23G.js} +137 -58
  29. package/bundle/{chunk-YP5TA33N.js → chunk-ZUQTNDGH.js} +1165 -21669
  30. package/bundle/{cleanup-3T2KXSP4.js → cleanup-44LV7E4R.js} +4 -4
  31. package/bundle/{cleanup-NNQCI4KC.js → cleanup-O4QBMRVU.js} +4 -4
  32. package/bundle/{cleanup-TA4VYDXQ.js → cleanup-WMYSWXJR.js} +4 -4
  33. package/bundle/{core-TUJHM7E7.js → core-DJ7VMWCC.js} +13 -3
  34. package/bundle/{core-6XF5EO7Z.js → core-LJXCBOFM.js} +13 -3
  35. package/bundle/{devtools-TYCPOPV3.js → devtools-WUGMIOCT.js} +1 -1
  36. package/bundle/devtoolsService-D4VCGQMJ.js +919 -0
  37. package/bundle/devtoolsService-EBOCEFTO.js +918 -0
  38. package/bundle/devtoolsService-G4CPAW3U.js +918 -0
  39. package/bundle/{dist-OSQFIX7F.js → dist-QSS2VWMY.js} +13 -3
  40. package/bundle/docs/changelogs/index.md +22 -0
  41. package/bundle/docs/changelogs/latest.md +100 -92
  42. package/bundle/docs/changelogs/preview.md +116 -104
  43. package/bundle/docs/cli/enterprise.md +23 -5
  44. package/bundle/docs/ide-integration/ide-companion-spec.md +10 -4
  45. package/bundle/docs/reference/policy-engine.md +45 -6
  46. package/bundle/docs/tools/shell.md +2 -1
  47. package/bundle/{formatError-LJFIC7G3.js → formatError-3QIVJAE5.js} +4 -4
  48. package/bundle/{formatError-MIUNQEYE.js → formatError-I5Q2HGMN.js} +4 -4
  49. package/bundle/{formatError-KEQ3HU3Y.js → formatError-NLKMYJNL.js} +4 -4
  50. package/bundle/{gemini-ZZZEFPSK.js → gemini-4325ARIU.js} +676 -288
  51. package/bundle/{gemini-22ON2CZG.js → gemini-J7ZRUAXR.js} +676 -288
  52. package/bundle/{gemini-HLS52ZNZ.js → gemini-LOYZXP6I.js} +676 -288
  53. package/bundle/gemini.js +35 -17
  54. package/bundle/{getMachineId-bsd-TXG52NKR.js → getMachineId-bsd-3TGNBDZQ.js} +1 -1
  55. package/bundle/{getMachineId-darwin-7OE4DDZ6.js → getMachineId-darwin-2CFT4JKO.js} +1 -1
  56. package/bundle/{getMachineId-linux-SHIFKOOX.js → getMachineId-linux-BXATTKN2.js} +1 -1
  57. package/bundle/{getMachineId-unsupported-5U5DOEYY.js → getMachineId-unsupported-VHPOSMKR.js} +1 -1
  58. package/bundle/{getMachineId-win-6KLLGOI4.js → getMachineId-win-IGXROMTR.js} +1 -1
  59. package/bundle/{interactiveCli-5HMWVTK2.js → interactiveCli-AQ67IY7V.js} +36 -18
  60. package/bundle/{interactiveCli-NKFQZXB5.js → interactiveCli-CEIWZCYF.js} +36 -18
  61. package/bundle/{interactiveCli-HQBE3C3C.js → interactiveCli-O2L63RLG.js} +36 -18
  62. package/bundle/{liteRtServerManager-AG4Y5JMZ.js → liteRtServerManager-EZFHT2B3.js} +6 -6
  63. package/bundle/{liteRtServerManager-OFNVXXQ4.js → liteRtServerManager-HMCB6A65.js} +6 -6
  64. package/bundle/{liteRtServerManager-2IOXWO76.js → liteRtServerManager-MH32CAZ5.js} +6 -6
  65. package/bundle/{oauth2-provider-2DHNJ2S3.js → oauth2-provider-3TFNA7VY.js} +3 -3
  66. package/bundle/{oauth2-provider-YDNSNN32.js → oauth2-provider-NPOZQDQO.js} +3 -3
  67. package/bundle/{oauth2-provider-OEGXLWIL.js → oauth2-provider-UXC7XFV6.js} +3 -3
  68. package/bundle/{src-XZYPU6PJ.js → src-MVBNXN6P.js} +3 -3504
  69. package/bundle/{start-JSVKPUTV.js → start-I2GOKFKQ.js} +8 -8
  70. package/bundle/{start-N33LF5WK.js → start-JIKLB3S3.js} +8 -8
  71. package/bundle/{start-7GJH3MKY.js → start-NSYEL7UE.js} +8 -8
  72. package/package.json +1 -1
  73. package/bundle/devtoolsService-7EMPANTX.js +0 -4421
  74. package/bundle/devtoolsService-I7WFRUEA.js +0 -4422
  75. package/bundle/devtoolsService-RCBUZGYD.js +0 -4421
package/bundle/gemini.js CHANGED
@@ -5,19 +5,22 @@ import {
5
5
  getScriptArgs,
6
6
  getSpawnConfig,
7
7
  handleChildProcessClose,
8
+ isSeaEnvironment,
8
9
  setupSignalForwarding
9
- } from "./chunk-C5BED6L6.js";
10
- import "./chunk-GQ7FZNO2.js";
11
- import "./chunk-CGQSFR2I.js";
12
- import "./chunk-KUXCUQKX.js";
13
- import "./chunk-664ZODQF.js";
14
- import "./chunk-IUUIT4SU.js";
10
+ } from "./chunk-O5EBPO5F.js";
11
+ import "./chunk-NFBC76U4.js";
12
+ import "./chunk-FDIF7V5C.js";
13
+ import "./chunk-O2DXIYZO.js";
14
+ import "./chunk-W2AJR23G.js";
15
+ import "./chunk-N7J54YNL.js";
15
16
  import "./chunk-L6PII3GR.js";
16
17
  import "./chunk-34MYV7JD.js";
17
18
 
18
19
  // packages/cli/index.ts
19
20
  import { spawn } from "node:child_process";
21
+ import { realpath } from "node:fs/promises";
20
22
  import os from "node:os";
23
+ import { isAbsolute, resolve } from "node:path";
21
24
  import v8 from "node:v8";
22
25
  async function getMemoryNodeArgs() {
23
26
  let autoConfigureMemory = true;
@@ -48,15 +51,20 @@ async function getMemoryNodeArgs() {
48
51
  }
49
52
  async function run() {
50
53
  if (!process.env["GEMINI_CLI_NO_RELAUNCH"] && !process.env["SANDBOX"]) {
54
+ if (!isSeaEnvironment() && process.argv[1] && !isAbsolute(process.argv[1])) {
55
+ process.argv[1] = resolve(process.argv[1]);
56
+ }
51
57
  const scriptArgs = getScriptArgs();
52
58
  const memoryArgs = await getMemoryNodeArgs();
53
59
  const { spawnArgs, env: newEnv } = getSpawnConfig(memoryArgs, scriptArgs);
54
60
  let latestAdminSettings = void 0;
61
+ let selectedWorktreePath = void 0;
55
62
  const runner = () => {
56
63
  process.stdin.pause();
57
64
  const child = spawn(process.execPath, spawnArgs, {
58
65
  stdio: ["inherit", "inherit", "inherit", "ipc"],
59
- env: newEnv
66
+ env: newEnv,
67
+ ...selectedWorktreePath ? { cwd: selectedWorktreePath } : {}
60
68
  });
61
69
  delete process.env["GEMINI_CLI_AUTH_OVERRIDE"];
62
70
  delete newEnv["GEMINI_CLI_AUTH_OVERRIDE"];
@@ -65,27 +73,37 @@ async function run() {
65
73
  }
66
74
  child.on(
67
75
  "message",
68
- (msg) => {
69
- if (msg.type === "admin-settings-update" && msg.settings) {
76
+ async (msg) => {
77
+ if (msg?.type === "admin-settings-update" && msg.settings) {
70
78
  latestAdminSettings = msg.settings;
71
79
  }
72
- if (msg.type === "auth-selected-type" && msg.authType) {
80
+ if (msg?.type === "auth-selected-type" && msg.authType) {
73
81
  process.env["GEMINI_CLI_AUTH_OVERRIDE"] = msg.authType;
74
82
  newEnv["GEMINI_CLI_AUTH_OVERRIDE"] = msg.authType;
75
83
  }
84
+ if (msg?.type === "worktree-selected" && typeof msg.path === "string" && msg.path.length > 0) {
85
+ try {
86
+ const resolvedWorktreePath = await realpath(resolve(msg.path));
87
+ process.chdir(resolvedWorktreePath);
88
+ selectedWorktreePath = resolvedWorktreePath;
89
+ process.env["GEMINI_CLI_WORKTREE_HANDLED"] = "1";
90
+ newEnv["GEMINI_CLI_WORKTREE_HANDLED"] = "1";
91
+ } catch {
92
+ }
93
+ }
76
94
  }
77
95
  );
78
96
  const removeForwarders = setupSignalForwarding(child);
79
- return new Promise((resolve) => {
97
+ return new Promise((resolve2) => {
80
98
  child.on("error", (err) => {
81
99
  removeForwarders();
82
100
  process.stderr.write(
83
101
  "Error: Failed to start child process: " + err.message + "\n"
84
102
  );
85
- resolve(1);
103
+ resolve2(1);
86
104
  });
87
105
  child.on("close", (code, signal) => {
88
- handleChildProcessClose(code, signal, removeForwarders, resolve);
106
+ handleChildProcessClose(code, signal, removeForwarders, resolve2);
89
107
  });
90
108
  });
91
109
  };
@@ -106,10 +124,10 @@ ${error instanceof Error ? error.stack ?? error.message : String(error)}
106
124
  }
107
125
  }
108
126
  } else {
109
- const { main } = await import("./gemini-ZZZEFPSK.js");
110
- const { FatalError, writeToStderr } = await import("./dist-OSQFIX7F.js");
111
- const { runExitCleanup } = await import("./cleanup-TA4VYDXQ.js");
112
- const { formatCliError, isCliDebugEnabled } = await import("./formatError-LJFIC7G3.js");
127
+ const { main } = await import("./gemini-4325ARIU.js");
128
+ const { FatalError, writeToStderr } = await import("./dist-QSS2VWMY.js");
129
+ const { runExitCleanup } = await import("./cleanup-O4QBMRVU.js");
130
+ const { formatCliError, isCliDebugEnabled } = await import("./formatError-3QIVJAE5.js");
113
131
  main().catch(async (error) => {
114
132
  const cleanupTimeout = setTimeout(() => {
115
133
  writeToStderr("Cleanup timed out, forcing exit...\n");
@@ -5,7 +5,7 @@ import {
5
5
  import {
6
6
  esm_exports,
7
7
  init_esm
8
- } from "./chunk-IUUIT4SU.js";
8
+ } from "./chunk-N7J54YNL.js";
9
9
  import {
10
10
  __commonJS,
11
11
  __require,
@@ -5,7 +5,7 @@ import {
5
5
  import {
6
6
  esm_exports,
7
7
  init_esm
8
- } from "./chunk-IUUIT4SU.js";
8
+ } from "./chunk-N7J54YNL.js";
9
9
  import {
10
10
  __commonJS,
11
11
  __toCommonJS
@@ -2,7 +2,7 @@ const require = (await import('node:module')).createRequire(import.meta.url); co
2
2
  import {
3
3
  esm_exports,
4
4
  init_esm
5
- } from "./chunk-IUUIT4SU.js";
5
+ } from "./chunk-N7J54YNL.js";
6
6
  import {
7
7
  __commonJS,
8
8
  __require,
@@ -2,7 +2,7 @@ const require = (await import('node:module')).createRequire(import.meta.url); co
2
2
  import {
3
3
  esm_exports,
4
4
  init_esm
5
- } from "./chunk-IUUIT4SU.js";
5
+ } from "./chunk-N7J54YNL.js";
6
6
  import {
7
7
  __commonJS,
8
8
  __toCommonJS
@@ -5,7 +5,7 @@ import {
5
5
  import {
6
6
  esm_exports,
7
7
  init_esm
8
- } from "./chunk-IUUIT4SU.js";
8
+ } from "./chunk-N7J54YNL.js";
9
9
  import {
10
10
  __commonJS,
11
11
  __require,
@@ -149,10 +149,10 @@ import {
149
149
  useUIState,
150
150
  useVimMode,
151
151
  validateAuthMethod
152
- } from "./chunk-YP5TA33N.js";
152
+ } from "./chunk-ZUQTNDGH.js";
153
153
  import {
154
154
  require_source
155
- } from "./chunk-2ONJU4V7.js";
155
+ } from "./chunk-HBTS2REO.js";
156
156
  import {
157
157
  appEvents
158
158
  } from "./chunk-5PS3AYFU.js";
@@ -226,25 +226,25 @@ import {
226
226
  widestLineFromStyledChars,
227
227
  wordBreakStyledChars,
228
228
  wrapStyledChars
229
- } from "./chunk-U3FFDEKY.js";
229
+ } from "./chunk-TX3SX2WI.js";
230
230
  import {
231
231
  handleAutoUpdate,
232
232
  isDevelopment,
233
233
  relaunchApp,
234
234
  require_semver,
235
235
  setUpdateHandler
236
- } from "./chunk-C5BED6L6.js";
236
+ } from "./chunk-O5EBPO5F.js";
237
237
  import {
238
238
  isTodoList,
239
239
  mapCoreStatusToDisplayStatus,
240
240
  require_react
241
- } from "./chunk-GQ7FZNO2.js";
241
+ } from "./chunk-NFBC76U4.js";
242
242
  import {
243
243
  registerCleanup,
244
244
  removeCleanup,
245
245
  runExitCleanup,
246
246
  setupTtyCheck
247
- } from "./chunk-CGQSFR2I.js";
247
+ } from "./chunk-FDIF7V5C.js";
248
248
  import {
249
249
  ACTIVATE_SKILL_TOOL_NAME,
250
250
  AGENT_TOOL_NAME,
@@ -460,9 +460,9 @@ import {
460
460
  validatePlanContent,
461
461
  validatePlanPath,
462
462
  writeToStdout
463
- } from "./chunk-KUXCUQKX.js";
464
- import "./chunk-664ZODQF.js";
465
- import "./chunk-IUUIT4SU.js";
463
+ } from "./chunk-O2DXIYZO.js";
464
+ import "./chunk-W2AJR23G.js";
465
+ import "./chunk-N7J54YNL.js";
466
466
  import "./chunk-L6PII3GR.js";
467
467
  import {
468
468
  __commonJS,
@@ -28451,6 +28451,8 @@ var useGeminiStream = (geminiClient, history, addItem, config, settings, onDebug
28451
28451
  );
28452
28452
  const cancelPromiseRef = (0, import_react102.useRef)(Promise.resolve());
28453
28453
  const activeQueryIdRef = (0, import_react102.useRef)(null);
28454
+ const lastQueryRef = (0, import_react102.useRef)(null);
28455
+ const lastPromptIdRef = (0, import_react102.useRef)(null);
28454
28456
  const previousApprovalModeRef = (0, import_react102.useRef)(
28455
28457
  config.getApprovalMode()
28456
28458
  );
@@ -28470,7 +28472,7 @@ var useGeminiStream = (geminiClient, history, addItem, config, settings, onDebug
28470
28472
  }, [config]);
28471
28473
  (0, import_react102.useEffect)(() => {
28472
28474
  const handleRetryAttempt = (payload) => {
28473
- if (turnCancelledRef.current || !isRespondingRef.current) {
28475
+ if (turnCancelledRef.current || !isRespondingRef.current || payload.role !== LlmRole.MAIN || !lastPromptIdRef.current || payload.promptId !== lastPromptIdRef.current) {
28474
28476
  return;
28475
28477
  }
28476
28478
  setRetryStatus(payload);
@@ -28768,8 +28770,6 @@ var useGeminiStream = (geminiClient, history, addItem, config, settings, onDebug
28768
28770
  backgroundTasks,
28769
28771
  settings.merged.ui?.compactToolOutput
28770
28772
  ]);
28771
- const lastQueryRef = (0, import_react102.useRef)(null);
28772
- const lastPromptIdRef = (0, import_react102.useRef)(null);
28773
28773
  const loopDetectedRef = (0, import_react102.useRef)(false);
28774
28774
  const autoNudgeAttemptCountRef = (0, import_react102.useRef)(0);
28775
28775
  const MAX_AUTO_NUDGE_ATTEMPTS = 2;
@@ -29196,6 +29196,7 @@ var useGeminiStream = (geminiClient, history, addItem, config, settings, onDebug
29196
29196
  );
29197
29197
  const handleThoughtEvent = (0, import_react102.useCallback)(
29198
29198
  (eventValue, _userMessageTimestamp) => {
29199
+ setRetryStatus(null);
29199
29200
  setThought(eventValue);
29200
29201
  if (getInlineThinkingMode(settings) === "full") {
29201
29202
  addItem({
@@ -29524,6 +29525,7 @@ var useGeminiStream = (geminiClient, history, addItem, config, settings, onDebug
29524
29525
  );
29525
29526
  break;
29526
29527
  case GeminiEventType.ToolCallRequest:
29528
+ setRetryStatus(null);
29527
29529
  toolCallRequests.push(event.value);
29528
29530
  pendingToolCallRequestsRef.current.push(event.value);
29529
29531
  break;
@@ -29711,10 +29713,11 @@ var useGeminiStream = (geminiClient, history, addItem, config, settings, onDebug
29711
29713
  startNewPrompt();
29712
29714
  setThought(null);
29713
29715
  }
29714
- setIsResponding(true);
29715
- setInitError(null);
29716
29716
  lastQueryRef.current = queryToSend;
29717
29717
  lastPromptIdRef.current = prompt_id;
29718
+ setRetryStatus(null);
29719
+ setIsResponding(true);
29720
+ setInitError(null);
29718
29721
  try {
29719
29722
  const stream = geminiClient.sendMessageStream(
29720
29723
  queryToSend,
@@ -31389,7 +31392,7 @@ var useLoadingIndicator = ({
31389
31392
  const prevStreamingStateRef = (0, import_react105.useRef)(null);
31390
31393
  const [prevRetryStatus, setPrevRetryStatus] = (0, import_react105.useState)(null);
31391
31394
  const [countdownSeconds, setCountdownSeconds] = (0, import_react105.useState)(null);
31392
- const isSameRetry = retryStatus === prevRetryStatus || retryStatus !== null && prevRetryStatus !== null && retryStatus.attempt === prevRetryStatus.attempt && retryStatus.delayMs === prevRetryStatus.delayMs && retryStatus.model === prevRetryStatus.model && retryStatus.status === prevRetryStatus.status && retryStatus.error === prevRetryStatus.error;
31395
+ const isSameRetry = retryStatus === prevRetryStatus || retryStatus !== null && prevRetryStatus !== null && retryStatus.attempt === prevRetryStatus.attempt && retryStatus.maxAttempts === prevRetryStatus.maxAttempts && retryStatus.delayMs === prevRetryStatus.delayMs && retryStatus.model === prevRetryStatus.model && retryStatus.status === prevRetryStatus.status && retryStatus.error === prevRetryStatus.error && retryStatus.role === prevRetryStatus.role && retryStatus.promptId === prevRetryStatus.promptId;
31393
31396
  if (!isSameRetry) {
31394
31397
  setPrevRetryStatus(retryStatus);
31395
31398
  setCountdownSeconds(
@@ -31401,6 +31404,8 @@ var useLoadingIndicator = ({
31401
31404
  const attempt = retryStatus?.attempt ?? 0;
31402
31405
  const delayMs = retryStatus?.delayMs ?? 0;
31403
31406
  const model = retryStatus?.model ?? "";
31407
+ const role = retryStatus?.role;
31408
+ const promptId = retryStatus?.promptId;
31404
31409
  (0, import_react105.useEffect)(() => {
31405
31410
  if (!isTimerActive || !isRateLimit || countdownSeconds === null || countdownSeconds <= 1) {
31406
31411
  return;
@@ -31416,7 +31421,16 @@ var useLoadingIndicator = ({
31416
31421
  return () => {
31417
31422
  clearInterval(intervalId);
31418
31423
  };
31419
- }, [attempt, delayMs, model, isTimerActive, isRateLimit, countdownSeconds]);
31424
+ }, [
31425
+ attempt,
31426
+ delayMs,
31427
+ model,
31428
+ role,
31429
+ promptId,
31430
+ isTimerActive,
31431
+ isRateLimit,
31432
+ countdownSeconds
31433
+ ]);
31420
31434
  (0, import_react105.useEffect)(() => {
31421
31435
  if (prevStreamingStateRef.current === "waiting_for_confirmation" /* WaitingForConfirmation */ && streamingState === "responding" /* Responding */) {
31422
31436
  setTimerResetKey((prevKey) => prevKey + 1);
@@ -32783,6 +32797,11 @@ function useSessionResume({
32783
32797
  }
32784
32798
  setIsResuming(true);
32785
32799
  try {
32800
+ const client = config.getGeminiClient();
32801
+ if (!client) {
32802
+ throw new Error("Gemini client is not initialized");
32803
+ }
32804
+ await client.resumeChat(clientHistory, resumedData);
32786
32805
  setQuittingMessages(null);
32787
32806
  historyManagerRef.current.clearItems();
32788
32807
  uiHistory.forEach((item, index) => {
@@ -32793,7 +32812,6 @@ function useSessionResume({
32793
32812
  const workspaceContext = config.getWorkspaceContext();
32794
32813
  workspaceContext.addDirectories(resumedData.conversation.directories);
32795
32814
  }
32796
- await config.getGeminiClient()?.resumeChat(clientHistory, resumedData);
32797
32815
  } catch (error) {
32798
32816
  coreEvents.emitFeedback(
32799
32817
  "error",
@@ -35267,7 +35285,7 @@ ${queuedText}` : queuedText;
35267
35285
  if (keyMatchers["app.showErrorDetails" /* SHOW_ERROR_DETAILS */](key)) {
35268
35286
  if (settings.merged.general.devtools) {
35269
35287
  void (async () => {
35270
- const { toggleDevToolsPanel } = await import("./devtoolsService-I7WFRUEA.js");
35288
+ const { toggleDevToolsPanel } = await import("./devtoolsService-D4VCGQMJ.js");
35271
35289
  await toggleDevToolsPanel(
35272
35290
  config,
35273
35291
  showErrorDetails,
@@ -149,10 +149,10 @@ import {
149
149
  useUIState,
150
150
  useVimMode,
151
151
  validateAuthMethod
152
- } from "./chunk-SYOIMUZI.js";
152
+ } from "./chunk-BCL7DJOQ.js";
153
153
  import {
154
154
  require_source
155
- } from "./chunk-PH5XENTH.js";
155
+ } from "./chunk-NFAJ5FW5.js";
156
156
  import {
157
157
  appEvents
158
158
  } from "./chunk-5PS3AYFU.js";
@@ -226,25 +226,25 @@ import {
226
226
  widestLineFromStyledChars,
227
227
  wordBreakStyledChars,
228
228
  wrapStyledChars
229
- } from "./chunk-4SOPZCNA.js";
229
+ } from "./chunk-65MRMUKB.js";
230
230
  import {
231
231
  handleAutoUpdate,
232
232
  isDevelopment,
233
233
  relaunchApp,
234
234
  require_semver,
235
235
  setUpdateHandler
236
- } from "./chunk-BRHBBQC5.js";
236
+ } from "./chunk-AMGYQYS7.js";
237
237
  import {
238
238
  isTodoList,
239
239
  mapCoreStatusToDisplayStatus,
240
240
  require_react
241
- } from "./chunk-2KKDGWF2.js";
241
+ } from "./chunk-RTIGPATB.js";
242
242
  import {
243
243
  registerCleanup,
244
244
  removeCleanup,
245
245
  runExitCleanup,
246
246
  setupTtyCheck
247
- } from "./chunk-UAHZWXSG.js";
247
+ } from "./chunk-T7277DWX.js";
248
248
  import {
249
249
  ACTIVATE_SKILL_TOOL_NAME,
250
250
  AGENT_TOOL_NAME,
@@ -441,9 +441,9 @@ import {
441
441
  validatePlanContent,
442
442
  validatePlanPath,
443
443
  writeToStdout
444
- } from "./chunk-MP4TVGOP.js";
445
- import "./chunk-664ZODQF.js";
446
- import "./chunk-IUUIT4SU.js";
444
+ } from "./chunk-SA2VIQNQ.js";
445
+ import "./chunk-W2AJR23G.js";
446
+ import "./chunk-N7J54YNL.js";
447
447
  import "./chunk-L6PII3GR.js";
448
448
  import {
449
449
  __commonJS,
@@ -28432,6 +28432,8 @@ var useGeminiStream = (geminiClient, history, addItem, config, settings, onDebug
28432
28432
  );
28433
28433
  const cancelPromiseRef = (0, import_react102.useRef)(Promise.resolve());
28434
28434
  const activeQueryIdRef = (0, import_react102.useRef)(null);
28435
+ const lastQueryRef = (0, import_react102.useRef)(null);
28436
+ const lastPromptIdRef = (0, import_react102.useRef)(null);
28435
28437
  const previousApprovalModeRef = (0, import_react102.useRef)(
28436
28438
  config.getApprovalMode()
28437
28439
  );
@@ -28451,7 +28453,7 @@ var useGeminiStream = (geminiClient, history, addItem, config, settings, onDebug
28451
28453
  }, [config]);
28452
28454
  (0, import_react102.useEffect)(() => {
28453
28455
  const handleRetryAttempt = (payload) => {
28454
- if (turnCancelledRef.current || !isRespondingRef.current) {
28456
+ if (turnCancelledRef.current || !isRespondingRef.current || payload.role !== "main" /* MAIN */ || !lastPromptIdRef.current || payload.promptId !== lastPromptIdRef.current) {
28455
28457
  return;
28456
28458
  }
28457
28459
  setRetryStatus(payload);
@@ -28749,8 +28751,6 @@ var useGeminiStream = (geminiClient, history, addItem, config, settings, onDebug
28749
28751
  backgroundTasks,
28750
28752
  settings.merged.ui?.compactToolOutput
28751
28753
  ]);
28752
- const lastQueryRef = (0, import_react102.useRef)(null);
28753
- const lastPromptIdRef = (0, import_react102.useRef)(null);
28754
28754
  const loopDetectedRef = (0, import_react102.useRef)(false);
28755
28755
  const autoNudgeAttemptCountRef = (0, import_react102.useRef)(0);
28756
28756
  const MAX_AUTO_NUDGE_ATTEMPTS = 2;
@@ -29177,6 +29177,7 @@ var useGeminiStream = (geminiClient, history, addItem, config, settings, onDebug
29177
29177
  );
29178
29178
  const handleThoughtEvent = (0, import_react102.useCallback)(
29179
29179
  (eventValue, _userMessageTimestamp) => {
29180
+ setRetryStatus(null);
29180
29181
  setThought(eventValue);
29181
29182
  if (getInlineThinkingMode(settings) === "full") {
29182
29183
  addItem({
@@ -29505,6 +29506,7 @@ var useGeminiStream = (geminiClient, history, addItem, config, settings, onDebug
29505
29506
  );
29506
29507
  break;
29507
29508
  case "tool_call_request" /* ToolCallRequest */:
29509
+ setRetryStatus(null);
29508
29510
  toolCallRequests.push(event.value);
29509
29511
  pendingToolCallRequestsRef.current.push(event.value);
29510
29512
  break;
@@ -29692,10 +29694,11 @@ var useGeminiStream = (geminiClient, history, addItem, config, settings, onDebug
29692
29694
  startNewPrompt();
29693
29695
  setThought(null);
29694
29696
  }
29695
- setIsResponding(true);
29696
- setInitError(null);
29697
29697
  lastQueryRef.current = queryToSend;
29698
29698
  lastPromptIdRef.current = prompt_id;
29699
+ setRetryStatus(null);
29700
+ setIsResponding(true);
29701
+ setInitError(null);
29699
29702
  try {
29700
29703
  const stream = geminiClient.sendMessageStream(
29701
29704
  queryToSend,
@@ -31370,7 +31373,7 @@ var useLoadingIndicator = ({
31370
31373
  const prevStreamingStateRef = (0, import_react105.useRef)(null);
31371
31374
  const [prevRetryStatus, setPrevRetryStatus] = (0, import_react105.useState)(null);
31372
31375
  const [countdownSeconds, setCountdownSeconds] = (0, import_react105.useState)(null);
31373
- const isSameRetry = retryStatus === prevRetryStatus || retryStatus !== null && prevRetryStatus !== null && retryStatus.attempt === prevRetryStatus.attempt && retryStatus.delayMs === prevRetryStatus.delayMs && retryStatus.model === prevRetryStatus.model && retryStatus.status === prevRetryStatus.status && retryStatus.error === prevRetryStatus.error;
31376
+ const isSameRetry = retryStatus === prevRetryStatus || retryStatus !== null && prevRetryStatus !== null && retryStatus.attempt === prevRetryStatus.attempt && retryStatus.maxAttempts === prevRetryStatus.maxAttempts && retryStatus.delayMs === prevRetryStatus.delayMs && retryStatus.model === prevRetryStatus.model && retryStatus.status === prevRetryStatus.status && retryStatus.error === prevRetryStatus.error && retryStatus.role === prevRetryStatus.role && retryStatus.promptId === prevRetryStatus.promptId;
31374
31377
  if (!isSameRetry) {
31375
31378
  setPrevRetryStatus(retryStatus);
31376
31379
  setCountdownSeconds(
@@ -31382,6 +31385,8 @@ var useLoadingIndicator = ({
31382
31385
  const attempt = retryStatus?.attempt ?? 0;
31383
31386
  const delayMs = retryStatus?.delayMs ?? 0;
31384
31387
  const model = retryStatus?.model ?? "";
31388
+ const role = retryStatus?.role;
31389
+ const promptId = retryStatus?.promptId;
31385
31390
  (0, import_react105.useEffect)(() => {
31386
31391
  if (!isTimerActive || !isRateLimit || countdownSeconds === null || countdownSeconds <= 1) {
31387
31392
  return;
@@ -31397,7 +31402,16 @@ var useLoadingIndicator = ({
31397
31402
  return () => {
31398
31403
  clearInterval(intervalId);
31399
31404
  };
31400
- }, [attempt, delayMs, model, isTimerActive, isRateLimit, countdownSeconds]);
31405
+ }, [
31406
+ attempt,
31407
+ delayMs,
31408
+ model,
31409
+ role,
31410
+ promptId,
31411
+ isTimerActive,
31412
+ isRateLimit,
31413
+ countdownSeconds
31414
+ ]);
31401
31415
  (0, import_react105.useEffect)(() => {
31402
31416
  if (prevStreamingStateRef.current === "waiting_for_confirmation" /* WaitingForConfirmation */ && streamingState === "responding" /* Responding */) {
31403
31417
  setTimerResetKey((prevKey) => prevKey + 1);
@@ -32764,6 +32778,11 @@ function useSessionResume({
32764
32778
  }
32765
32779
  setIsResuming(true);
32766
32780
  try {
32781
+ const client = config.getGeminiClient();
32782
+ if (!client) {
32783
+ throw new Error("Gemini client is not initialized");
32784
+ }
32785
+ await client.resumeChat(clientHistory, resumedData);
32767
32786
  setQuittingMessages(null);
32768
32787
  historyManagerRef.current.clearItems();
32769
32788
  uiHistory.forEach((item, index) => {
@@ -32774,7 +32793,6 @@ function useSessionResume({
32774
32793
  const workspaceContext = config.getWorkspaceContext();
32775
32794
  workspaceContext.addDirectories(resumedData.conversation.directories);
32776
32795
  }
32777
- await config.getGeminiClient()?.resumeChat(clientHistory, resumedData);
32778
32796
  } catch (error) {
32779
32797
  coreEvents.emitFeedback(
32780
32798
  "error",
@@ -35248,7 +35266,7 @@ ${queuedText}` : queuedText;
35248
35266
  if (keyMatchers["app.showErrorDetails" /* SHOW_ERROR_DETAILS */](key)) {
35249
35267
  if (settings.merged.general.devtools) {
35250
35268
  void (async () => {
35251
- const { toggleDevToolsPanel } = await import("./devtoolsService-RCBUZGYD.js");
35269
+ const { toggleDevToolsPanel } = await import("./devtoolsService-G4CPAW3U.js");
35252
35270
  await toggleDevToolsPanel(
35253
35271
  config,
35254
35272
  showErrorDetails,