fix: init lastUserInputStepIdx + lastResponseCaptureStep on session change (prevents stale replay)

This commit is contained in:
2026-03-10 14:35:56 +09:00
parent 82b727a1e6
commit f8f9ce8f5f
3 changed files with 5 additions and 1 deletions

View File

@@ -1510,6 +1510,8 @@ function setupMonitor() {
lastKnownStepCount = currentCount;
lastNotifyStepIndex = bestSession.latestNotifyUserStep?.stepIndex ?? -1;
lastTaskStepIndex = bestSession.latestTaskBoundaryStep?.stepIndex ?? -1;
lastUserInputStepIdx = bestSession.lastUserInputStepIndex ?? -1;
lastResponseCaptureStep = currentCount; // don't re-relay old responses
lastPendingStepIndex = -1;
stallProbed = false;
// Don't register here — registration happens lazily in writeChatSnapshot/writePendingApproval

File diff suppressed because one or more lines are too long

View File

@@ -1487,6 +1487,8 @@ function setupMonitor() {
lastKnownStepCount = currentCount;
lastNotifyStepIndex = bestSession.latestNotifyUserStep?.stepIndex ?? -1;
lastTaskStepIndex = bestSession.latestTaskBoundaryStep?.stepIndex ?? -1;
lastUserInputStepIdx = bestSession.lastUserInputStepIndex ?? -1;
lastResponseCaptureStep = currentCount; // don't re-relay old responses
lastPendingStepIndex = -1;
stallProbed = false;
// Don't register here — registration happens lazily in writeChatSnapshot/writePendingApproval