@google/gemini-cli 0.57.0-preview.0 → 0.57.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-XDJMDRLM.js → chunk-4H4K2RBL.js} +3 -3
  2. package/bundle/{chunk-2UICYJMD.js → chunk-7HKQGPWB.js} +108 -22
  3. package/bundle/{chunk-2UGGPOEV.js → chunk-7IKUWYZO.js} +1 -1
  4. package/bundle/{chunk-IKGOC5B6.js → chunk-7ZGWPQVZ.js} +1 -1
  5. package/bundle/{chunk-NXS624CI.js → chunk-AOE6E7MU.js} +2 -2
  6. package/bundle/{chunk-73OHVDUZ.js → chunk-ASZFEU6C.js} +7 -7
  7. package/bundle/{chunk-FWGOOSQK.js → chunk-DFPYJMVX.js} +114 -22
  8. package/bundle/{chunk-ZY7Z5W6K.js → chunk-FVC4WCSP.js} +1 -1
  9. package/bundle/{chunk-ACDZS2RE.js → chunk-FYAMITQ2.js} +1 -1
  10. package/bundle/{chunk-QVDXZMEX.js → chunk-GAROUUGQ.js} +1 -1
  11. package/bundle/{chunk-OFFEM74O.js → chunk-GAS2GAYB.js} +1 -1
  12. package/bundle/{chunk-WH63Z45A.js → chunk-GPOBVDAD.js} +1 -1
  13. package/bundle/{chunk-EBKNEOAO.js → chunk-HY6GN2F7.js} +1 -1
  14. package/bundle/{chunk-HKTHSWSS.js → chunk-IKHAM2LG.js} +7 -7
  15. package/bundle/{chunk-O3QB4SVS.js → chunk-ISXOUBN5.js} +2 -2
  16. package/bundle/{chunk-W4CY7TCG.js → chunk-LQJHQ4BU.js} +2 -2
  17. package/bundle/{chunk-H2URGA7U.js → chunk-MNBBUQQS.js} +3 -3
  18. package/bundle/{chunk-6S4UF4JM.js → chunk-O7TOZUUB.js} +3 -3
  19. package/bundle/{chunk-3C6JYNPC.js → chunk-QJ33O2NH.js} +7 -7
  20. package/bundle/{chunk-M6E5CLIH.js → chunk-RLDNVR77.js} +1 -1
  21. package/bundle/{chunk-R3JDAZVL.js → chunk-S3MXVTTY.js} +114 -22
  22. package/bundle/{chunk-QB46S6FV.js → chunk-TAWZWX2B.js} +1 -1
  23. package/bundle/{chunk-SHIJDXMN.js → chunk-XG56CL6B.js} +1 -1
  24. package/bundle/{chunk-XZF4EZOQ.js → chunk-YW7SDLZQ.js} +1 -1
  25. package/bundle/{cleanup-JP2FD3CQ.js → cleanup-2HUWGXK6.js} +2 -2
  26. package/bundle/{cleanup-YFIFTNZ6.js → cleanup-7N2HFE2E.js} +2 -2
  27. package/bundle/{cleanup-Z65H2CUW.js → cleanup-DA7OSZS5.js} +2 -2
  28. package/bundle/{core-UBOS4Q6R.js → core-2NMRPWUN.js} +7 -1
  29. package/bundle/{dist-B7OLK6PK.js → core-CFPIDJ4Z.js} +7 -1
  30. package/bundle/{devtoolsService-A34WT2MQ.js → devtoolsService-7YYOUGVF.js} +2 -2
  31. package/bundle/{devtoolsService-BHG3WQEY.js → devtoolsService-VQSLUOYF.js} +2 -2
  32. package/bundle/{devtoolsService-ACKZ7HRR.js → devtoolsService-WMEEEXY6.js} +2 -2
  33. package/bundle/{core-EKXLT2AG.js → dist-AMP5W5P2.js} +7 -1
  34. package/bundle/{gemini-NJXFBFVJ.js → gemini-5LF4JAP7.js} +14 -14
  35. package/bundle/{gemini-7Z3ODIIX.js → gemini-OYYGXMHL.js} +14 -14
  36. package/bundle/{gemini-3U3DNSSI.js → gemini-PSRJNVY5.js} +14 -14
  37. package/bundle/gemini.js +7 -7
  38. package/bundle/{interactiveCli-LMXAWUCU.js → interactiveCli-5E2C3XOC.js} +40 -18
  39. package/bundle/{interactiveCli-FIWFPOOG.js → interactiveCli-5O6FZS57.js} +40 -18
  40. package/bundle/{interactiveCli-DNV4GCM5.js → interactiveCli-PP7WTUZL.js} +40 -18
  41. package/bundle/{liteRtServerManager-P62A6ZVG.js → liteRtServerManager-5QBFCLBK.js} +4 -4
  42. package/bundle/{liteRtServerManager-VBKDVKLU.js → liteRtServerManager-LK6HOSMO.js} +4 -4
  43. package/bundle/{liteRtServerManager-LQMOE7JK.js → liteRtServerManager-ZPDALIDY.js} +4 -4
  44. package/bundle/{oauth2-provider-FWKP5A4D.js → oauth2-provider-BGMEA7RS.js} +1 -1
  45. package/bundle/{oauth2-provider-BKNKX6FS.js → oauth2-provider-BYKBBEKI.js} +1 -1
  46. package/bundle/{oauth2-provider-UPRM4Y2J.js → oauth2-provider-CO22I6UM.js} +1 -1
  47. package/bundle/{start-DG3DHS3K.js → start-JRTTCV3K.js} +6 -6
  48. package/bundle/{start-Y2JKSYXK.js → start-KH6WSP5C.js} +6 -6
  49. package/bundle/{start-BMBCT2CF.js → start-O6LWZY6K.js} +6 -6
  50. package/package.json +1 -1
@@ -5,7 +5,7 @@ import {
5
5
  isTelemetrySdkInitialized,
6
6
  resetBrowserSession,
7
7
  shutdownTelemetry
8
- } from "./chunk-FWGOOSQK.js";
8
+ } from "./chunk-7HKQGPWB.js";
9
9
 
10
10
  // packages/cli/src/utils/cleanup.ts
11
11
  import { promises as fs } from "node:fs";
@@ -28,7 +28,7 @@ import {
28
28
  partListUnionToString,
29
29
  require_strip_json_comments,
30
30
  sanitizeFilenamePart
31
- } from "./chunk-R3JDAZVL.js";
31
+ } from "./chunk-DFPYJMVX.js";
32
32
  import {
33
33
  __commonJS,
34
34
  __require,
@@ -1,7 +1,7 @@
1
1
  const require = (await import('node:module')).createRequire(import.meta.url); const __chunk_filename = (await import('node:url')).fileURLToPath(import.meta.url); const __chunk_dirname = (await import('node:path')).dirname(__chunk_filename);
2
2
  import {
3
3
  runExitCleanup
4
- } from "./chunk-OFFEM74O.js";
4
+ } from "./chunk-RLDNVR77.js";
5
5
  import {
6
6
  __commonJS,
7
7
  __require
@@ -2,7 +2,7 @@ const require = (await import('node:module')).createRequire(import.meta.url); co
2
2
  import {
3
3
  exitCli,
4
4
  require_source
5
- } from "./chunk-ACDZS2RE.js";
5
+ } from "./chunk-HY6GN2F7.js";
6
6
  import {
7
7
  AppEvent,
8
8
  appEvents
@@ -59,14 +59,14 @@ import {
59
59
  stripUnsafeCharacters,
60
60
  toCodePoints,
61
61
  validateCustomTheme
62
- } from "./chunk-WH63Z45A.js";
62
+ } from "./chunk-GPOBVDAD.js";
63
63
  import {
64
64
  isDevelopment
65
- } from "./chunk-W4CY7TCG.js";
65
+ } from "./chunk-ISXOUBN5.js";
66
66
  import {
67
67
  emptyIcon,
68
68
  require_react
69
- } from "./chunk-QB46S6FV.js";
69
+ } from "./chunk-FVC4WCSP.js";
70
70
  import {
71
71
  ALL_EDITORS,
72
72
  ApprovalMode,
@@ -231,7 +231,7 @@ import {
231
231
  tokenLimit,
232
232
  uiTelemetryService,
233
233
  unescapePath
234
- } from "./chunk-R3JDAZVL.js";
234
+ } from "./chunk-DFPYJMVX.js";
235
235
  import {
236
236
  require_src
237
237
  } from "./chunk-TUDYL3X4.js";
@@ -77164,7 +77164,7 @@ var authCommand = {
77164
77164
  import process29 from "node:process";
77165
77165
 
77166
77166
  // packages/cli/src/generated/git-commit.ts
77167
- var GIT_COMMIT_INFO = "eaa30429a";
77167
+ var GIT_COMMIT_INFO = "1110ce8bc";
77168
77168
 
77169
77169
  // packages/cli/src/ui/utils/historyExportUtils.ts
77170
77170
  import * as fsPromises from "node:fs/promises";
@@ -82945,7 +82945,7 @@ Use /mcp auth <server-name> to authenticate.`
82945
82945
  type: "info",
82946
82946
  text: `Starting OAuth authentication for MCP server '${serverName}'...`
82947
82947
  });
82948
- const { MCPOAuthProvider } = await import("./core-EKXLT2AG.js");
82948
+ const { MCPOAuthProvider } = await import("./core-2NMRPWUN.js");
82949
82949
  let oauthConfig = server.oauth;
82950
82950
  if (!oauthConfig) {
82951
82951
  oauthConfig = { enabled: false };
@@ -1,13 +1,13 @@
1
1
  const require = (await import('node:module')).createRequire(import.meta.url); const __chunk_filename = (await import('node:url')).fileURLToPath(import.meta.url); const __chunk_dirname = (await import('node:path')).dirname(__chunk_filename);
2
2
  import {
3
3
  runExitCleanup
4
- } from "./chunk-M6E5CLIH.js";
4
+ } from "./chunk-RLDNVR77.js";
5
5
  import {
6
6
  RELEASE_CHANNEL_STABILITY,
7
7
  debugLogger,
8
8
  getChannelFromVersion,
9
9
  isGitRepository
10
- } from "./chunk-2UICYJMD.js";
10
+ } from "./chunk-DFPYJMVX.js";
11
11
 
12
12
  // packages/cli/src/utils/installationInfo.ts
13
13
  import * as fs from "node:fs";
@@ -1,13 +1,13 @@
1
1
  const require = (await import('node:module')).createRequire(import.meta.url); const __chunk_filename = (await import('node:url')).fileURLToPath(import.meta.url); const __chunk_dirname = (await import('node:path')).dirname(__chunk_filename);
2
2
  import {
3
3
  runExitCleanup
4
- } from "./chunk-2UGGPOEV.js";
4
+ } from "./chunk-GAS2GAYB.js";
5
5
  import {
6
6
  RELEASE_CHANNEL_STABILITY,
7
7
  debugLogger,
8
8
  getChannelFromVersion,
9
9
  isGitRepository
10
- } from "./chunk-R3JDAZVL.js";
10
+ } from "./chunk-7HKQGPWB.js";
11
11
 
12
12
  // packages/cli/src/utils/installationInfo.ts
13
13
  import * as fs from "node:fs";
@@ -2,7 +2,7 @@ const require = (await import('node:module')).createRequire(import.meta.url); co
2
2
  import {
3
3
  exitCli,
4
4
  require_source
5
- } from "./chunk-ACDZS2RE.js";
5
+ } from "./chunk-HY6GN2F7.js";
6
6
  import {
7
7
  DEFAULT_PORT,
8
8
  SERVER_START_WAIT_MS,
@@ -14,10 +14,10 @@ import {
14
14
  isServerRunning,
15
15
  resolveGemmaConfig,
16
16
  writeServerProcessInfo
17
- } from "./chunk-WH63Z45A.js";
17
+ } from "./chunk-GPOBVDAD.js";
18
18
  import {
19
19
  debugLogger
20
- } from "./chunk-R3JDAZVL.js";
20
+ } from "./chunk-DFPYJMVX.js";
21
21
  import {
22
22
  __toESM
23
23
  } from "./chunk-34MYV7JD.js";
@@ -2,7 +2,7 @@ const require = (await import('node:module')).createRequire(import.meta.url); co
2
2
  import {
3
3
  exitCli,
4
4
  require_source
5
- } from "./chunk-EBKNEOAO.js";
5
+ } from "./chunk-YW7SDLZQ.js";
6
6
  import {
7
7
  DEFAULT_PORT,
8
8
  SERVER_START_WAIT_MS,
@@ -14,10 +14,10 @@ import {
14
14
  isServerRunning,
15
15
  resolveGemmaConfig,
16
16
  writeServerProcessInfo
17
- } from "./chunk-IKGOC5B6.js";
17
+ } from "./chunk-7ZGWPQVZ.js";
18
18
  import {
19
19
  debugLogger
20
- } from "./chunk-FWGOOSQK.js";
20
+ } from "./chunk-S3MXVTTY.js";
21
21
  import {
22
22
  __toESM
23
23
  } from "./chunk-34MYV7JD.js";
@@ -2,7 +2,7 @@ const require = (await import('node:module')).createRequire(import.meta.url); co
2
2
  import {
3
3
  exitCli,
4
4
  require_source
5
- } from "./chunk-EBKNEOAO.js";
5
+ } from "./chunk-YW7SDLZQ.js";
6
6
  import {
7
7
  AppEvent,
8
8
  appEvents
@@ -59,14 +59,14 @@ import {
59
59
  stripUnsafeCharacters,
60
60
  toCodePoints,
61
61
  validateCustomTheme
62
- } from "./chunk-IKGOC5B6.js";
62
+ } from "./chunk-7ZGWPQVZ.js";
63
63
  import {
64
64
  isDevelopment
65
- } from "./chunk-NXS624CI.js";
65
+ } from "./chunk-AOE6E7MU.js";
66
66
  import {
67
67
  emptyIcon,
68
68
  require_react
69
- } from "./chunk-ZY7Z5W6K.js";
69
+ } from "./chunk-TAWZWX2B.js";
70
70
  import {
71
71
  ALL_EDITORS,
72
72
  ApprovalMode,
@@ -231,7 +231,7 @@ import {
231
231
  tokenLimit,
232
232
  uiTelemetryService,
233
233
  unescapePath
234
- } from "./chunk-FWGOOSQK.js";
234
+ } from "./chunk-S3MXVTTY.js";
235
235
  import {
236
236
  require_src
237
237
  } from "./chunk-TUDYL3X4.js";
@@ -77164,7 +77164,7 @@ var authCommand = {
77164
77164
  import process29 from "node:process";
77165
77165
 
77166
77166
  // packages/cli/src/generated/git-commit.ts
77167
- var GIT_COMMIT_INFO = "eaa30429a";
77167
+ var GIT_COMMIT_INFO = "1110ce8bc";
77168
77168
 
77169
77169
  // packages/cli/src/ui/utils/historyExportUtils.ts
77170
77170
  import * as fsPromises from "node:fs/promises";
@@ -82945,7 +82945,7 @@ Use /mcp auth <server-name> to authenticate.`
82945
82945
  type: "info",
82946
82946
  text: `Starting OAuth authentication for MCP server '${serverName}'...`
82947
82947
  });
82948
- const { MCPOAuthProvider } = await import("./core-UBOS4Q6R.js");
82948
+ const { MCPOAuthProvider } = await import("./core-CFPIDJ4Z.js");
82949
82949
  let oauthConfig = server.oauth;
82950
82950
  if (!oauthConfig) {
82951
82951
  oauthConfig = { enabled: false };
@@ -5,7 +5,7 @@ import {
5
5
  isTelemetrySdkInitialized,
6
6
  resetBrowserSession,
7
7
  shutdownTelemetry
8
- } from "./chunk-2UICYJMD.js";
8
+ } from "./chunk-DFPYJMVX.js";
9
9
 
10
10
  // packages/cli/src/utils/cleanup.ts
11
11
  import { promises as fs } from "node:fs";
@@ -282830,8 +282830,8 @@ function isValidToolName(name3, options = {}) {
282830
282830
  }
282831
282831
 
282832
282832
  // packages/core/src/generated/git-commit.ts
282833
- var GIT_COMMIT_INFO = "eaa30429a";
282834
- var CLI_VERSION = "0.56.0-nightly.20260806.g761f604c1";
282833
+ var GIT_COMMIT_INFO = "1110ce8bc";
282834
+ var CLI_VERSION = "0.57.0";
282835
282835
 
282836
282836
  // packages/core/src/ide/detect-ide.ts
282837
282837
  var IDE_DEFINITIONS = {
@@ -306451,7 +306451,7 @@ function getVersion() {
306451
306451
  }
306452
306452
  versionPromise = (async () => {
306453
306453
  const pkgJson = await getPackageJson(__dirname4);
306454
- return "0.56.0-nightly.20260806.g761f604c1";
306454
+ return "0.57.0";
306455
306455
  })();
306456
306456
  return versionPromise;
306457
306457
  }
@@ -309081,8 +309081,8 @@ function getErrorReplaceResult(params, occurrences, finalOldString, finalNewStri
309081
309081
  let error40 = void 0;
309082
309082
  if (occurrences === 0) {
309083
309083
  error40 = {
309084
- display: `Failed to edit, could not find the string to replace.`,
309085
- raw: `Failed to edit, 0 occurrences found for old_string in ${params.file_path}. Ensure you're not escaping content incorrectly and check whitespace, indentation, and context. Use ${READ_FILE_TOOL_NAME} tool to verify.`,
309084
+ display: `Could not find an exact match for old_string in '${params.file_path}'.`,
309085
+ raw: `Could not find an exact match for 'old_string' in '${params.file_path}'. If previous edits modified the file or you are modifying lines outside your recent read window, please use ReadFile to inspect the target lines before retrying with an exact 'old_string'.`,
309086
309086
  type: "edit_no_occurrence_found" /* EDIT_NO_OCCURRENCE_FOUND */
309087
309087
  };
309088
309088
  } else if (!params.allow_multiple && occurrences !== 1) {
@@ -309181,6 +309181,20 @@ var EditToolInvocation = class extends BaseToolInvocation {
309181
309181
  };
309182
309182
  }
309183
309183
  async attemptSelfCorrection(params, currentContent, initialError, abortSignal, originalLineEnding) {
309184
+ if (!params.old_string || params.old_string.trim() === "") {
309185
+ return {
309186
+ currentContent,
309187
+ newContent: currentContent,
309188
+ occurrences: 0,
309189
+ isNewFile: false,
309190
+ error: {
309191
+ display: "Edit failed: 'old_string' cannot be empty.",
309192
+ raw: "The 'old_string' parameter is required. The Edit tool performs localized search-and-replace. If you are modifying a section of the file you have not viewed recently, call ReadFile on the target line range to inspect the current code, then provide the exact matching lines in 'old_string'.",
309193
+ type: "invalid_tool_params" /* INVALID_TOOL_PARAMS */
309194
+ },
309195
+ originalLineEnding
309196
+ };
309197
+ }
309184
309198
  let errorForLlmEditFixer = initialError.raw;
309185
309199
  let contentForLlmEditFixer = currentContent;
309186
309200
  const initialContentHash = hashContent(currentContent);
@@ -309565,7 +309579,7 @@ ${snippet2}`);
309565
309579
  }
309566
309580
  if (this.params.modified_by_user) {
309567
309581
  llmSuccessMessageParts.push(
309568
- `User modified the \`new_string\` content to be: ${this.params.new_string}.`
309582
+ `The confirmation step modified the \`new_string\` content to be: ${this.params.new_string}.`
309569
309583
  );
309570
309584
  }
309571
309585
  const jitContext = await discoverJitContext(
@@ -332839,6 +332853,48 @@ function extractCuratedHistory2(comprehensiveHistory) {
332839
332853
  }
332840
332854
  return curatedHistory;
332841
332855
  }
332856
+ var THINKING_ONLY_NUDGE_MESSAGE = "[System: You previously generated thoughts but failed to provide a final user-facing response. Please ensure you provide your final answer or call a tool now.]";
332857
+ var NO_RESPONSE_TEXT_NUDGE_MESSAGE = "[System: You previously returned an empty response with no text or thoughts. Please ensure you provide your final answer or call a tool now.]";
332858
+ function applyRetryNudge(contents, nudgeMessage) {
332859
+ if (!nudgeMessage) {
332860
+ return contents;
332861
+ }
332862
+ const lastTurn = contents[contents.length - 1];
332863
+ const hasNudge = lastTurn?.parts?.some((p) => p.text?.includes(nudgeMessage));
332864
+ if (hasNudge) {
332865
+ return contents;
332866
+ }
332867
+ const cloned = contents.map((c4) => ({
332868
+ ...c4,
332869
+ parts: c4.parts ? [...c4.parts] : []
332870
+ }));
332871
+ const clonedLastTurn = cloned[cloned.length - 1];
332872
+ const hasFunctionResponse = clonedLastTurn?.parts?.some(
332873
+ (p) => p.functionResponse
332874
+ );
332875
+ if (clonedLastTurn?.role === "user" && hasFunctionResponse) {
332876
+ cloned.push({
332877
+ role: "model",
332878
+ parts: [{ text: "[Tool execution completed.]" }]
332879
+ });
332880
+ cloned.push({
332881
+ role: "user",
332882
+ parts: [{ text: nudgeMessage }]
332883
+ });
332884
+ } else if (clonedLastTurn?.role === "user") {
332885
+ if (!clonedLastTurn.parts) {
332886
+ clonedLastTurn.parts = [];
332887
+ }
332888
+ clonedLastTurn.parts.push({ text: `
332889
+ ${nudgeMessage}` });
332890
+ } else {
332891
+ cloned.push({
332892
+ role: "user",
332893
+ parts: [{ text: nudgeMessage }]
332894
+ });
332895
+ }
332896
+ return cloned;
332897
+ }
332842
332898
  var InvalidStreamError = class extends Error {
332843
332899
  type;
332844
332900
  constructor(message, type2) {
@@ -333288,23 +333344,19 @@ var GeminiChat = class {
333288
333344
  tools: this.tools,
333289
333345
  abortSignal
333290
333346
  };
333347
+ let nudgeMessage = "";
333291
333348
  if (modelConfigKey.isRetry && modelConfigKey.lastStreamError instanceof InvalidStreamError) {
333292
333349
  const lastError = modelConfigKey.lastStreamError;
333293
- let nudgeMessage = "";
333294
333350
  if (lastError.type === "THINKING_ONLY_RESPONSE") {
333295
- nudgeMessage = "\n[System: You previously generated thoughts but failed to provide a final user-facing response. Please ensure you provide your final answer or call a tool now.]";
333351
+ nudgeMessage = THINKING_ONLY_NUDGE_MESSAGE;
333296
333352
  } else if (lastError.type === "NO_RESPONSE_TEXT") {
333297
- nudgeMessage = "\n[System: You previously returned an empty response with no text or thoughts. Please ensure you provide your final answer or call a tool now.]";
333298
- }
333299
- if (nudgeMessage) {
333300
- if (typeof config2.systemInstruction === "string") {
333301
- config2.systemInstruction += nudgeMessage;
333302
- } else if (config2.systemInstruction === void 0) {
333303
- config2.systemInstruction = nudgeMessage;
333304
- }
333353
+ nudgeMessage = NO_RESPONSE_TEXT_NUDGE_MESSAGE;
333305
333354
  }
333306
333355
  }
333307
333356
  let contentsToUse = supportsModernFeatures(modelToUse) || isGemini2Model(modelToUse) ? [...contentsForPreviewModel] : [...requestContents];
333357
+ if (nudgeMessage) {
333358
+ contentsToUse = applyRetryNudge(contentsToUse, nudgeMessage);
333359
+ }
333308
333360
  const hookSystem = this.context.config.getHookSystem();
333309
333361
  if (hookSystem) {
333310
333362
  const beforeModelResult = await hookSystem.fireBeforeModelEvent({
@@ -333340,12 +333392,18 @@ var GeminiChat = class {
333340
333392
  );
333341
333393
  lastModelToUse = modelToUse;
333342
333394
  contentsToUse = supportsModernFeatures(modelToUse) || isGemini2Model(modelToUse) ? [...contentsForPreviewModel] : [...requestContents];
333395
+ if (nudgeMessage) {
333396
+ contentsToUse = applyRetryNudge(contentsToUse, nudgeMessage);
333397
+ }
333343
333398
  }
333344
333399
  if (beforeModelResult.modifiedConfig) {
333345
333400
  Object.assign(config2, beforeModelResult.modifiedConfig);
333346
333401
  }
333347
333402
  if (beforeModelResult.modifiedContents && Array.isArray(beforeModelResult.modifiedContents)) {
333348
333403
  contentsToUse = beforeModelResult.modifiedContents;
333404
+ if (nudgeMessage) {
333405
+ contentsToUse = applyRetryNudge(contentsToUse, nudgeMessage);
333406
+ }
333349
333407
  }
333350
333408
  const toolSelectionResult = await hookSystem.fireBeforeToolSelectionEvent({
333351
333409
  model: modelToUse,
@@ -333885,9 +333943,8 @@ function isInvalidArgumentError(errorMessage) {
333885
333943
  return errorMessage.includes("Request contains an invalid argument");
333886
333944
  }
333887
333945
  function stripToolCallIdPrefixes(contents) {
333888
- return contents.map((content) => ({
333889
- ...content,
333890
- parts: (content.parts || []).map((part) => {
333946
+ return contents.map((content) => {
333947
+ const parts2 = (content.parts || []).map((part) => {
333891
333948
  const newPart = { ...part };
333892
333949
  if (newPart.functionCall) {
333893
333950
  const fc = newPart.functionCall;
@@ -333911,9 +333968,27 @@ function stripToolCallIdPrefixes(contents) {
333911
333968
  };
333912
333969
  }
333913
333970
  }
333971
+ const hasOtherKeys = Object.keys(newPart).some(
333972
+ (key) => key !== "text" && key !== "thought" && key !== "callIndex" && newPart[key] !== void 0
333973
+ );
333974
+ if (newPart.text !== void 0 && newPart.text === "" && hasOtherKeys) {
333975
+ delete newPart.text;
333976
+ }
333914
333977
  return newPart;
333915
- })
333916
- }));
333978
+ }).filter((part) => {
333979
+ const hasOtherKeys = Object.keys(part).some(
333980
+ (key) => key !== "text" && key !== "thought" && key !== "callIndex" && part[key] !== void 0
333981
+ );
333982
+ if (part.text !== void 0 && part.text === "" && !hasOtherKeys) {
333983
+ return false;
333984
+ }
333985
+ return true;
333986
+ });
333987
+ return {
333988
+ ...content,
333989
+ parts: parts2
333990
+ };
333991
+ });
333917
333992
  }
333918
333993
  function coalesceConsecutiveRoles(history) {
333919
333994
  const result2 = [];
@@ -341420,7 +341495,7 @@ var A2AAuthProviderFactory = class _A2AAuthProviderFactory {
341420
341495
  return provider;
341421
341496
  }
341422
341497
  case "oauth2": {
341423
- const { OAuth2AuthProvider } = await import("./oauth2-provider-UPRM4Y2J.js");
341498
+ const { OAuth2AuthProvider } = await import("./oauth2-provider-BGMEA7RS.js");
341424
341499
  const provider = new OAuth2AuthProvider(
341425
341500
  authConfig,
341426
341501
  options.agentName ?? "unknown",
@@ -393858,6 +393933,7 @@ var LegacyAgentProtocol = class {
393858
393933
  let currentDisplayContent = initialDisplayContent;
393859
393934
  let turnCount = 0;
393860
393935
  const maxTurns = this._config.getMaxSessionTurns();
393936
+ let isAfterToolResponse = false;
393861
393937
  while (true) {
393862
393938
  turnCount++;
393863
393939
  if (maxTurns >= 0 && turnCount > maxTurns) {
@@ -393870,6 +393946,7 @@ var LegacyAgentProtocol = class {
393870
393946
  }
393871
393947
  const toolCallRequests = [];
393872
393948
  let finishedReason = void 0;
393949
+ let hasVisibleText = false;
393873
393950
  const responseStream = this._client.sendMessageStream(
393874
393951
  currentParts,
393875
393952
  this._abortController.signal,
@@ -393886,6 +393963,11 @@ var LegacyAgentProtocol = class {
393886
393963
  if (event.type === "tool_call_request" /* ToolCallRequest */) {
393887
393964
  toolCallRequests.push(event.value);
393888
393965
  }
393966
+ if (event.type === "content" /* Content */) {
393967
+ if (typeof event.value === "string" && event.value.trim() !== "") {
393968
+ hasVisibleText = true;
393969
+ }
393970
+ }
393889
393971
  this._emit(translateEvent(event, this._translationState));
393890
393972
  switch (event.type) {
393891
393973
  case "error" /* Error */:
@@ -393910,6 +393992,12 @@ var LegacyAgentProtocol = class {
393910
393992
  return;
393911
393993
  }
393912
393994
  if (toolCallRequests.length === 0) {
393995
+ if (isAfterToolResponse && !hasVisibleText) {
393996
+ const nudgeMessage = "[System: You successfully executed a tool but returned an empty response. Please analyze the tool output and explain your progress or final answer.]";
393997
+ currentParts = [{ text: nudgeMessage }];
393998
+ isAfterToolResponse = false;
393999
+ continue;
394000
+ }
393913
394001
  if (finishedReason !== void 0) {
393914
394002
  this._finishStream(mapFinishReason(finishedReason));
393915
394003
  } else {
@@ -393976,6 +394064,7 @@ var LegacyAgentProtocol = class {
393976
394064
  return;
393977
394065
  }
393978
394066
  currentParts = toolResponseParts;
394067
+ isAfterToolResponse = completedToolCalls.length > 0;
393979
394068
  }
393980
394069
  }
393981
394070
  _emit(events) {
@@ -403225,6 +403314,9 @@ export {
403225
403314
  SYNTHETIC_THOUGHT_SIGNATURE2 as SYNTHETIC_THOUGHT_SIGNATURE,
403226
403315
  INTERRUPTED_RESPONSE_PLACEHOLDER,
403227
403316
  isValidNonThoughtTextPart,
403317
+ THINKING_ONLY_NUDGE_MESSAGE,
403318
+ NO_RESPONSE_TEXT_NUDGE_MESSAGE,
403319
+ applyRetryNudge,
403228
403320
  InvalidStreamError,
403229
403321
  AgentExecutionStoppedError,
403230
403322
  AgentExecutionBlockedError,
@@ -1,7 +1,7 @@
1
1
  const require = (await import('node:module')).createRequire(import.meta.url); const __chunk_filename = (await import('node:url')).fileURLToPath(import.meta.url); const __chunk_dirname = (await import('node:path')).dirname(__chunk_filename);
2
2
  import {
3
3
  checkExhaustive
4
- } from "./chunk-R3JDAZVL.js";
4
+ } from "./chunk-S3MXVTTY.js";
5
5
  import {
6
6
  __commonJS,
7
7
  __toESM
@@ -2,7 +2,7 @@ const require = (await import('node:module')).createRequire(import.meta.url); co
2
2
  import {
3
3
  CoreToolCallStatus,
4
4
  checkExhaustive
5
- } from "./chunk-2UICYJMD.js";
5
+ } from "./chunk-7HKQGPWB.js";
6
6
  import {
7
7
  __commonJS,
8
8
  __toESM
@@ -1,7 +1,7 @@
1
1
  const require = (await import('node:module')).createRequire(import.meta.url); const __chunk_filename = (await import('node:url')).fileURLToPath(import.meta.url); const __chunk_dirname = (await import('node:path')).dirname(__chunk_filename);
2
2
  import {
3
3
  runExitCleanup
4
- } from "./chunk-M6E5CLIH.js";
4
+ } from "./chunk-7IKUWYZO.js";
5
5
  import {
6
6
  __commonJS,
7
7
  __require
@@ -11,8 +11,8 @@ import {
11
11
  runSyncCleanup,
12
12
  setupSignalHandlers,
13
13
  setupTtyCheck
14
- } from "./chunk-OFFEM74O.js";
15
- import "./chunk-FWGOOSQK.js";
14
+ } from "./chunk-RLDNVR77.js";
15
+ import "./chunk-DFPYJMVX.js";
16
16
  import "./chunk-664ZODQF.js";
17
17
  import "./chunk-IUUIT4SU.js";
18
18
  import "./chunk-TUDYL3X4.js";
@@ -11,8 +11,8 @@ import {
11
11
  runSyncCleanup,
12
12
  setupSignalHandlers,
13
13
  setupTtyCheck
14
- } from "./chunk-M6E5CLIH.js";
15
- import "./chunk-2UICYJMD.js";
14
+ } from "./chunk-7IKUWYZO.js";
15
+ import "./chunk-S3MXVTTY.js";
16
16
  import "./chunk-664ZODQF.js";
17
17
  import "./chunk-IUUIT4SU.js";
18
18
  import "./chunk-TUDYL3X4.js";
@@ -11,8 +11,8 @@ import {
11
11
  runSyncCleanup,
12
12
  setupSignalHandlers,
13
13
  setupTtyCheck
14
- } from "./chunk-2UGGPOEV.js";
15
- import "./chunk-R3JDAZVL.js";
14
+ } from "./chunk-GAS2GAYB.js";
15
+ import "./chunk-7HKQGPWB.js";
16
16
  import "./chunk-664ZODQF.js";
17
17
  import "./chunk-IUUIT4SU.js";
18
18
  import "./chunk-TUDYL3X4.js";
@@ -337,6 +337,7 @@ import {
337
337
  ModelRouterService,
338
338
  ModelSlashCommandEvent,
339
339
  NO_EDITOR_AVAILABLE_ERROR,
340
+ NO_RESPONSE_TEXT_NUDGE_MESSAGE,
340
341
  NetworkRetryAttemptEvent,
341
342
  NodeType,
342
343
  NoopSandboxManager,
@@ -452,6 +453,7 @@ import {
452
453
  SubagentState,
453
454
  TASK_TYPE_LABELS,
454
455
  THINKING_ONLY_COMPRESS_SUGGESTION,
456
+ THINKING_ONLY_NUDGE_MESSAGE,
455
457
  TODOS_ITEM_PARAM_DESCRIPTION,
456
458
  TODOS_ITEM_PARAM_STATUS,
457
459
  TODOS_PARAM_TODOS,
@@ -539,6 +541,7 @@ import {
539
541
  applyInboxPatch,
540
542
  applyReplacement,
541
543
  applyRequiredServers,
544
+ applyRetryNudge,
542
545
  assertValidPathString,
543
546
  assumeExhaustive,
544
547
  authEvents,
@@ -1080,7 +1083,7 @@ import {
1080
1083
  wrapUntrusted,
1081
1084
  writeToStderr,
1082
1085
  writeToStdout
1083
- } from "./chunk-FWGOOSQK.js";
1086
+ } from "./chunk-DFPYJMVX.js";
1084
1087
  import "./chunk-664ZODQF.js";
1085
1088
  import {
1086
1089
  SpanStatusCode,
@@ -1426,6 +1429,7 @@ export {
1426
1429
  ModelRouterService,
1427
1430
  ModelSlashCommandEvent,
1428
1431
  NO_EDITOR_AVAILABLE_ERROR,
1432
+ NO_RESPONSE_TEXT_NUDGE_MESSAGE,
1429
1433
  NetworkRetryAttemptEvent,
1430
1434
  NodeType,
1431
1435
  NoopSandboxManager,
@@ -1542,6 +1546,7 @@ export {
1542
1546
  SubagentState,
1543
1547
  TASK_TYPE_LABELS,
1544
1548
  THINKING_ONLY_COMPRESS_SUGGESTION,
1549
+ THINKING_ONLY_NUDGE_MESSAGE,
1545
1550
  TODOS_ITEM_PARAM_DESCRIPTION,
1546
1551
  TODOS_ITEM_PARAM_STATUS,
1547
1552
  TODOS_PARAM_TODOS,
@@ -1630,6 +1635,7 @@ export {
1630
1635
  applyInboxPatch,
1631
1636
  applyReplacement,
1632
1637
  applyRequiredServers,
1638
+ applyRetryNudge,
1633
1639
  assertValidPathString,
1634
1640
  assumeExhaustive,
1635
1641
  authEvents,
@@ -337,6 +337,7 @@ import {
337
337
  ModelRouterService,
338
338
  ModelSlashCommandEvent,
339
339
  NO_EDITOR_AVAILABLE_ERROR,
340
+ NO_RESPONSE_TEXT_NUDGE_MESSAGE,
340
341
  NetworkRetryAttemptEvent,
341
342
  NodeType,
342
343
  NoopSandboxManager,
@@ -452,6 +453,7 @@ import {
452
453
  SubagentState,
453
454
  TASK_TYPE_LABELS,
454
455
  THINKING_ONLY_COMPRESS_SUGGESTION,
456
+ THINKING_ONLY_NUDGE_MESSAGE,
455
457
  TODOS_ITEM_PARAM_DESCRIPTION,
456
458
  TODOS_ITEM_PARAM_STATUS,
457
459
  TODOS_PARAM_TODOS,
@@ -539,6 +541,7 @@ import {
539
541
  applyInboxPatch,
540
542
  applyReplacement,
541
543
  applyRequiredServers,
544
+ applyRetryNudge,
542
545
  assertValidPathString,
543
546
  assumeExhaustive,
544
547
  authEvents,
@@ -1080,7 +1083,7 @@ import {
1080
1083
  wrapUntrusted,
1081
1084
  writeToStderr,
1082
1085
  writeToStdout
1083
- } from "./chunk-2UICYJMD.js";
1086
+ } from "./chunk-S3MXVTTY.js";
1084
1087
  import "./chunk-664ZODQF.js";
1085
1088
  import {
1086
1089
  SpanStatusCode,
@@ -1426,6 +1429,7 @@ export {
1426
1429
  ModelRouterService,
1427
1430
  ModelSlashCommandEvent,
1428
1431
  NO_EDITOR_AVAILABLE_ERROR,
1432
+ NO_RESPONSE_TEXT_NUDGE_MESSAGE,
1429
1433
  NetworkRetryAttemptEvent,
1430
1434
  NodeType,
1431
1435
  NoopSandboxManager,
@@ -1542,6 +1546,7 @@ export {
1542
1546
  SubagentState,
1543
1547
  TASK_TYPE_LABELS,
1544
1548
  THINKING_ONLY_COMPRESS_SUGGESTION,
1549
+ THINKING_ONLY_NUDGE_MESSAGE,
1545
1550
  TODOS_ITEM_PARAM_DESCRIPTION,
1546
1551
  TODOS_ITEM_PARAM_STATUS,
1547
1552
  TODOS_PARAM_TODOS,
@@ -1630,6 +1635,7 @@ export {
1630
1635
  applyInboxPatch,
1631
1636
  applyReplacement,
1632
1637
  applyRequiredServers,
1638
+ applyRetryNudge,
1633
1639
  assertValidPathString,
1634
1640
  assumeExhaustive,
1635
1641
  authEvents,