From eb7e80bdfb1cbe390fe38dc477ad3824b0c9b0ca Mon Sep 17 00:00:00 2001 From: Nate Date: Mon, 9 Jun 2025 23:32:28 -0700 Subject: [PATCH 001/108] telemetry for stream_error --- gui/src/pages/gui/StreamError.tsx | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/gui/src/pages/gui/StreamError.tsx b/gui/src/pages/gui/StreamError.tsx index 580cbd3c0..1bd5101b6 100644 --- a/gui/src/pages/gui/StreamError.tsx +++ b/gui/src/pages/gui/StreamError.tsx @@ -6,7 +6,8 @@ import { KeyIcon, } from "@heroicons/react/24/outline"; import { DISCORD_LINK, GITHUB_LINK } from "core/util/constants"; -import { useContext, useMemo } from "react"; +import posthog from "posthog-js"; +import { useContext, useEffect, useMemo } from "react"; import { GhostButton, SecondaryButton } from "../../components"; import { useMainEditor } from "../../components/mainInput/TipTapEditor"; import { DiscordIcon } from "../../components/svg/DiscordIcon"; @@ -111,6 +112,20 @@ const StreamErrorDialog = ({ error }: StreamErrorProps) => { } } + // Capture error event with PostHog + useEffect(() => { + if (error) { + const errorData = { + error_type: statusCode ? `HTTP ${statusCode}` : "Unknown", + error_message: parsedError, + model_provider: providerName, + model_title: modelTitle, + }; + + posthog.capture("gui_stream_error", errorData); + } + }, [error, parsedError, statusCode, providerName, modelTitle]); + const checkKeysButton = apiKeyUrl ? ( Date: Wed, 18 Jun 2025 21:56:24 -0500 Subject: [PATCH 002/108] fix(autocomplete): trim trailing <|file_separator|> for Gemini/Gemma models Google Gemini/Gemma models sometimes append "<|file_separator|>" at the end of autocomplete completions, forcing users to remove it manually. Update postprocessCompletion to detect when llm.model includes "gemini" or "gemma" and the completion ends with "<|file_separator|>", then slice off the trailing 18 characters. See #6067 --- core/autocomplete/postprocessing/index.ts | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/core/autocomplete/postprocessing/index.ts b/core/autocomplete/postprocessing/index.ts index bf0284cb2..3504a069d 100644 --- a/core/autocomplete/postprocessing/index.ts +++ b/core/autocomplete/postprocessing/index.ts @@ -132,6 +132,14 @@ export function postprocessCompletion({ completion = "\n" + completion; } + if ( + (llm.model.includes("gemini") || llm.model.includes("gemma")) && + completion.endsWith("<|file_separator|>") + ) { + // "<|file_separator|>" is 18 characters long + completion = completion.slice(0, -18); + } + // If prefix ends with space and so does completion, then remove the space from completion if (prefix.endsWith(" ") && completion.startsWith(" ")) { From f637e1d5d4a3ccce111daf7af5043d2cc2b52b71 Mon Sep 17 00:00:00 2001 From: Nate Date: Thu, 26 Jun 2025 21:20:51 -0700 Subject: [PATCH 003/108] remove dead code Footer --- gui/src/components/Footer.tsx | 21 --------------------- gui/src/components/Layout.tsx | 2 -- 2 files changed, 23 deletions(-) delete mode 100644 gui/src/components/Footer.tsx diff --git a/gui/src/components/Footer.tsx b/gui/src/components/Footer.tsx deleted file mode 100644 index 35fe7fa56..000000000 --- a/gui/src/components/Footer.tsx +++ /dev/null @@ -1,21 +0,0 @@ -import { useAppSelector } from "../redux/hooks"; -import { selectSelectedChatModel } from "../redux/slices/configSlice"; - -function Footer() { - const defaultModel = useAppSelector(selectSelectedChatModel); - - // TODO hook hub up to free trial - // if (defaultModel?.provider === "free-trial") { - // return ( - //
- // - //
- // ); - // } - return null; -} - -export default Footer; diff --git a/gui/src/components/Layout.tsx b/gui/src/components/Layout.tsx index 1e2134e7a..cb0738314 100644 --- a/gui/src/components/Layout.tsx +++ b/gui/src/components/Layout.tsx @@ -17,7 +17,6 @@ import { incrementFreeTrialCount } from "../util/freeTrial"; import { ROUTES } from "../util/navigation"; import { FatalErrorIndicator } from "./config/FatalErrorNotice"; import TextDialog from "./dialogs"; -import Footer from "./Footer"; import { LumpProvider } from "./mainInput/Lump/LumpContext"; import { useMainEditor } from "./mainInput/TipTapEditor"; import { @@ -252,7 +251,6 @@ const Layout = () => { -