fix: init lastUserInputStepIdx + lastResponseCaptureStep on session change (prevents stale replay)
This commit is contained in:
@@ -1510,6 +1510,8 @@ function setupMonitor() {
|
|||||||
lastKnownStepCount = currentCount;
|
lastKnownStepCount = currentCount;
|
||||||
lastNotifyStepIndex = bestSession.latestNotifyUserStep?.stepIndex ?? -1;
|
lastNotifyStepIndex = bestSession.latestNotifyUserStep?.stepIndex ?? -1;
|
||||||
lastTaskStepIndex = bestSession.latestTaskBoundaryStep?.stepIndex ?? -1;
|
lastTaskStepIndex = bestSession.latestTaskBoundaryStep?.stepIndex ?? -1;
|
||||||
|
lastUserInputStepIdx = bestSession.lastUserInputStepIndex ?? -1;
|
||||||
|
lastResponseCaptureStep = currentCount; // don't re-relay old responses
|
||||||
lastPendingStepIndex = -1;
|
lastPendingStepIndex = -1;
|
||||||
stallProbed = false;
|
stallProbed = false;
|
||||||
// Don't register here — registration happens lazily in writeChatSnapshot/writePendingApproval
|
// Don't register here — registration happens lazily in writeChatSnapshot/writePendingApproval
|
||||||
|
|||||||
File diff suppressed because one or more lines are too long
@@ -1487,6 +1487,8 @@ function setupMonitor() {
|
|||||||
lastKnownStepCount = currentCount;
|
lastKnownStepCount = currentCount;
|
||||||
lastNotifyStepIndex = bestSession.latestNotifyUserStep?.stepIndex ?? -1;
|
lastNotifyStepIndex = bestSession.latestNotifyUserStep?.stepIndex ?? -1;
|
||||||
lastTaskStepIndex = bestSession.latestTaskBoundaryStep?.stepIndex ?? -1;
|
lastTaskStepIndex = bestSession.latestTaskBoundaryStep?.stepIndex ?? -1;
|
||||||
|
lastUserInputStepIdx = bestSession.lastUserInputStepIndex ?? -1;
|
||||||
|
lastResponseCaptureStep = currentCount; // don't re-relay old responses
|
||||||
lastPendingStepIndex = -1;
|
lastPendingStepIndex = -1;
|
||||||
stallProbed = false;
|
stallProbed = false;
|
||||||
// Don't register here — registration happens lazily in writeChatSnapshot/writePendingApproval
|
// Don't register here — registration happens lazily in writeChatSnapshot/writePendingApproval
|
||||||
|
|||||||
Reference in New Issue
Block a user