fix: process ALL parallel WAITING steps instead of only first one

step_probe break statement caused only one WAITING step to get
a pending file when AG runs multiple parallel tool calls.
Now iterates all WAITING steps and creates pending for each.
This commit is contained in:
Variet Worker
2026-03-16 20:36:41 +09:00
parent fdc0084813
commit 7f079a56a0
3 changed files with 23 additions and 11 deletions

View File

@@ -2060,7 +2060,10 @@ function setupMonitor() {
logToFile(`[STEP-PROBE] ★ WAITING (via offset)! step=${actualIndex} type=${oStep.type} cmd='${command}'`);
if (actualIndex !== lastPendingStepIndex) {
stallProbed = true;
lastPendingStepIndex = actualIndex;
// Track highest step index for auto-resolve
if (actualIndex > lastPendingStepIndex) {
lastPendingStepIndex = actualIndex;
}
lastPendingTime = Date.now();
sawRunningAfterPending = false;
// Skip pending for workspace-less AG windows (project=default)
@@ -2081,7 +2084,7 @@ function setupMonitor() {
});
}
}
break;
// NOTE: no break — process ALL parallel WAITING steps
}
}
}
@@ -2090,7 +2093,7 @@ function setupMonitor() {
logToFile(`[STEP-PROBE] offset retry failed: ${oe.message.substring(0, 100)}`);
}
}
// Scan last 5 steps backwards to find WAITING (RUN_COMMAND may not be last)
// Scan last 5 steps backwards to find ALL WAITING steps (parallel tool calls)
let foundWaiting = false;
for (let si = steps.length - 1; si >= Math.max(0, steps.length - 5); si--) {
const step = steps[si];
@@ -2125,7 +2128,10 @@ function setupMonitor() {
logToFile(`[STEP-PROBE] ★ WAITING! step=${si} type=${stepType} cmd='${command}'`);
if (si !== lastPendingStepIndex) {
stallProbed = true; // found WAITING — stop retrying
lastPendingStepIndex = si;
// Track highest step index for auto-resolve
if (si > lastPendingStepIndex) {
lastPendingStepIndex = si;
}
lastPendingTime = Date.now();
sawRunningAfterPending = false;
// Skip pending for workspace-less AG windows (project=default)
@@ -2146,7 +2152,7 @@ function setupMonitor() {
});
}
}
break;
// NOTE: no break — process ALL parallel WAITING steps
}
}
if (!foundWaiting) {

File diff suppressed because one or more lines are too long