diff --git a/gui/src/redux/slices/sessionSlice.ts b/gui/src/redux/slices/sessionSlice.ts index ba6ff25e1..5aa714acc 100644 --- a/gui/src/redux/slices/sessionSlice.ts +++ b/gui/src/redux/slices/sessionSlice.ts @@ -111,6 +111,12 @@ export const sessionSlice = createSlice({ lastMessage.promptLogs = lastMessage.promptLogs ? lastMessage.promptLogs.concat(payload) : payload; + + // Inactive thinking for reasoning models when '' tag is not received on request completion + if (lastMessage.reasoning?.active) { + lastMessage.reasoning.active = false; + lastMessage.reasoning.endAt = Date.now(); + } }, setActive: (state) => { state.isStreaming = true; diff --git a/gui/src/redux/thunks/streamNormalInput.ts b/gui/src/redux/thunks/streamNormalInput.ts index 94b96946d..afc80fbe4 100644 --- a/gui/src/redux/thunks/streamNormalInput.ts +++ b/gui/src/redux/thunks/streamNormalInput.ts @@ -9,7 +9,7 @@ import { addPromptCompletionPair, selectUseTools, setToolGenerated, - streamUpdate, + streamUpdate } from "../slices/sessionSlice"; import { ThunkApiType } from "../store"; import { callTool } from "./callTool"; @@ -70,7 +70,7 @@ export const streamNormalInput = createAsyncThunk< next = await gen.next(); } - // Attach prompt log + // Attach prompt log and end thinking for reasoning models if (next.done && next.value) { dispatch(addPromptCompletionPair([next.value]));