@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.js +14 -3
- package/build/index.js.map +3 -3
- package/build/index.mjs +14 -3
- package/build/index.mjs.map +3 -3
- package/build/types/run-scenario/agents/timeout.d.ts +9 -0
- package/package.json +2 -2
package/build/index.js
CHANGED
|
@@ -664,6 +664,14 @@ async function writeSkillToFilesystem(cwd, skill, fetchFn = import_evalforge_git
|
|
|
664
664
|
}
|
|
665
665
|
}
|
|
666
666
|
|
|
667
|
+
// src/run-scenario/agents/timeout.ts
|
|
668
|
+
var UNLIMITED_RUN_TIMEOUT_MS = 60 * 6e4;
|
|
669
|
+
function resolveTimeoutMs(maxTurns, maxDurationMs) {
|
|
670
|
+
if (maxDurationMs !== void 0) return maxDurationMs;
|
|
671
|
+
if (maxTurns === void 0) return UNLIMITED_RUN_TIMEOUT_MS;
|
|
672
|
+
return Math.max(3e5, maxTurns * 6e4);
|
|
673
|
+
}
|
|
674
|
+
|
|
667
675
|
// src/run-scenario/agents/claude-code/execute.ts
|
|
668
676
|
var import_crypto = require("crypto");
|
|
669
677
|
|
|
@@ -1294,7 +1302,7 @@ async function executeWithClaudeCode(skills, scenario, options) {
|
|
|
1294
1302
|
traceContext.authToken
|
|
1295
1303
|
);
|
|
1296
1304
|
}
|
|
1297
|
-
const SDK_TIMEOUT_MS = options.maxDurationMs
|
|
1305
|
+
const SDK_TIMEOUT_MS = resolveTimeoutMs(maxTurns, options.maxDurationMs);
|
|
1298
1306
|
let timeoutHandle;
|
|
1299
1307
|
let timedOut = false;
|
|
1300
1308
|
const HEARTBEAT_INTERVAL_MS = 1e4;
|
|
@@ -3097,7 +3105,7 @@ async function executeWithOpenCode(skills, scenario, options) {
|
|
|
3097
3105
|
model: options.model
|
|
3098
3106
|
});
|
|
3099
3107
|
const maxTurns = options.maxTurns || void 0;
|
|
3100
|
-
const sdkTimeoutMs = options.maxDurationMs
|
|
3108
|
+
const sdkTimeoutMs = resolveTimeoutMs(maxTurns, options.maxDurationMs);
|
|
3101
3109
|
const { env, providerID, modelID } = await buildOpenCodeEnv({
|
|
3102
3110
|
model: options.model,
|
|
3103
3111
|
temperature: options.temperature,
|
|
@@ -3707,7 +3715,10 @@ async function executeWithAiSdk(context) {
|
|
|
3707
3715
|
emitStartEvent(traceContext, startTime);
|
|
3708
3716
|
}
|
|
3709
3717
|
const effectiveMaxTurns = cfg.maxTurns === 0 ? void 0 : cfg.maxTurns ?? DEFAULT_MAX_TOOL_STEPS;
|
|
3710
|
-
const SDK_TIMEOUT_MS =
|
|
3718
|
+
const SDK_TIMEOUT_MS = resolveTimeoutMs(
|
|
3719
|
+
effectiveMaxTurns,
|
|
3720
|
+
cfg.maxDurationMs
|
|
3721
|
+
);
|
|
3711
3722
|
const abortController = new AbortController();
|
|
3712
3723
|
const timeoutHandle = setTimeout(() => {
|
|
3713
3724
|
abortController.abort(
|