@wix/evalforge-evaluator 0.155.0 → 0.156.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.
package/build/index.mjs CHANGED
@@ -659,6 +659,14 @@ async function writeSkillToFilesystem(cwd, skill, fetchFn = fetchGitHubFolder2)
659
659
  }
660
660
  }
661
661
 
662
+ // src/run-scenario/agents/timeout.ts
663
+ var UNLIMITED_RUN_TIMEOUT_MS = 60 * 6e4;
664
+ function resolveTimeoutMs(maxTurns, maxDurationMs) {
665
+ if (maxDurationMs !== void 0) return maxDurationMs;
666
+ if (maxTurns === void 0) return UNLIMITED_RUN_TIMEOUT_MS;
667
+ return Math.max(3e5, maxTurns * 6e4);
668
+ }
669
+
662
670
  // src/run-scenario/agents/claude-code/execute.ts
663
671
  import { randomUUID } from "crypto";
664
672
 
@@ -1291,7 +1299,7 @@ async function executeWithClaudeCode(skills, scenario, options) {
1291
1299
  traceContext.authToken
1292
1300
  );
1293
1301
  }
1294
- const SDK_TIMEOUT_MS = options.maxDurationMs ?? Math.max(3e5, (maxTurns ?? 10) * 6e4);
1302
+ const SDK_TIMEOUT_MS = resolveTimeoutMs(maxTurns, options.maxDurationMs);
1295
1303
  let timeoutHandle;
1296
1304
  let timedOut = false;
1297
1305
  const HEARTBEAT_INTERVAL_MS = 1e4;
@@ -3104,7 +3112,7 @@ async function executeWithOpenCode(skills, scenario, options) {
3104
3112
  model: options.model
3105
3113
  });
3106
3114
  const maxTurns = options.maxTurns || void 0;
3107
- const sdkTimeoutMs = options.maxDurationMs ?? Math.max(3e5, (maxTurns ?? 10) * 6e4);
3115
+ const sdkTimeoutMs = resolveTimeoutMs(maxTurns, options.maxDurationMs);
3108
3116
  const { env, providerID, modelID } = await buildOpenCodeEnv({
3109
3117
  model: options.model,
3110
3118
  temperature: options.temperature,
@@ -3726,7 +3734,10 @@ async function executeWithAiSdk(context) {
3726
3734
  emitStartEvent(traceContext, startTime);
3727
3735
  }
3728
3736
  const effectiveMaxTurns = cfg.maxTurns === 0 ? void 0 : cfg.maxTurns ?? DEFAULT_MAX_TOOL_STEPS;
3729
- const SDK_TIMEOUT_MS = cfg.maxDurationMs ?? Math.max(3e5, (effectiveMaxTurns ?? 25) * 6e4);
3737
+ const SDK_TIMEOUT_MS = resolveTimeoutMs(
3738
+ effectiveMaxTurns,
3739
+ cfg.maxDurationMs
3740
+ );
3730
3741
  const abortController = new AbortController();
3731
3742
  const timeoutHandle = setTimeout(() => {
3732
3743
  abortController.abort(