@wix/evalforge-evaluator 0.121.0 → 0.122.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 +13 -3
- package/build/index.js.map +2 -2
- package/build/index.mjs +13 -3
- package/build/index.mjs.map +2 -2
- package/package.json +2 -2
package/build/index.js
CHANGED
|
@@ -2606,6 +2606,7 @@ var import_promises9 = require("fs/promises");
|
|
|
2606
2606
|
var import_path10 = require("path");
|
|
2607
2607
|
var KILL_GRACE_PERIOD_MS = 5e3;
|
|
2608
2608
|
var IDLE_TIMEOUT_MS = 12e4;
|
|
2609
|
+
var TOOL_RUNNING_IDLE_TIMEOUT_MS = 36e4;
|
|
2609
2610
|
var IDLE_CHECK_INTERVAL_MS = 15e3;
|
|
2610
2611
|
function extractToolAction(toolName, args) {
|
|
2611
2612
|
if (!toolName) return "Using tool...";
|
|
@@ -2761,6 +2762,7 @@ async function executeWithOpenCode(skills, scenario, options) {
|
|
|
2761
2762
|
let lastAction = "Starting...";
|
|
2762
2763
|
let lastToolName;
|
|
2763
2764
|
let lastFilePath;
|
|
2765
|
+
let isToolRunning = false;
|
|
2764
2766
|
if (traceContext) {
|
|
2765
2767
|
emitTraceEvent(
|
|
2766
2768
|
{
|
|
@@ -2961,15 +2963,16 @@ Stderr: ${stderr.slice(0, 1e3)}`
|
|
|
2961
2963
|
timers.idleCheck = setInterval(() => {
|
|
2962
2964
|
if (resolved) return;
|
|
2963
2965
|
const idleTime = Date.now() - lastOutputTime;
|
|
2964
|
-
|
|
2966
|
+
const effectiveTimeout = isToolRunning ? TOOL_RUNNING_IDLE_TIMEOUT_MS : IDLE_TIMEOUT_MS;
|
|
2967
|
+
if (idleTime >= effectiveTimeout) {
|
|
2965
2968
|
console.warn(
|
|
2966
|
-
`[OpenCode] Process appears stuck - no output for ${Math.round(idleTime / 1e3)}s. Killing process.`
|
|
2969
|
+
`[OpenCode] Process appears stuck - no output for ${Math.round(idleTime / 1e3)}s (tool running: ${isToolRunning}). Killing process.`
|
|
2967
2970
|
);
|
|
2968
2971
|
killProcess(child, resolved);
|
|
2969
2972
|
finalize(
|
|
2970
2973
|
false,
|
|
2971
2974
|
new Error(
|
|
2972
|
-
`OpenCode process stuck - no output for ${Math.round(idleTime / 1e3)} seconds (idle timeout). Skills: ${skillNames}, Scenario: ${scenario.name}`
|
|
2975
|
+
`OpenCode process stuck - no output for ${Math.round(idleTime / 1e3)} seconds (idle timeout, tool running: ${isToolRunning}). Skills: ${skillNames}, Scenario: ${scenario.name}`
|
|
2973
2976
|
)
|
|
2974
2977
|
);
|
|
2975
2978
|
}
|
|
@@ -3030,6 +3033,13 @@ Stderr: ${stderr.slice(0, 1e3)}`
|
|
|
3030
3033
|
const evt = tryParseJson(line);
|
|
3031
3034
|
if (!evt || !evt.type) continue;
|
|
3032
3035
|
allEvents.push({ event: evt, receivedAt: Date.now() });
|
|
3036
|
+
if (evt.type === "tool_use") {
|
|
3037
|
+
const tu = evt;
|
|
3038
|
+
const status = tu.part.state.status;
|
|
3039
|
+
isToolRunning = status !== "completed" && status !== "error";
|
|
3040
|
+
} else {
|
|
3041
|
+
isToolRunning = false;
|
|
3042
|
+
}
|
|
3033
3043
|
if (traceContext) {
|
|
3034
3044
|
traceStepNumber++;
|
|
3035
3045
|
const traceEvt = createTraceEventFromNdjson(
|