diff --git a/core/llm/llms/Anthropic.ts b/core/llm/llms/Anthropic.ts index d6569af8f..b3a099a81 100644 --- a/core/llm/llms/Anthropic.ts +++ b/core/llm/llms/Anthropic.ts @@ -4,7 +4,7 @@ import { LLMOptions, ModelProvider, } from "../../index.js"; -import { renderChatMessage } from "../../util/messageContent.js"; +import { renderChatMessage, stripImages } from "../../util/messageContent.js"; import { BaseLLM } from "../index.js"; import { streamSse } from "../stream.js"; @@ -146,8 +146,9 @@ class Anthropic extends BaseLLM { ): AsyncGenerator { const shouldCacheSystemMessage = !!this.systemMessage && this.cacheBehavior?.cacheSystemMessage; - const systemMessage: string = - messages.filter((m) => m.role === "system")[0]?.content ?? ""; + const systemMessage: string = stripImages( + messages.filter((m) => m.role === "system")[0]?.content ?? "", + ); const msgs = this.convertMessages(messages); const response = await this.fetch(new URL("messages", this.apiBase), { diff --git a/extensions/vscode/package-lock.json b/extensions/vscode/package-lock.json index 31c9a041c..046b4f398 100644 --- a/extensions/vscode/package-lock.json +++ b/extensions/vscode/package-lock.json @@ -1,12 +1,12 @@ { "name": "continue", - "version": "0.9.232", + "version": "0.9.233", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "continue", - "version": "0.9.232", + "version": "0.9.233", "license": "Apache-2.0", "dependencies": { "@electron/rebuild": "^3.2.10", @@ -109,7 +109,7 @@ "cheerio": "^1.0.0-rc.12", "commander": "^12.0.0", "comment-json": "^4.2.3", - "dbinfoz": "^0.11.0", + "dbinfoz": "^0.14.0", "diff": "^7.0.0", "dotenv": "^16.4.5", "fastest-levenshtein": "^1.0.16", diff --git a/gui/package-lock.json b/gui/package-lock.json index 2f64dad52..107360d04 100644 --- a/gui/package-lock.json +++ b/gui/package-lock.json @@ -56,7 +56,6 @@ "socket.io-client": "^4.7.2", "styled-components": "^5.3.6", "table": "^6.8.1", - "tailwind-scrollbar-hide": "^1.1.7", "tippy.js": "^6.3.7", "unist-util-visit": "^5.0.0", "uuid": "^9.0.1", @@ -112,7 +111,7 @@ "cheerio": "^1.0.0-rc.12", "commander": "^12.0.0", "comment-json": "^4.2.3", - "dbinfoz": "^0.11.0", + "dbinfoz": "^0.14.0", "diff": "^7.0.0", "dotenv": "^16.4.5", "fastest-levenshtein": "^1.0.16", @@ -8985,11 +8984,6 @@ "node": ">=10.0.0" } }, - "node_modules/tailwind-scrollbar-hide": { - "version": "1.1.7", - "resolved": "https://registry.npmjs.org/tailwind-scrollbar-hide/-/tailwind-scrollbar-hide-1.1.7.tgz", - "integrity": "sha512-X324n9OtpTmOMqEgDUEA/RgLrNfBF/jwJdctaPZDzB3mppxJk7TLIDmOreEDm1Bq4R9LSPu4Epf8VSdovNU+iA==" - }, "node_modules/tailwindcss": { "version": "3.4.12", "resolved": "https://registry.npmjs.org/tailwindcss/-/tailwindcss-3.4.12.tgz", diff --git a/gui/src/App.tsx b/gui/src/App.tsx index 1e34e6e15..0c3f81ada 100644 --- a/gui/src/App.tsx +++ b/gui/src/App.tsx @@ -8,7 +8,6 @@ import useSubmenuContextProviders from "./hooks/useSubmenuContextProviders"; import { useVscTheme } from "./hooks/useVscTheme"; import { AddNewModel, ConfigureProvider } from "./pages/AddNewModel"; import ConfigErrorPage from "./pages/config-error"; -import Edit from "./pages/Edit"; import ErrorPage from "./pages/error"; import Chat from "./pages/gui"; import History from "./pages/history"; @@ -33,10 +32,6 @@ const router = createMemoryRouter([ path: "/", element: , }, - { - path: "/edit", - element: , - }, { path: "/history", element: , diff --git a/gui/src/hooks/useChatHandler.ts b/gui/src/hooks/useChatHandler.ts index cf5aa39a2..45b391233 100644 --- a/gui/src/hooks/useChatHandler.ts +++ b/gui/src/hooks/useChatHandler.ts @@ -30,7 +30,7 @@ import { abortStream, acceptToolCall, addPromptCompletionPair, - clearLastResponse, + clearLastEmptyResponse, initNewActiveMessage, resetNextCodeBlockToApplyIndex, resubmitAtIndex, @@ -38,13 +38,12 @@ import { setCurCheckpointIndex, setInactive, setIsGatheringContext, - setIsInMultifileEdit, setMessageAtIndex, streamUpdate, } from "../redux/slices/stateSlice"; import { RootState } from "../redux/store"; -import useHistory from "./useHistory"; import { updateFileSymbolsFromContextItems } from "../util/symbols"; +import useHistory from "./useHistory"; function useChatHandler(dispatch: Dispatch, ideMessenger: IIdeMessenger) { const posthog = usePostHog(); @@ -103,7 +102,7 @@ function useChatHandler(dispatch: Dispatch, ideMessenger: IIdeMessenger) { } } catch (e) { // If there's an error, we should clear the response so there aren't two input boxes - dispatch(clearLastResponse()); + dispatch(clearLastEmptyResponse()); } } @@ -352,9 +351,9 @@ function useChatHandler(dispatch: Dispatch, ideMessenger: IIdeMessenger) { params: {}, }); - if (slashCommand.name === "multifile-edit") { - dispatch(setIsInMultifileEdit(true)); - } + // if (slashCommand.name === "multifile-edit") { + // dispatch(setIsInMultifileEdit(true)); + // } await _streamSlashCommand( messages, diff --git a/gui/src/pages/Edit/Edit.tsx b/gui/src/pages/Edit/Edit.tsx index c69200bc1..c5ef23731 100644 --- a/gui/src/pages/Edit/Edit.tsx +++ b/gui/src/pages/Edit/Edit.tsx @@ -1,14 +1,18 @@ import { ArrowLeftIcon } from "@heroicons/react/24/outline"; import { Editor, JSONContent } from "@tiptap/core"; import { InputModifiers, RangeInFileWithContents } from "core"; -import { stripImages } from "core/llm/images"; +import { stripImages } from "core/util/messageContent"; import { useCallback, useContext, useEffect } from "react"; import { useDispatch, useSelector } from "react-redux"; import { useNavigate } from "react-router-dom"; +import ContinueInputBox from "../../components/mainInput/ContinueInputBox"; import { NewSessionButton } from "../../components/mainInput/NewSessionButton"; import resolveEditorContent from "../../components/mainInput/resolveInput"; import TipTapEditor from "../../components/mainInput/TipTapEditor"; +import StepContainer from "../../components/StepContainer"; +import AcceptRejectAllButtons from "../../components/StepContainer/AcceptRejectAllButtons"; import { IdeMessengerContext } from "../../context/IdeMessenger"; +import useChatHandler from "../../hooks/useChatHandler"; import { clearCodeToEdit, setEditDone, @@ -16,10 +20,6 @@ import { } from "../../redux/slices/editModeState"; import { RootState } from "../../redux/store"; import CodeToEdit from "./CodeToEdit"; -import useChatHandler from "../../hooks/useChatHandler"; -import AcceptRejectAllButtons from "../../components/StepContainer/AcceptRejectAllButtons"; -import ContinueInputBox from "../../components/mainInput/ContinueInputBox"; -import StepContainer from "../../components/StepContainer"; import getMultifileEditPrompt from "./getMultifileEditPrompt"; const EDIT_DISALLOWED_CONTEXT_PROVIDERS = [ diff --git a/gui/src/pages/gui/ToolCallDiv/ToolOutput.tsx b/gui/src/pages/gui/ToolCallDiv/ToolOutput.tsx index 0e6c6b245..44a3d4d08 100644 --- a/gui/src/pages/gui/ToolCallDiv/ToolOutput.tsx +++ b/gui/src/pages/gui/ToolCallDiv/ToolOutput.tsx @@ -16,7 +16,7 @@ function ToolOutput(props: ToolOutputProps) { return (