From 64d1a4533ce0d5414c28acd5c8da4e04bc5325df Mon Sep 17 00:00:00 2001 From: Dallin Romney Date: Sat, 11 Oct 2025 23:16:41 -0700 Subject: [PATCH 1/2] fix: HOTFIX stop agent loop if aborted/not streaming --- gui/src/redux/thunks/streamNormalInput.ts | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/gui/src/redux/thunks/streamNormalInput.ts b/gui/src/redux/thunks/streamNormalInput.ts index bf4939c38..5497d9b6f 100644 --- a/gui/src/redux/thunks/streamNormalInput.ts +++ b/gui/src/redux/thunks/streamNormalInput.ts @@ -254,12 +254,17 @@ export const streamNormalInput = createAsyncThunk< // 2. Pre-process args to catch invalid args before checking policies const state2 = getState(); + if (streamAborter.signal.aborted || !state2.session.isStreaming) { + return; + } const generatedCalls2 = selectPendingToolCalls(state2); await preprocessToolCalls(dispatch, extra.ideMessenger, generatedCalls2); // 3. Security check: evaluate updated policies based on args const state3 = getState(); - + if (streamAborter.signal.aborted || !state3.session.isStreaming) { + return; + } const generatedCalls3 = selectPendingToolCalls(state3); const toolPolicies = state3.ui.toolSettings; const policies = await evaluateToolPolicies( @@ -283,6 +288,9 @@ export const streamNormalInput = createAsyncThunk< // auto stream cases increase thunk depth by 1 const state4 = getState(); const generatedCalls4 = selectPendingToolCalls(state4); + if (streamAborter.signal.aborted || !state4.session.isStreaming) { + return; + } if (generatedCalls4.length > 0) { // All that didn't fail are auto approved - call them await Promise.all( From 32f4c817e5c22245e516305fadbae5cbd67d4c5f Mon Sep 17 00:00:00 2001 From: Dallin Romney Date: Sun, 12 Oct 2025 00:03:05 -0700 Subject: [PATCH 2/2] fix: extra setInactive in test --- gui/src/redux/thunks/streamResponse.test.ts | 5 ----- 1 file changed, 5 deletions(-) diff --git a/gui/src/redux/thunks/streamResponse.test.ts b/gui/src/redux/thunks/streamResponse.test.ts index cff4eb7ae..8b37cf889 100644 --- a/gui/src/redux/thunks/streamResponse.test.ts +++ b/gui/src/redux/thunks/streamResponse.test.ts @@ -1068,11 +1068,6 @@ describe("streamResponseThunk", () => { type: "session/abortStream", payload: undefined, }, - // Stream end cleanup - { - type: "session/setInactive", - payload: undefined, - }, { type: "chat/streamNormalInput/fulfilled", meta: {