fix: disable ResolveOutstandingSteps + add 775-limit stall fallback

This commit is contained in:
2026-03-10 08:03:57 +09:00
parent 0e3a896c86
commit 2361aa7558
3 changed files with 43 additions and 24 deletions

View File

@@ -1560,6 +1560,23 @@ function setupMonitor() {
logToFile(`[STEP-PROBE] returned=${steps.length} vs trajectory.stepCount=${currentCount}`);
if (steps.length < currentCount) {
logToFile(`[STEP-PROBE] ⚠️ 775-limit hit! steps=${steps.length} < stepCount=${currentCount}`);
// 775-LIMIT FALLBACK: API can't return latest steps.
// Use stall detection to create a generic pending.
if (consecutiveIdleCount >= 3 && lastPendingStepIndex !== currentCount) {
logToFile(`[STEP-PROBE] 775-LIMIT FALLBACK: creating generic pending for step ~${currentCount}`);
stallProbed = true;
lastPendingStepIndex = currentCount;
lastPendingTime = Date.now();
sawRunningAfterPending = false;
writePendingApproval({
conversation_id: activeSessionId,
command: `run_command: (step ${currentCount}, beyond API limit)`,
description: `Step ~${currentCount} (775-limit, type unknown)`,
step_type: 'run_command',
step_index: currentCount,
source: 'step_probe_775_fallback',
});
}
}
// Scan last 5 steps backwards to find WAITING (RUN_COMMAND may not be last)
let foundWaiting = false;
@@ -2291,19 +2308,11 @@ async function tryApprovalStrategies(approved, sessionId, stepType = '', stepInd
catch (e) {
logToFile(`[APPROVAL-2] ❌ FAIL: ${e.message}`);
}
// ── Strategy 3: ResolveOutstandingSteps (REJECT ONLY — this CANCELS!) ──
// ── Strategy 3: ResolveOutstandingSteps — DISABLED (too destructive!) ──
// This was cancelling AG work when bot sent approved=false.
// DO NOT enable without explicit user confirmation.
if (!approved && sdk) {
try {
logToFile(`[APPROVAL-3] ResolveOutstandingSteps (REJECT/CANCEL only!)`);
const rpcResult = await sdk.ls.rawRPC('ResolveOutstandingSteps', {
cascadeId: sessionId,
});
logToFile(`[APPROVAL-3] ✅ SUCCESS: ${JSON.stringify(rpcResult).substring(0, 200)}`);
return `RPC-3:ResolveOutstandingSteps(cancel)`;
}
catch (e) {
logToFile(`[APPROVAL-3] ❌ FAIL: ${e.message}`);
}
logToFile(`[APPROVAL-3] ResolveOutstandingSteps DISABLED — reject only logs, no cancel`);
}
logToFile(`[APPROVAL] ⚠️ ALL strategies attempted — check logs for results`);
return `ALL_ATTEMPTED:${action}`;