From c2fa11dd98444dd277852d87f07c5ac745b53e97 Mon Sep 17 00:00:00 2001 From: Nate Date: Sat, 17 May 2025 21:28:34 -0700 Subject: [PATCH 1/4] remove unused ControlPlaneClient methods --- core/control-plane/client.ts | 28 ---------------------------- 1 file changed, 28 deletions(-) diff --git a/core/control-plane/client.ts b/core/control-plane/client.ts index 77a3dc108..9fab604d4 100644 --- a/core/control-plane/client.ts +++ b/core/control-plane/client.ts @@ -99,22 +99,6 @@ export class ControlPlaneClient { return resp; } - public async listWorkspaces(): Promise { - const userId = await this.userId; - if (!userId) { - return []; - } - - try { - const resp = await this.request("workspaces", { - method: "GET", - }); - return (await resp.json()) as any; - } catch (e) { - return []; - } - } - public async listAssistants(organizationId: string | null): Promise< { configResult: ConfigResult; @@ -183,16 +167,4 @@ export class ControlPlaneClient { return null; } } - - async getSettingsForWorkspace(workspaceId: string): Promise { - const userId = await this.userId; - if (!userId) { - throw new Error("No user id"); - } - - const resp = await this.request(`workspaces/${workspaceId}`, { - method: "GET", - }); - return ((await resp.json()) as any).settings; - } } From 3b2ef40e4532573df3d76c810f845087669f632a Mon Sep 17 00:00:00 2001 From: Nate Date: Sun, 18 May 2025 16:37:29 -0700 Subject: [PATCH 2/4] separate type for custom environments --- core/control-plane/auth/index.ts | 7 ++- core/control-plane/env.ts | 19 +++++++- .../vscode/src/stubs/WorkOsAuthProvider.ts | 45 ++++++++++++++++--- 3 files changed, 62 insertions(+), 9 deletions(-) diff --git a/core/control-plane/auth/index.ts b/core/control-plane/auth/index.ts index a3441ab65..2bb7f5daf 100644 --- a/core/control-plane/auth/index.ts +++ b/core/control-plane/auth/index.ts @@ -1,12 +1,17 @@ import { v4 as uuidv4 } from "uuid"; import { IdeSettings } from "../.."; -import { getControlPlaneEnv } from "../env"; +import { getControlPlaneEnv, isHubEnv } from "../env"; export async function getAuthUrlForTokenPage( ideSettingsPromise: Promise, useOnboarding: boolean, ): Promise { const env = await getControlPlaneEnv(ideSettingsPromise); + + if (!isHubEnv(env)) { + throw new Error("Sign in disabled"); + } + const url = new URL("https://api.workos.com/user_management/authorize"); const params = { response_type: "code", diff --git a/core/control-plane/env.ts b/core/control-plane/env.ts index acbc20b59..835fa63c7 100644 --- a/core/control-plane/env.ts +++ b/core/control-plane/env.ts @@ -5,7 +5,7 @@ import { getStagingEnvironmentDotFilePath, } from "../util/paths"; -export interface ControlPlaneEnv { +export interface HubEnv { DEFAULT_CONTROL_PLANE_PROXY_URL: string; CONTROL_PLANE_URL: string; AUTH_TYPE: string; @@ -13,6 +13,23 @@ export interface ControlPlaneEnv { APP_URL: string; } +export interface OnPremEnv { + AUTH_TYPE: "on-prem"; + DEFAULT_CONTROL_PLANE_PROXY_URL: string; + CONTROL_PLANE_URL: string; + APP_URL: string; +} + +export type ControlPlaneEnv = HubEnv | OnPremEnv; + +export function isHubEnv(env: ControlPlaneEnv): env is HubEnv { + return ( + "AUTH_TYPE" in env && + env.AUTH_TYPE !== "on-prem" && + "WORKOS_CLIENT_ID" in env + ); +} + export const EXTENSION_NAME = "continue"; const WORKOS_CLIENT_ID_PRODUCTION = "client_01J0FW6XN8N2XJAECF7NE0Y65J"; diff --git a/extensions/vscode/src/stubs/WorkOsAuthProvider.ts b/extensions/vscode/src/stubs/WorkOsAuthProvider.ts index 2e6acfb86..8da93fe9c 100644 --- a/extensions/vscode/src/stubs/WorkOsAuthProvider.ts +++ b/extensions/vscode/src/stubs/WorkOsAuthProvider.ts @@ -1,7 +1,11 @@ import crypto from "crypto"; import { ControlPlaneSessionInfo } from "core/control-plane/client"; -import { getControlPlaneEnvSync } from "core/control-plane/env"; +import { + getControlPlaneEnvSync, + HubEnv, + isHubEnv, +} from "core/control-plane/env"; import fetch from "node-fetch"; import { v4 as uuidv4 } from "uuid"; import { @@ -280,12 +284,21 @@ export class WorkOsAuthProvider implements AuthenticationProvider, Disposable { try { const codeVerifier = generateRandomString(64); const codeChallenge = await generateCodeChallenge(codeVerifier); - const token = await this.login(codeChallenge, scopes); + + if (!isHubEnv(controlPlaneEnv)) { + throw new Error("Login is disabled"); + } + + const token = await this.login(codeChallenge, controlPlaneEnv, scopes); if (!token) { throw new Error(`Continue login failure`); } - const userInfo = (await this.getUserInfo(token, codeVerifier)) as any; + const userInfo = (await this.getUserInfo( + token, + codeVerifier, + controlPlaneEnv, + )) as any; const { user, access_token, refresh_token } = userInfo; const session: ContinueAuthenticationSession = { @@ -352,7 +365,11 @@ export class WorkOsAuthProvider implements AuthenticationProvider, Disposable { /** * Log in to Continue */ - private async login(codeChallenge: string, scopes: string[] = []) { + private async login( + codeChallenge: string, + hubEnv: HubEnv, + scopes: string[] = [], + ) { return await window.withProgress( { location: ProgressLocation.Notification, @@ -369,7 +386,7 @@ export class WorkOsAuthProvider implements AuthenticationProvider, Disposable { const url = new URL("https://api.workos.com/user_management/authorize"); const params = { response_type: "code", - client_id: controlPlaneEnv.WORKOS_CLIENT_ID, + client_id: hubEnv.WORKOS_CLIENT_ID, redirect_uri: this.redirectUri, state: stateId, code_challenge: codeChallenge, @@ -458,7 +475,11 @@ export class WorkOsAuthProvider implements AuthenticationProvider, Disposable { * @param token * @returns */ - private async getUserInfo(token: string, codeVerifier: string) { + private async getUserInfo( + token: string, + codeVerifier: string, + hubEnv: HubEnv, + ) { const resp = await fetch( "https://api.workos.com/user_management/authenticate", { @@ -467,7 +488,7 @@ export class WorkOsAuthProvider implements AuthenticationProvider, Disposable { "Content-Type": "application/json", }, body: JSON.stringify({ - client_id: controlPlaneEnv.WORKOS_CLIENT_ID, + client_id: hubEnv.WORKOS_CLIENT_ID, code_verifier: codeVerifier, grant_type: "authorization_code", code: token, @@ -484,6 +505,16 @@ export async function getControlPlaneSessionInfo( silent: boolean, useOnboarding: boolean, ): Promise { + if (!isHubEnv(controlPlaneEnv)) { + return { + accessToken: "", // TODO: Could make a discriminated union type instead of doing this + account: { + id: "", + label: "", + }, + }; + } + try { if (useOnboarding) { WorkOsAuthProvider.useOnboardingUri = true; From 8f0978a5e129a73bb01b0fc140c0717036c6e40e Mon Sep 17 00:00:00 2001 From: Nate Date: Sun, 18 May 2025 18:14:50 -0700 Subject: [PATCH 3/4] separate SessionInfo types --- core/config/ConfigHandler.ts | 14 ++--- core/control-plane/AuthTypes.ts | 55 +++++++++++++++++++ core/control-plane/auth/index.ts | 3 +- core/control-plane/client.ts | 41 ++++++-------- core/control-plane/env.ts | 37 ++----------- core/protocol/core.ts | 2 +- core/protocol/ide.ts | 5 +- core/protocol/webview.ts | 2 +- .../vscode/src/stubs/WorkOsAuthProvider.ts | 20 +++---- gui/src/context/Auth.tsx | 2 +- gui/src/context/MockIdeMessenger.ts | 2 + gui/src/pages/config/AccountButton.tsx | 6 ++ 12 files changed, 108 insertions(+), 81 deletions(-) create mode 100644 core/control-plane/AuthTypes.ts diff --git a/core/config/ConfigHandler.ts b/core/config/ConfigHandler.ts index 76ccceb81..ff3228287 100644 --- a/core/config/ConfigHandler.ts +++ b/core/config/ConfigHandler.ts @@ -1,10 +1,6 @@ import { ConfigResult } from "@continuedev/config-yaml"; -import { - ControlPlaneClient, - ControlPlaneSessionInfo, -} from "../control-plane/client.js"; -import { getControlPlaneEnv } from "../control-plane/env.js"; +import { ControlPlaneClient } from "../control-plane/client.js"; import { BrowserSerializedContinueConfig, ContinueConfig, @@ -15,6 +11,11 @@ import { } from "../index.js"; import { GlobalContext } from "../util/GlobalContext.js"; +import { + AuthType, + ControlPlaneSessionInfo, +} from "../control-plane/AuthTypes.js"; +import { getControlPlaneEnv } from "../control-plane/env.js"; import { logger } from "../util/logger.js"; import { ASSISTANTS, @@ -136,8 +137,7 @@ export class ConfigHandler { } private async getOrgs(): Promise { - const userId = await this.controlPlaneClient.userId; - if (userId) { + if (await this.controlPlaneClient.isSignedIn()) { const orgDescs = await this.controlPlaneClient.listOrganizations(); const personalHubOrg = await this.getPersonalHubOrg(); const hubOrgs = await Promise.all( diff --git a/core/control-plane/AuthTypes.ts b/core/control-plane/AuthTypes.ts new file mode 100644 index 000000000..c926efac1 --- /dev/null +++ b/core/control-plane/AuthTypes.ts @@ -0,0 +1,55 @@ +export interface HubSessionInfo { + AUTH_TYPE: AuthType.WorkOsProd | AuthType.WorkOsStaging; + accessToken: string; + account: { + label: string; + id: string; + }; +} + +export interface OnPremSessionInfo { + AUTH_TYPE: AuthType.OnPrem; +} + +export type ControlPlaneSessionInfo = HubSessionInfo | OnPremSessionInfo; + +export function isHubSession( + sessionInfo: ControlPlaneSessionInfo | undefined, +): sessionInfo is HubSessionInfo { + return ( + sessionInfo !== undefined && + (sessionInfo.AUTH_TYPE === AuthType.WorkOsProd || + sessionInfo.AUTH_TYPE === AuthType.WorkOsStaging) + ); +} + +export enum AuthType { + WorkOsProd = "continue", + WorkOsStaging = "continue-staging", + OnPrem = "on-prem", +} + +export interface HubEnv { + DEFAULT_CONTROL_PLANE_PROXY_URL: string; + CONTROL_PLANE_URL: string; + AUTH_TYPE: AuthType.WorkOsProd | AuthType.WorkOsStaging; + WORKOS_CLIENT_ID: string; + APP_URL: string; +} + +export interface OnPremEnv { + AUTH_TYPE: AuthType.OnPrem; + DEFAULT_CONTROL_PLANE_PROXY_URL: string; + CONTROL_PLANE_URL: string; + APP_URL: string; +} + +export type ControlPlaneEnv = HubEnv | OnPremEnv; + +export function isHubEnv(env: ControlPlaneEnv): env is HubEnv { + return ( + "AUTH_TYPE" in env && + env.AUTH_TYPE !== "on-prem" && + "WORKOS_CLIENT_ID" in env + ); +} diff --git a/core/control-plane/auth/index.ts b/core/control-plane/auth/index.ts index 2bb7f5daf..5e8748ab9 100644 --- a/core/control-plane/auth/index.ts +++ b/core/control-plane/auth/index.ts @@ -1,6 +1,7 @@ import { v4 as uuidv4 } from "uuid"; import { IdeSettings } from "../.."; -import { getControlPlaneEnv, isHubEnv } from "../env"; +import { isHubEnv } from "../AuthTypes"; +import { getControlPlaneEnv } from "../env"; export async function getAuthUrlForTokenPage( ideSettingsPromise: Promise, diff --git a/core/control-plane/client.ts b/core/control-plane/client.ts index 9fab604d4..914ada0ba 100644 --- a/core/control-plane/client.ts +++ b/core/control-plane/client.ts @@ -12,16 +12,9 @@ import fetch, { RequestInit, Response } from "node-fetch"; import { OrganizationDescription } from "../config/ProfileLifecycleManager.js"; import { IdeSettings, ModelDescription } from "../index.js"; +import { ControlPlaneSessionInfo, isHubSession } from "./AuthTypes.js"; import { getControlPlaneEnv } from "./env.js"; -export interface ControlPlaneSessionInfo { - accessToken: string; - account: { - label: string; - id: string; - }; -} - export interface ControlPlaneWorkspace { id: string; name: string; @@ -45,8 +38,7 @@ export class ControlPlaneClient { fqsns: FQSN[], orgScopeId: string | null, ): Promise<(SecretResult | undefined)[]> { - const userId = await this.userId; - if (!userId) { + if (!this.isSignedIn()) { return fqsns.map((fqsn) => ({ found: false, fqsn, @@ -64,19 +56,24 @@ export class ControlPlaneClient { return (await resp.json()) as any; } - get userId(): Promise { - return this.sessionInfoPromise.then( - (sessionInfo) => sessionInfo?.account.id, - ); + async isSignedIn(): Promise { + const sessionInfo = await this.sessionInfoPromise; + return !!sessionInfo; } async getAccessToken(): Promise { - return (await this.sessionInfoPromise)?.accessToken; + const sessionInfo = await this.sessionInfoPromise; + return isHubSession(sessionInfo) ? sessionInfo.accessToken : undefined; } private async request(path: string, init: RequestInit): Promise { - const accessToken = await this.getAccessToken(); - if (!accessToken) { + const sessionInfo = await this.sessionInfoPromise; + const hubSession = isHubSession(sessionInfo); + + const accessToken = hubSession ? sessionInfo.accessToken : undefined; + + // Bearer token not necessary for on-prem auth type + if (!accessToken && hubSession) { throw new Error("No access token"); } @@ -108,8 +105,7 @@ export class ControlPlaneClient { rawYaml: string; }[] > { - const userId = await this.userId; - if (!userId) { + if (!this.isSignedIn()) { return []; } @@ -128,9 +124,7 @@ export class ControlPlaneClient { } public async listOrganizations(): Promise> { - const userId = await this.userId; - - if (!userId) { + if (!this.isSignedIn()) { return []; } @@ -148,8 +142,7 @@ export class ControlPlaneClient { public async listAssistantFullSlugs( organizationId: string | null, ): Promise { - const userId = await this.userId; - if (!userId) { + if (!this.isSignedIn()) { return null; } diff --git a/core/control-plane/env.ts b/core/control-plane/env.ts index 835fa63c7..c04f90d1b 100644 --- a/core/control-plane/env.ts +++ b/core/control-plane/env.ts @@ -4,44 +4,17 @@ import { getLocalEnvironmentDotFilePath, getStagingEnvironmentDotFilePath, } from "../util/paths"; - -export interface HubEnv { - DEFAULT_CONTROL_PLANE_PROXY_URL: string; - CONTROL_PLANE_URL: string; - AUTH_TYPE: string; - WORKOS_CLIENT_ID: string; - APP_URL: string; -} - -export interface OnPremEnv { - AUTH_TYPE: "on-prem"; - DEFAULT_CONTROL_PLANE_PROXY_URL: string; - CONTROL_PLANE_URL: string; - APP_URL: string; -} - -export type ControlPlaneEnv = HubEnv | OnPremEnv; - -export function isHubEnv(env: ControlPlaneEnv): env is HubEnv { - return ( - "AUTH_TYPE" in env && - env.AUTH_TYPE !== "on-prem" && - "WORKOS_CLIENT_ID" in env - ); -} +import { AuthType, ControlPlaneEnv } from "./AuthTypes"; export const EXTENSION_NAME = "continue"; const WORKOS_CLIENT_ID_PRODUCTION = "client_01J0FW6XN8N2XJAECF7NE0Y65J"; const WORKOS_CLIENT_ID_STAGING = "client_01J0FW6XCPMJMQ3CG51RB4HBZQ"; -const WORKOS_ENV_ID_PRODUCTION = "continue"; -const WORKOS_ENV_ID_STAGING = "continue-staging"; - const PRODUCTION_HUB_ENV: ControlPlaneEnv = { DEFAULT_CONTROL_PLANE_PROXY_URL: "https://api.continue.dev/", CONTROL_PLANE_URL: "https://api.continue.dev/", - AUTH_TYPE: WORKOS_ENV_ID_PRODUCTION, + AUTH_TYPE: AuthType.WorkOsProd, WORKOS_CLIENT_ID: WORKOS_CLIENT_ID_PRODUCTION, APP_URL: "https://hub.continue.dev/", }; @@ -49,7 +22,7 @@ const PRODUCTION_HUB_ENV: ControlPlaneEnv = { const STAGING_ENV: ControlPlaneEnv = { DEFAULT_CONTROL_PLANE_PROXY_URL: "https://api.continue-stage.tools/", CONTROL_PLANE_URL: "https://api.continue-stage.tools/", - AUTH_TYPE: WORKOS_ENV_ID_STAGING, + AUTH_TYPE: AuthType.WorkOsStaging, WORKOS_CLIENT_ID: WORKOS_CLIENT_ID_STAGING, APP_URL: "https://hub.continue-stage.tools/", }; @@ -57,7 +30,7 @@ const STAGING_ENV: ControlPlaneEnv = { const TEST_ENV: ControlPlaneEnv = { DEFAULT_CONTROL_PLANE_PROXY_URL: "https://api-test.continue.dev/", CONTROL_PLANE_URL: "https://api-test.continue.dev/", - AUTH_TYPE: WORKOS_ENV_ID_STAGING, + AUTH_TYPE: AuthType.WorkOsStaging, WORKOS_CLIENT_ID: WORKOS_CLIENT_ID_STAGING, APP_URL: "https://app-test.continue.dev/", }; @@ -65,7 +38,7 @@ const TEST_ENV: ControlPlaneEnv = { const LOCAL_ENV: ControlPlaneEnv = { DEFAULT_CONTROL_PLANE_PROXY_URL: "http://localhost:3001/", CONTROL_PLANE_URL: "http://localhost:3001/", - AUTH_TYPE: WORKOS_ENV_ID_STAGING, + AUTH_TYPE: AuthType.WorkOsStaging, WORKOS_CLIENT_ID: WORKOS_CLIENT_ID_STAGING, APP_URL: "http://localhost:3000/", }; diff --git a/core/protocol/core.ts b/core/protocol/core.ts index ef4cde60b..8936cb3eb 100644 --- a/core/protocol/core.ts +++ b/core/protocol/core.ts @@ -33,7 +33,7 @@ import { ToolCall, } from "../"; import { SerializedOrgWithProfiles } from "../config/ProfileLifecycleManager"; -import { ControlPlaneSessionInfo } from "../control-plane/client"; +import { ControlPlaneSessionInfo } from "../control-plane/AuthTypes"; export type OnboardingModes = "Local" | "Best" | "Custom" | "Quickstart"; diff --git a/core/protocol/ide.ts b/core/protocol/ide.ts index 88e7f779c..324772ace 100644 --- a/core/protocol/ide.ts +++ b/core/protocol/ide.ts @@ -1,5 +1,3 @@ -import { ControlPlaneSessionInfo } from "../control-plane/client"; - import type { ContinueRcJson, DiffLine, @@ -16,6 +14,7 @@ import type { TerminalOptions, Thread, } from "../"; +import { ControlPlaneSessionInfo } from "../control-plane/AuthTypes"; export interface GetGhTokenArgs { force?: boolean; @@ -99,7 +98,7 @@ export type ToIdeFromWebviewOrCoreProtocol = { ControlPlaneSessionInfo | undefined, ]; logoutOfControlPlane: [undefined, void]; - reportError:[any, void]; + reportError: [any, void]; closeSidebar: [undefined, void]; }; diff --git a/core/protocol/webview.ts b/core/protocol/webview.ts index 2e6ec3cff..534517d6f 100644 --- a/core/protocol/webview.ts +++ b/core/protocol/webview.ts @@ -1,6 +1,6 @@ import { ConfigResult } from "@continuedev/config-yaml"; import { SerializedOrgWithProfiles } from "../config/ProfileLifecycleManager.js"; -import { ControlPlaneSessionInfo } from "../control-plane/client.js"; +import { ControlPlaneSessionInfo } from "../control-plane/AuthTypes.js"; import type { BrowserSerializedContinueConfig, ContextItemWithId, diff --git a/extensions/vscode/src/stubs/WorkOsAuthProvider.ts b/extensions/vscode/src/stubs/WorkOsAuthProvider.ts index 8da93fe9c..73f36afdb 100644 --- a/extensions/vscode/src/stubs/WorkOsAuthProvider.ts +++ b/extensions/vscode/src/stubs/WorkOsAuthProvider.ts @@ -1,11 +1,6 @@ import crypto from "crypto"; -import { ControlPlaneSessionInfo } from "core/control-plane/client"; -import { - getControlPlaneEnvSync, - HubEnv, - isHubEnv, -} from "core/control-plane/env"; +import { getControlPlaneEnvSync } from "core/control-plane/env"; import fetch from "node-fetch"; import { v4 as uuidv4 } from "uuid"; import { @@ -22,6 +17,12 @@ import { window, } from "vscode"; +import { + AuthType, + ControlPlaneSessionInfo, + HubEnv, + isHubEnv, +} from "core/control-plane/AuthTypes"; import { PromiseAdapter, promiseFromEvent } from "./promiseUtils"; import { SecretStorage } from "./SecretStorage"; import { UriEventHandler } from "./uriHandler"; @@ -507,11 +508,7 @@ export async function getControlPlaneSessionInfo( ): Promise { if (!isHubEnv(controlPlaneEnv)) { return { - accessToken: "", // TODO: Could make a discriminated union type instead of doing this - account: { - id: "", - label: "", - }, + AUTH_TYPE: AuthType.OnPrem, }; } @@ -529,6 +526,7 @@ export async function getControlPlaneSessionInfo( return undefined; } return { + AUTH_TYPE: controlPlaneEnv.AUTH_TYPE, accessToken: session.accessToken, account: { id: session.account.id, diff --git a/gui/src/context/Auth.tsx b/gui/src/context/Auth.tsx index 47e5845f9..8c928630d 100644 --- a/gui/src/context/Auth.tsx +++ b/gui/src/context/Auth.tsx @@ -2,7 +2,7 @@ import { OrganizationDescription, ProfileDescription, } from "core/config/ProfileLifecycleManager"; -import { ControlPlaneSessionInfo } from "core/control-plane/client"; +import { ControlPlaneSessionInfo } from "core/control-plane/AuthTypes"; import React, { createContext, useCallback, diff --git a/gui/src/context/MockIdeMessenger.ts b/gui/src/context/MockIdeMessenger.ts index 9ce072471..0e92384f1 100644 --- a/gui/src/context/MockIdeMessenger.ts +++ b/gui/src/context/MockIdeMessenger.ts @@ -1,4 +1,5 @@ import { IDE, PromptLog } from "core"; +import { AuthType } from "core/control-plane/AuthTypes"; import { FromIdeProtocol, FromWebviewProtocol, @@ -38,6 +39,7 @@ async function defaultMockHandleMessage( ]); case "getControlPlaneSessionInfo": return returnFor("getControlPlaneSessionInfo", { + AUTH_TYPE: AuthType.WorkOsStaging, accessToken: "", account: { label: "", diff --git a/gui/src/pages/config/AccountButton.tsx b/gui/src/pages/config/AccountButton.tsx index b293de719..2d6d06b4f 100644 --- a/gui/src/pages/config/AccountButton.tsx +++ b/gui/src/pages/config/AccountButton.tsx @@ -1,5 +1,6 @@ import { UserCircleIcon } from "@heroicons/react/24/solid"; +import { isHubSession } from "core/control-plane/AuthTypes"; import { SecondaryButton } from "../../components"; import { Popover, @@ -27,6 +28,11 @@ export function AccountButton() { ); } + // No login button for on-prem deployments + if (!isHubSession(session)) { + return null; + } + return ( {({ close }) => ( From 75608e7cf4b35ceb087b8be341645d4c97505ce4 Mon Sep 17 00:00:00 2001 From: Nate Date: Sun, 18 May 2025 19:37:41 -0700 Subject: [PATCH 4/4] disable local assistants when using on prem deployment --- core/config/ConfigHandler.ts | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/core/config/ConfigHandler.ts b/core/config/ConfigHandler.ts index ff3228287..deae7da38 100644 --- a/core/config/ConfigHandler.ts +++ b/core/config/ConfigHandler.ts @@ -270,6 +270,13 @@ export class ConfigHandler { /** * Users can define as many local assistants as they want in a `.continue/assistants` folder */ + + // Local customization disabled for on-premise deployments + const env = await getControlPlaneEnv(this.ide.getIdeSettings()); + if (env.AUTH_TYPE === AuthType.OnPrem) { + return []; + } + const localProfiles: ProfileLifecycleManager[] = []; if (options.includeGlobal) {