From a2a8308f3edc7d21eeb4b181ea039c92eb428c34 Mon Sep 17 00:00:00 2001 From: Nate Date: Sat, 15 Feb 2025 13:42:39 -0800 Subject: [PATCH 1/5] remove noisy notification --- core/indexing/docs/DocsService.ts | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/core/indexing/docs/DocsService.ts b/core/indexing/docs/DocsService.ts index ba74b3a01..4d555f557 100644 --- a/core/indexing/docs/DocsService.ts +++ b/core/indexing/docs/DocsService.ts @@ -26,6 +26,8 @@ import { } from "../../util/paths"; import { Telemetry } from "../../util/posthog"; +import { ConfigResult } from "@continuedev/config-yaml"; +import { GlobalContext } from "../../util/GlobalContext"; import { ArticleWithChunks, htmlPageToArticleWithChunks, @@ -40,8 +42,6 @@ import { SiteIndexingResults, } from "./preIndexed"; import preIndexedDocs from "./preIndexedDocs"; -import { ConfigResult } from "@continuedev/config-yaml"; -import { GlobalContext } from "../../util/GlobalContext"; // Purposefully lowercase because lancedb converts export interface LanceDbDocsRow { @@ -436,10 +436,6 @@ export default class DocsService { await provider.embed(["continue-test-run"]); } catch (e) { console.error("Failed to test embeddings connection", e); - void this.ide.showToast( - "error", - "Failed to test embeddings connection. check your embeddings model configuration", - ); return; } From 21414dacc109d12ad7a6264f7bf8a83b868dd5e3 Mon Sep 17 00:00:00 2001 From: Nate Date: Sat, 15 Feb 2025 13:44:58 -0800 Subject: [PATCH 2/5] reload assistants on org switch --- core/config/ConfigHandler.ts | 2 +- core/core.ts | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/core/config/ConfigHandler.ts b/core/config/ConfigHandler.ts index 66b53e30d..d85839f8f 100644 --- a/core/config/ConfigHandler.ts +++ b/core/config/ConfigHandler.ts @@ -138,7 +138,7 @@ export class ConfigHandler { } } - private async loadPlatformProfiles() { + async loadPlatformProfiles() { // Get the profiles and create their lifecycle managers this.controlPlaneClient .listAssistants(this.selectedOrgId) diff --git a/core/core.ts b/core/core.ts index 0d6134737..6bbc34006 100644 --- a/core/core.ts +++ b/core/core.ts @@ -936,6 +936,7 @@ export class Core { on("didChangeSelectedOrg", (msg) => { void this.configHandler.setSelectedOrgId(msg.data.id); void this.configHandler.reloadConfig(); + void this.configHandler.loadPlatformProfiles(); }); on("didChangeControlPlaneSessionInfo", async (msg) => { From 464a15102e19f3a226bd6468a1c170eaf709f888 Mon Sep 17 00:00:00 2001 From: Nate Date: Sat, 15 Feb 2025 13:45:10 -0800 Subject: [PATCH 3/5] refactor reloadHubAssistants --- core/config/ConfigHandler.ts | 37 +++++++++++++++++++----------------- 1 file changed, 20 insertions(+), 17 deletions(-) diff --git a/core/config/ConfigHandler.ts b/core/config/ConfigHandler.ts index d85839f8f..a61f62354 100644 --- a/core/config/ConfigHandler.ts +++ b/core/config/ConfigHandler.ts @@ -229,6 +229,22 @@ export class ConfigHandler { return false; } + private async reloadHubAssistants() { + const newFullSlugsList = + await this.controlPlaneClient.listAssistantFullSlugs(this.selectedOrgId); + + if (newFullSlugsList) { + const shouldReload = this.fullSlugsListsDiffer( + newFullSlugsList, + this.lastFullSlugsList, + ); + if (shouldReload) { + await this.loadPlatformProfiles(); + } + this.lastFullSlugsList = newFullSlugsList; + } + } + private async fetchControlPlaneProfiles() { if (await useHub(this.ideSettingsPromise)) { clearInterval(this.platformProfilesRefreshInterval); @@ -236,23 +252,10 @@ export class ConfigHandler { // Every 5 seconds we ask the platform whether there are any assistant updates in the last 5 seconds // If so, we do the full (more expensive) reload - this.platformProfilesRefreshInterval = setInterval(async () => { - const newFullSlugsList = - await this.controlPlaneClient.listAssistantFullSlugs( - this.selectedOrgId, - ); - - if (newFullSlugsList) { - const shouldReload = this.fullSlugsListsDiffer( - newFullSlugsList, - this.lastFullSlugsList, - ); - if (shouldReload) { - await this.loadPlatformProfiles(); - } - this.lastFullSlugsList = newFullSlugsList; - } - }, PlatformProfileLoader.RELOAD_INTERVAL); + this.platformProfilesRefreshInterval = setInterval( + this.reloadHubAssistants.bind(this), + PlatformProfileLoader.RELOAD_INTERVAL, + ); } else { this.controlPlaneClient .listWorkspaces() From 806f461b990c8310355b43b9c8352528e037cc81 Mon Sep 17 00:00:00 2001 From: Nate Date: Sat, 15 Feb 2025 13:56:47 -0800 Subject: [PATCH 4/5] create your first assistant button --- .../dialogs/FreeTrialOverDialog.tsx | 12 +++--- .../platform/AssistantSelect.tsx | 37 ++++++++++++------- gui/src/pages/gui/Chat.tsx | 10 ++--- gui/src/redux/selectors/index.ts | 2 +- 4 files changed, 36 insertions(+), 25 deletions(-) diff --git a/gui/src/components/dialogs/FreeTrialOverDialog.tsx b/gui/src/components/dialogs/FreeTrialOverDialog.tsx index d8666b1b2..107e351ce 100644 --- a/gui/src/components/dialogs/FreeTrialOverDialog.tsx +++ b/gui/src/components/dialogs/FreeTrialOverDialog.tsx @@ -1,15 +1,15 @@ -import { useDispatch } from "react-redux"; -import { setDialogMessage, setShowDialog } from "../../redux/slices/uiSlice"; -import { useAppSelector } from "../../redux/hooks"; import { useEffect } from "react"; -import { selectUsePlatform } from "../../redux/selectors"; -import { PlatformOnboardingCard } from "../OnboardingCard/platform/PlatformOnboardingCard"; +import { useDispatch } from "react-redux"; +import { useAppSelector } from "../../redux/hooks"; +import { selectUseHub } from "../../redux/selectors"; +import { setDialogMessage, setShowDialog } from "../../redux/slices/uiSlice"; import { OnboardingCard } from "../OnboardingCard"; +import { PlatformOnboardingCard } from "../OnboardingCard/platform/PlatformOnboardingCard"; function FreeTrialOverDialog() { const dispatch = useDispatch(); const history = useAppSelector((store) => store.session.history); - const usePlatform = useAppSelector(selectUsePlatform); + const usePlatform = useAppSelector(selectUseHub); useEffect(() => { if (history.length === 0) { diff --git a/gui/src/components/modelSelection/platform/AssistantSelect.tsx b/gui/src/components/modelSelection/platform/AssistantSelect.tsx index 55e60449d..0d53ce7dc 100644 --- a/gui/src/components/modelSelection/platform/AssistantSelect.tsx +++ b/gui/src/components/modelSelection/platform/AssistantSelect.tsx @@ -1,23 +1,21 @@ import { Popover } from "@headlessui/react"; -import { ChevronDownIcon } from "@heroicons/react/24/outline"; -import { useEffect, useRef } from "react"; +import { ChevronDownIcon, PlusIcon } from "@heroicons/react/24/outline"; +import { useContext, useEffect, useRef } from "react"; import { useAuth } from "../../../context/Auth"; +import { IdeMessengerContext } from "../../../context/IdeMessenger"; import { useAppDispatch } from "../../../redux/hooks"; -import { - getFontSize, - isLocalProfile, - isMetaEquivalentKeyPressed, -} from "../../../util"; -import PopoverTransition from "../../mainInput/InputToolbar/PopoverTransition"; -import { AssistantSelectOptions } from "./AssistantSelectOptions"; -import AssistantIcon from "./AssistantIcon"; -import { getProfileDisplayText } from "./utils"; import { cycleProfile } from "../../../redux/thunks/profileAndOrg"; +import { getFontSize, isMetaEquivalentKeyPressed } from "../../../util"; +import PopoverTransition from "../../mainInput/InputToolbar/PopoverTransition"; +import AssistantIcon from "./AssistantIcon"; +import { AssistantSelectOptions } from "./AssistantSelectOptions"; +import { getProfileDisplayText } from "./utils"; export default function AssistantSelect() { const dispatch = useAppDispatch(); const buttonRef = useRef(null); - const { selectedProfile } = useAuth(); + const { selectedProfile, selectedOrganization } = useAuth(); + const ideMessenger = useContext(IdeMessengerContext); useEffect(() => { let lastToggleTime = 0; @@ -45,7 +43,20 @@ export default function AssistantSelect() { }, []); if (!selectedProfile) { - return null; + return ( +
{ + ideMessenger.request("controlPlane/openUrl", { + path: "/new?type=assistant", + orgSlug: selectedOrganization?.slug, + }); + }} + className="text-lightgray hover:bg mb-1 mr-3 flex cursor-pointer items-center gap-1" + style={{ fontSize: `${getFontSize() - 2}px` }} + > + Create your first assistant +
+ ); } return ( diff --git a/gui/src/pages/gui/Chat.tsx b/gui/src/pages/gui/Chat.tsx index 227eb1154..55027c041 100644 --- a/gui/src/pages/gui/Chat.tsx +++ b/gui/src/pages/gui/Chat.tsx @@ -42,7 +42,7 @@ import { IdeMessengerContext } from "../../context/IdeMessenger"; import { useTutorialCard } from "../../hooks/useTutorialCard"; import { useWebviewListener } from "../../hooks/useWebviewListener"; import { useAppDispatch, useAppSelector } from "../../redux/hooks"; -import { selectUsePlatform } from "../../redux/selectors"; +import { selectUseHub } from "../../redux/selectors"; import { selectCurrentToolCall } from "../../redux/selectors/selectCurrentToolCall"; import { selectDefaultModel } from "../../redux/slices/configSlice"; import { submitEdit } from "../../redux/slices/editModeState"; @@ -222,7 +222,7 @@ export function Chat() { selectIsSingleRangeEditOrInsertion, ); const lastSessionId = useAppSelector((state) => state.session.lastSessionId); - const usePlatform = useAppSelector(selectUsePlatform); + const useHub = useAppSelector(selectUseHub); useEffect(() => { // Cmd + Backspace to delete current step @@ -365,7 +365,7 @@ export function Chat() { useAutoScroll(stepsDivRef, history); - const showPageHeader = isInEditMode || usePlatform; + const showPageHeader = isInEditMode || useHub; return ( <> @@ -382,7 +382,7 @@ export function Chat() { } : undefined } - rightContent={usePlatform && } + rightContent={useHub && } /> )} @@ -567,7 +567,7 @@ export function Chat() { <> {onboardingCard.show && (
- {usePlatform ? ( + {useHub ? ( ) : ( diff --git a/gui/src/redux/selectors/index.ts b/gui/src/redux/selectors/index.ts index 737e865d3..2097dbce8 100644 --- a/gui/src/redux/selectors/index.ts +++ b/gui/src/redux/selectors/index.ts @@ -43,7 +43,7 @@ export const selectUseActiveFile = createSelector( (defaultContext) => defaultContext?.includes("activeFile" as any), ); -export const selectUsePlatform = createSelector( +export const selectUseHub = createSelector( [(state: RootState) => state.config.config.usePlatform], (usePlatform) => usePlatform, ); From abf6cec08aedb170f4a85818f39d808e198c8f43 Mon Sep 17 00:00:00 2001 From: Nate Date: Sat, 15 Feb 2025 13:57:41 -0800 Subject: [PATCH 5/5] bump version --- extensions/vscode/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/extensions/vscode/package.json b/extensions/vscode/package.json index 1eb040f8d..65f55c990 100644 --- a/extensions/vscode/package.json +++ b/extensions/vscode/package.json @@ -2,7 +2,7 @@ "name": "continue", "icon": "media/icon.png", "author": "Continue Dev, Inc", - "version": "0.9.267", + "version": "0.9.268", "repository": { "type": "git", "url": "https://github.com/continuedev/continue"