@kenkaiiii/gg-agent 5.44.0 → 5.44.1

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.
package/dist/index.cjs CHANGED
@@ -1160,6 +1160,7 @@ async function executeSingleToolCall(toolCall, options, pushEvent) {
1160
1160
  let resultContent;
1161
1161
  let details;
1162
1162
  let isError = false;
1163
+ let invalidArgAttempt;
1163
1164
  const tool = options.toolMap.get(toolCall.name);
1164
1165
  if (!tool) {
1165
1166
  resultContent = `Unknown tool: ${toolCall.name}`;
@@ -1194,6 +1195,7 @@ async function executeSingleToolCall(toolCall, options, pushEvent) {
1194
1195
  const failureKey = `${toolCall.name}:${prettyError}`;
1195
1196
  const failureCount = (options.invalidToolArgumentCounts.get(failureKey) ?? 0) + 1;
1196
1197
  options.invalidToolArgumentCounts.set(failureKey, failureCount);
1198
+ invalidArgAttempt = failureCount;
1197
1199
  resultContent = `Invalid arguments for tool \`${toolCall.name}\`:
1198
1200
  ` + prettyError + "\nRe-issue the call with each field as the correct type.";
1199
1201
  if (failureCount >= 3) {
@@ -1224,7 +1226,8 @@ async function executeSingleToolCall(toolCall, options, pushEvent) {
1224
1226
  result: toolResultPreview(resultContent),
1225
1227
  details,
1226
1228
  isError,
1227
- durationMs
1229
+ durationMs,
1230
+ ...invalidArgAttempt === void 0 ? {} : { invalidArgAttempt }
1228
1231
  });
1229
1232
  return { toolCallId: toolCall.id, content: resultContent, isError };
1230
1233
  }