@kenkaiiii/gg-agent 5.29.0 → 5.29.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.d.cts CHANGED
@@ -20,6 +20,13 @@ interface AgentTool<T extends z.ZodType = z.ZodType> extends Tool {
20
20
  * batch runs in source order so stateful mutations cannot race each other.
21
21
  */
22
22
  executionMode?: ToolExecutionMode;
23
+ /**
24
+ * Overrides the loop's default per-tool timeout. A tool that owns a longer
25
+ * internal budget than the default must declare it here, or the loop cancels
26
+ * it first and the tool's own timeout — with its specific, actionable error
27
+ * message — becomes unreachable.
28
+ */
29
+ timeoutMs?: number;
23
30
  execute: (args: z.infer<T>, context: ToolContext) => ToolExecuteResult | Promise<ToolExecuteResult>;
24
31
  }
25
32
  interface AgentTextDeltaEvent {
package/dist/index.d.ts CHANGED
@@ -20,6 +20,13 @@ interface AgentTool<T extends z.ZodType = z.ZodType> extends Tool {
20
20
  * batch runs in source order so stateful mutations cannot race each other.
21
21
  */
22
22
  executionMode?: ToolExecutionMode;
23
+ /**
24
+ * Overrides the loop's default per-tool timeout. A tool that owns a longer
25
+ * internal budget than the default must declare it here, or the loop cancels
26
+ * it first and the tool's own timeout — with its specific, actionable error
27
+ * message — becomes unreachable.
28
+ */
29
+ timeoutMs?: number;
23
30
  execute: (args: z.infer<T>, context: ToolContext) => ToolExecuteResult | Promise<ToolExecuteResult>;
24
31
  }
25
32
  interface AgentTextDeltaEvent {
package/dist/index.js CHANGED
@@ -35,6 +35,7 @@ function isLocalBackendUrl(baseUrl) {
35
35
 
36
36
  // src/agent-loop.ts
37
37
  var DEFAULT_MAX_TURNS = 300;
38
+ var DEFAULT_TOOL_TIMEOUT_MS = 3e5;
38
39
  var _diagFn = null;
39
40
  function setStreamDiagnostic(fn) {
40
41
  _diagFn = fn;
@@ -1081,7 +1082,7 @@ async function executeSingleToolCall(toolCall, options, pushEvent) {
1081
1082
  try {
1082
1083
  const parsed = tool.parameters.parse(toolCall.args);
1083
1084
  const callerSignal = options.signal;
1084
- const toolTimeout = AbortSignal.timeout(3e5);
1085
+ const toolTimeout = AbortSignal.timeout(tool.timeoutMs ?? DEFAULT_TOOL_TIMEOUT_MS);
1085
1086
  const ctx = {
1086
1087
  signal: callerSignal ? AbortSignal.any([callerSignal, toolTimeout]) : toolTimeout,
1087
1088
  toolCallId: toolCall.id,