diff --git a/gui/src/components/Layout.tsx b/gui/src/components/Layout.tsx index 50be235f7..20a61d8d9 100644 --- a/gui/src/components/Layout.tsx +++ b/gui/src/components/Layout.tsx @@ -157,21 +157,21 @@ const Layout = () => { useWebviewListener( "focusEdit", async () => { - await saveSession(true); + await saveSession(); dispatch(focusEdit()); dispatch(setMode("edit")); }, - [navigate], + [], ); useWebviewListener( "focusEditWithoutClear", async () => { - await saveSession(true); + await saveSession(); dispatch(focusEdit()); dispatch(setMode("edit")); }, - [navigate], + [], ); useWebviewListener( diff --git a/gui/src/components/StepContainer/EditActions.tsx b/gui/src/components/StepContainer/EditActions.tsx index ebb796f2c..55ebcab20 100644 --- a/gui/src/components/StepContainer/EditActions.tsx +++ b/gui/src/components/StepContainer/EditActions.tsx @@ -6,8 +6,6 @@ import { renderChatMessage } from "core/util/messageContent"; import { CopyIconButton } from "../gui/CopyIconButton"; import { useAppDispatch, useAppSelector } from "../../redux/hooks"; import useHistory from "../../hooks/useHistory"; -import { useContext } from "react"; -import { IdeMessengerContext } from "../../context/IdeMessenger"; import { completeEdit } from "../../redux/thunks/completeEdit"; export interface EditActionsProps { diff --git a/gui/src/redux/thunks/cancelTool.ts b/gui/src/redux/thunks/cancelTool.ts index 03b0cc8ef..89c4e8e12 100644 --- a/gui/src/redux/thunks/cancelTool.ts +++ b/gui/src/redux/thunks/cancelTool.ts @@ -1,15 +1,11 @@ import { createAsyncThunk } from "@reduxjs/toolkit"; import { selectCurrentToolCall } from "../selectors/selectCurrentToolCall"; -import { - cancelToolCall, - setCalling, - setToolCallOutput, -} from "../slices/sessionSlice"; +import { cancelToolCall } from "../slices/sessionSlice"; import { ThunkApiType } from "../store"; import { streamResponseAfterToolCall } from "./streamResponseAfterToolCall"; export const cancelTool = createAsyncThunk( - "chat/callTool", + "chat/cancelTool", async (_, { dispatch, extra, getState }) => { const state = getState(); const toolCallState = selectCurrentToolCall(state); @@ -40,39 +36,3 @@ export const cancelTool = createAsyncThunk( ); }, ); - -export const callTool = createAsyncThunk( - "chat/callTool", - async (_, { dispatch, extra, getState }) => { - const state = getState(); - const toolCallState = selectCurrentToolCall(state); - - console.log("calling tool", toolCallState.toolCall); - if (!toolCallState) { - return; - } - - if (toolCallState.status !== "generated") { - return; - } - - dispatch(setCalling()); - - const result = await extra.ideMessenger.request("tools/call", { - toolCall: toolCallState.toolCall, - }); - - if (result.status === "success") { - const contextItems = result.content.contextItems; - dispatch(setToolCallOutput(contextItems)); - - // Send to the LLM to continue the conversation - dispatch( - streamResponseAfterToolCall({ - toolCallId: toolCallState.toolCall.id, - toolOutput: contextItems, - }), - ); - } - }, -);