Merge branch 'main' of github.com:continuedev/continue into jacob/con-3358

This commit is contained in:
Jacob Kim 2025-08-12 13:43:11 -07:00
commit 7b50ee3706
36 changed files with 195 additions and 120 deletions

View file

@ -16,7 +16,7 @@ jobs:
contents: write # Needed for creating releases
steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v5
- name: Get version from package.json
id: get_version
@ -45,7 +45,7 @@ jobs:
contents: write # Needed for creating releases
steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v5
with:
fetch-depth: 0

View file

@ -101,7 +101,7 @@ jobs:
contents: read
steps:
- name: Checkout code
uses: actions/checkout@v4
uses: actions/checkout@v5
- name: Setup Node.js
uses: actions/setup-node@v4
@ -134,7 +134,7 @@ jobs:
if: ${{ !github.event.pull_request.draft }}
steps:
- name: Checkout code
uses: actions/checkout@v4
uses: actions/checkout@v5
- name: Check required files
run: |

View file

@ -14,7 +14,7 @@ jobs:
steps:
- name: Checkout repository
uses: actions/checkout@v4
uses: actions/checkout@v5
- name: Setup Node.js
uses: actions/setup-node@v4

View file

@ -56,7 +56,7 @@ jobs:
# steps:
# # 0. Setup git
# - name: Checkout
# uses: actions/checkout@v4
# uses: actions/checkout@v5
# - name: Set up Git
# run: |
@ -102,7 +102,7 @@ jobs:
steps:
# Check out current repository
- name: Fetch Sources
uses: actions/checkout@v4
uses: actions/checkout@v5
with:
ref: ${{ github.event.release.tag_name }}
@ -362,7 +362,7 @@ jobs:
steps:
# 1. Check-out repository
- name: Check-out repository
uses: actions/checkout@v4
uses: actions/checkout@v5
# 2. Install npm dependencies
- name: Use Node.js from .nvmrc
@ -429,7 +429,7 @@ jobs:
steps:
# Check out current repository
- name: Fetch Sources
uses: actions/checkout@v4
uses: actions/checkout@v5
# Set up Java environment for the next steps
- name: Setup Java
@ -482,7 +482,7 @@ jobs:
# Check out current repository
- name: Fetch Sources
uses: actions/checkout@v4
uses: actions/checkout@v5
# Set up Java environment for the next steps
- name: Setup Java
@ -513,7 +513,7 @@ jobs:
# Check out current repository
- name: Fetch Sources
uses: actions/checkout@v4
uses: actions/checkout@v5
# Set up Java environment for the next steps
- name: Setup Java

View file

@ -13,7 +13,7 @@ jobs:
steps:
- name: Checkout repository
uses: actions/checkout@v4
uses: actions/checkout@v5
- name: Check if author is in tier list
id: check-author

View file

@ -18,7 +18,7 @@ jobs:
matrix:
platform: [Linux, macOS]
steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v5
with:
fetch-depth: 2 # Get the last 2 commits to find the merge commit

View file

@ -66,7 +66,7 @@ jobs:
arch: arm64
npm_config_arch: arm64
steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v5
with:
fetch-depth: 0
@ -92,7 +92,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
uses: actions/checkout@v5
with:
fetch-depth: 0 # This ensures all tags are fetched
@ -112,7 +112,7 @@ jobs:
- build
steps:
- name: Checkout
uses: actions/checkout@v4
uses: actions/checkout@v5
- name: Set up Git
run: |
@ -145,7 +145,7 @@ jobs:
steps:
# 0. Setup git
- name: Checkout
uses: actions/checkout@v4
uses: actions/checkout@v5
- name: Set up Git
run: |

View file

@ -24,7 +24,7 @@ jobs:
runner: macos-latest
steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v5
with:
fetch-depth: 0

View file

@ -14,7 +14,7 @@ jobs:
prettier-check:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v5
- uses: actions/setup-node@v4
with:
node-version-file: ".nvmrc"
@ -35,7 +35,7 @@ jobs:
core-checks:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v5
- name: Setup packages
uses: ./.github/actions/setup-packages
- name: Setup core component
@ -71,7 +71,7 @@ jobs:
gui-checks:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v5
- name: Setup packages
uses: ./.github/actions/setup-packages
- name: Setup core component
@ -101,7 +101,7 @@ jobs:
binary-checks:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v5
- name: Setup packages
uses: ./.github/actions/setup-packages
- name: Setup core component
@ -123,7 +123,7 @@ jobs:
vscode-checks:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v5
- name: Setup packages
uses: ./.github/actions/setup-packages
- name: Setup core component
@ -156,7 +156,7 @@ jobs:
outputs:
packages: ${{ steps.get-packages.outputs.packages }}
steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v5
- name: Get package list
id: get-packages
run: |
@ -171,7 +171,7 @@ jobs:
matrix:
package: ${{ fromJson(needs.get-packages-matrix.outputs.packages) }}
steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v5
- name: Setup packages
uses: ./.github/actions/setup-packages
@ -197,7 +197,7 @@ jobs:
outputs:
test_file_matrix: ${{ steps.vscode-get-test-file-matrix.outputs.test_file_matrix }}
steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v5
- uses: actions/setup-node@v4
with:
node-version-file: ".nvmrc"
@ -257,7 +257,7 @@ jobs:
runs-on: ubuntu-latest
timeout-minutes: 15
steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v5
with:
fetch-depth: 0
@ -289,7 +289,7 @@ jobs:
test_file: ${{ fromJson(needs.vscode-get-test-file-matrix.outputs.test_file_matrix) }}
command: ["e2e:ci:run", "e2e:ci:run-yaml"]
steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v5
- name: Run VS Code E2E test
uses: ./.github/actions/run-vscode-e2e-test
with:
@ -303,7 +303,7 @@ jobs:
runs-on: ubuntu-latest
timeout-minutes: 15
steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v5
- name: Run JetBrains tests
uses: ./.github/actions/run-jetbrains-tests
with:

View file

@ -66,7 +66,7 @@ jobs:
arch: arm64
npm_config_arch: arm64
steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v5
with:
fetch-depth: 0
@ -96,7 +96,7 @@ jobs:
- build
steps:
- name: Checkout
uses: actions/checkout@v4
uses: actions/checkout@v5
- name: Set up Git
run: |
@ -131,7 +131,7 @@ jobs:
steps:
# 0. Setup git
- name: Checkout
uses: actions/checkout@v4
uses: actions/checkout@v5
- name: Set up Git
run: |

View file

@ -47,7 +47,7 @@ jobs:
working-directory: ${{ inputs.package-path }}
steps:
- name: Checkout
uses: actions/checkout@v4
uses: actions/checkout@v5
with:
fetch-depth: 0

View file

@ -14,7 +14,7 @@ jobs:
steps:
- name: Checkout deja-view
uses: actions/checkout@v4
uses: actions/checkout@v5
with:
repository: 'bdougie/deja-view'
# Option 1: Pin to specific commit (most secure)

View file

@ -12,7 +12,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout sources
uses: actions/checkout@v4
uses: actions/checkout@v5
- name: Setup Java
uses: actions/setup-java@v4
with:

View file

@ -12,7 +12,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
uses: actions/checkout@v5
with:
fetch-depth: 0 # Fetch all history and tags

View file

@ -17,6 +17,7 @@ import {
ControlPlaneSessionInfo,
} from "../control-plane/AuthTypes.js";
import { getControlPlaneEnv } from "../control-plane/env.js";
import { PolicySingleton } from "../control-plane/PolicySingleton.js";
import { logger } from "../util/logger.js";
import { Telemetry } from "../util/posthog.js";
import {
@ -45,7 +46,7 @@ export class ConfigHandler {
private organizations: OrgWithProfiles[] = [];
currentProfile: ProfileLifecycleManager | null;
currentOrg: OrgWithProfiles;
currentOrg: OrgWithProfiles | null;
totalConfigReloads: number = 0;
public isInitialized: Promise<void>;
@ -83,16 +84,9 @@ export class ConfigHandler {
this.ide,
);
// Just to be safe, always force a default personal org with local profile manager
this.currentProfile = this.globalLocalProfileManager;
const personalOrg: OrgWithProfiles = {
currentProfile: this.globalLocalProfileManager,
profiles: [this.globalLocalProfileManager],
...this.PERSONAL_ORG_DESC,
};
this.currentOrg = personalOrg;
this.organizations = [personalOrg];
this.currentOrg = null;
this.currentProfile = null;
this.organizations = [];
this.initter = new EventEmitter();
this.isInitialized = new Promise((resolve) => {
@ -132,10 +126,10 @@ export class ConfigHandler {
const firstNonPersonal = orgs.find(
(org) => org.id !== this.PERSONAL_ORG_DESC.id,
);
const fallback = firstNonPersonal ?? orgs[0];
// note, ignoring case of zero orgs since should never happen
const fallback: OrgWithProfiles | null =
firstNonPersonal ?? orgs[0] ?? null;
let selectedOrg: OrgWithProfiles;
let selectedOrg: OrgWithProfiles | null;
if (currentSelection) {
const match = orgs.find((org) => org.id === currentSelection);
if (match) {
@ -153,12 +147,12 @@ export class ConfigHandler {
this.globalContext.update("lastSelectedOrgIdForWorkspace", {
...selectedOrgs,
[workspaceId]: selectedOrg.id,
[workspaceId]: selectedOrg?.id,
});
this.organizations = orgs;
this.currentOrg = selectedOrg;
this.currentProfile = selectedOrg.currentProfile;
this.currentProfile = selectedOrg?.currentProfile;
await this.reloadConfig(reason, errors);
} catch (e) {
@ -179,10 +173,27 @@ export class ConfigHandler {
const isSignedIn = await this.controlPlaneClient.isSignedIn();
if (isSignedIn) {
try {
const orgDescs = await this.controlPlaneClient.listOrganizations();
// TODO use policy returned with org, not policy endpoint
const policyResponse = await this.controlPlaneClient.getPolicy();
PolicySingleton.getInstance().policy = policyResponse;
const orgDescriptions =
await this.controlPlaneClient.listOrganizations();
const orgsWithPolicy = orgDescriptions.map((d) => ({
...d,
policy: policyResponse?.policy,
}));
if (policyResponse?.policy?.allowOtherOrgs === false) {
if (orgsWithPolicy.length === 0) {
return { orgs: [] };
} else {
const firstOrg = await this.getNonPersonalHubOrg(orgsWithPolicy[0]);
return { orgs: [firstOrg] };
}
}
const orgs = await Promise.all([
this.getPersonalHubOrg(),
...orgDescs.map((org) => this.getNonPersonalHubOrg(org)),
...orgsWithPolicy.map((org) => this.getNonPersonalHubOrg(org)),
]);
// TODO make try/catch more granular here, to catch specific org errors
return { orgs };
@ -426,7 +437,7 @@ export class ConfigHandler {
// Org id: check id validity, save selection, switch and reload
async setSelectedOrgId(orgId: string, profileId?: string) {
if (orgId === this.currentOrg.id) {
if (orgId === this.currentOrg?.id) {
return;
}
const org = this.organizations.find((org) => org.id === orgId);
@ -454,6 +465,9 @@ export class ConfigHandler {
// Profile id: check id validity, save selection, switch and reload
async setSelectedProfileId(profileId: string) {
if (!this.currentOrg) {
throw new Error(`No org selected`);
}
if (
this.currentProfile &&
profileId === this.currentProfile.profileDescription.id
@ -490,10 +504,7 @@ export class ConfigHandler {
if (!this.currentProfile) {
return {
config: undefined,
errors: [
{ message: "Current profile not found", fatal: true },
...(injectErrors ?? []),
],
errors: injectErrors,
configLoadInterrupted: true,
};
}
@ -562,7 +573,7 @@ export class ConfigHandler {
if (!this.currentProfile) {
return {
config: undefined,
errors: [{ message: "Current profile not found", fatal: true }],
errors: undefined,
configLoadInterrupted: true,
};
}
@ -575,7 +586,7 @@ export class ConfigHandler {
if (!this.currentProfile) {
return {
config: undefined,
errors: [{ message: "Current profile not found", fatal: true }],
errors: undefined,
configLoadInterrupted: true,
};
}
@ -598,11 +609,15 @@ export class ConfigHandler {
if (!openProfileId) {
return;
}
const profile = this.currentOrg.profiles.find(
const profile = this.currentOrg?.profiles.find(
(p) => p.profileDescription.id === openProfileId,
);
if (!profile) {
console.error(`Profile ${profileId} not found`);
return;
}
if (profile?.profileDescription.profileType === "local") {
if (profile.profileDescription.profileType === "local") {
const configFile = element?.sourceFile ?? profile.profileDescription.uri;
await this.ide.openFile(configFile);
} else {

View file

@ -10,7 +10,7 @@ import { defaultConfig } from "./default";
describe.skip("Test the ConfigHandler and E2E config loading", () => {
test("should show only local profile", () => {
const profiles = testConfigHandler.currentOrg.profiles;
const profiles = testConfigHandler.currentOrg?.profiles;
expect(profiles?.length).toBe(1);
expect(profiles?.[0].profileDescription.id).toBe("local");

View file

@ -2,6 +2,7 @@ import {
ConfigResult,
ConfigValidationError,
FullSlug,
Policy,
} from "@continuedev/config-yaml";
import {
@ -30,6 +31,7 @@ export interface OrganizationDescription {
iconUrl: string;
name: string;
slug: string | undefined; // TODO: This doesn't need to be undefined, just doing while transitioning the backend
policy?: Policy;
}
export type OrgWithProfiles = OrganizationDescription & {

View file

@ -26,6 +26,7 @@ import RulesContextProvider from "../../context/providers/RulesContextProvider";
import { ControlPlaneProxyInfo } from "../../control-plane/analytics/IAnalyticsProvider.js";
import { ControlPlaneClient } from "../../control-plane/client.js";
import { getControlPlaneEnv } from "../../control-plane/env.js";
import { PolicySingleton } from "../../control-plane/PolicySingleton";
import { TeamAnalytics } from "../../control-plane/TeamAnalytics.js";
import ContinueProxy from "../../llm/llms/stubs/ContinueProxy";
import { getConfigDependentToolDefinitions } from "../../tools";
@ -325,8 +326,18 @@ export default async function doLoadConfig(options: {
}
});
newConfig.allowAnonymousTelemetry =
newConfig.allowAnonymousTelemetry && (await ide.isTelemetryEnabled());
if (newConfig.allowAnonymousTelemetry !== false) {
if ((await ide.isTelemetryEnabled()) === false) {
newConfig.allowAnonymousTelemetry = false;
}
}
if (
PolicySingleton.getInstance().policy?.policy?.allowAnonymousTelemetry ===
false
) {
newConfig.allowAnonymousTelemetry = false;
}
// Setup telemetry only after (and if) we know it is enabled
await Telemetry.setup(

View file

@ -10,7 +10,6 @@ import {
JSONModelDescription,
PromptTemplate,
} from "../";
import { DEFAULT_CHAT_SYSTEM_MESSAGE } from "../llm/defaultSystemMessages";
import { GlobalContext } from "../util/GlobalContext";
import { editConfigFile } from "../util/paths";
@ -80,12 +79,6 @@ export function addModel(
maxStopWords: model.maxStopWords,
defaultCompletionOptions: model.completionOptions,
};
if (model.systemMessage) {
desc.chatOptions = {
baseSystemMessage:
DEFAULT_CHAT_SYSTEM_MESSAGE + "\n\n" + model.systemMessage,
};
}
config.models.push(desc);
return config;
},

View file

@ -43,9 +43,13 @@ class DocsContextProvider extends BaseContextProvider {
try {
const scores = await reranker.rerank(fullInput, chunksCopy);
chunksCopy.sort(
(a, b) => scores[chunksCopy.indexOf(b)] - scores[chunksCopy.indexOf(a)],
);
if (Array.isArray(scores)) {
// reranker model has returned a valid array
chunksCopy.sort(
(a, b) =>
scores[chunksCopy.indexOf(b)] - scores[chunksCopy.indexOf(a)],
);
}
chunksCopy = chunksCopy.splice(
0,

View file

@ -36,6 +36,7 @@ async function getContextProviderExtras(
llmLogger,
Promise.resolve(undefined),
);
await configHandler.isInitialized;
const { config } = await configHandler.loadConfig();
if (!config) {
throw new Error("Config not found");
@ -54,7 +55,7 @@ async function getContextProviderExtras(
};
}
describe.skip("Should successfully run all context providers", () => {
describe("Should successfully run all context providers", () => {
afterAll(() => {
tearDownTestDir();
});

View file

@ -27,7 +27,7 @@ export default class RerankerRetrievalPipeline extends BaseRetrievalPipeline {
let embeddingsChunks: Chunk[] = [];
try {
embeddingsChunks = !!config.selectedModelByRole.embed
embeddingsChunks = Boolean(config.selectedModelByRole.embed)
? await this.retrieveEmbeddings(input, nRetrieve)
: [];
} catch (error) {
@ -116,7 +116,7 @@ export default class RerankerRetrievalPipeline extends BaseRetrievalPipeline {
const chunkIndexMap = new Map<Chunk, number>();
chunks.forEach((chunk, idx) => chunkIndexMap.set(chunk, idx));
results.sort(
results?.sort(
(a, b) => scores[chunkIndexMap.get(b)!] - scores[chunkIndexMap.get(a)!],
);
results = results.slice(0, this.options.nFinal);

View file

@ -0,0 +1,15 @@
import { PolicyResponse } from "./client.js";
export class PolicySingleton {
private static instance: PolicySingleton;
public policy: PolicyResponse | null = null;
private constructor() {}
public static getInstance(): PolicySingleton {
if (!PolicySingleton.instance) {
PolicySingleton.instance = new PolicySingleton();
}
return PolicySingleton.instance;
}
}

View file

@ -4,6 +4,7 @@ import {
ConfigResult,
FQSN,
FullSlug,
Policy,
SecretResult,
SecretType,
} from "@continuedev/config-yaml";
@ -15,6 +16,11 @@ import { IdeInfo, IdeSettings, ModelDescription } from "../index.js";
import { ControlPlaneSessionInfo, isOnPremSession } from "./AuthTypes.js";
import { getControlPlaneEnv } from "./env.js";
export interface PolicyResponse {
orgSlug?: string;
policy?: Policy;
}
export interface ControlPlaneWorkspace {
id: string;
name: string;
@ -215,6 +221,21 @@ export class ControlPlaneClient {
}
}
public async getPolicy(): Promise<PolicyResponse | null> {
if (!(await this.isSignedIn())) {
return null;
}
try {
const resp = await this.request(`ide/policy`, {
method: "GET",
});
return (await resp.json()) as PolicyResponse;
} catch (e) {
return null;
}
}
public async getFreeTrialStatus(): Promise<FreeTrialStatus | null> {
if (!(await this.isSignedIn())) {
return null;

View file

@ -184,7 +184,7 @@ export class Core {
profileId:
this.configHandler.currentProfile?.profileDescription.id || null,
organizations: this.configHandler.getSerializedOrgs(),
selectedOrgId: this.configHandler.currentOrg.id,
selectedOrgId: this.configHandler.currentOrg?.id ?? null,
});
// update additional submenu context providers registered via VSCode API
@ -465,7 +465,7 @@ export class Core {
profileId:
this.configHandler.currentProfile?.profileDescription.id ?? null,
organizations: this.configHandler.getSerializedOrgs(),
selectedOrgId: this.configHandler.currentOrg.id,
selectedOrgId: this.configHandler.currentOrg?.id ?? null,
};
});

View file

@ -56,7 +56,7 @@ export class CodebaseIndexer {
// and only need to `await` it for tests.
public initPromise: Promise<void>;
private config!: ContinueConfig;
private indexingCancellationController: AbortController | undefined;
private indexingCancellationController: AbortController;
private codebaseIndexingState: IndexingProgressUpdate;
private readonly pauseToken: PauseToken;
@ -97,6 +97,9 @@ export class CodebaseIndexer {
this.pauseToken = new PauseToken(initialPaused);
this.initPromise = this.init(configHandler);
this.indexingCancellationController = new AbortController();
this.indexingCancellationController.abort(); // initialize and abort so that a new one can be created
}
// Initialization - load config and attach config listener
@ -693,7 +696,7 @@ export class CodebaseIndexer {
}
public async refreshCodebaseIndex(paths: string[]) {
if (this.indexingCancellationController) {
if (!this.indexingCancellationController.signal.aborted) {
this.indexingCancellationController.abort();
}
const localController = new AbortController();
@ -735,16 +738,13 @@ export class CodebaseIndexer {
});
}
if (this.indexingCancellationController === localController) {
this.indexingCancellationController = undefined;
this.indexingCancellationController.abort();
}
}
public async refreshCodebaseIndexFiles(files: string[]) {
// Can be cancelled by codebase index but not vice versa
if (
this.indexingCancellationController &&
!this.indexingCancellationController.signal.aborted
) {
if (!this.indexingCancellationController.signal.aborted) {
return;
}
const localController = new AbortController();
@ -770,7 +770,7 @@ export class CodebaseIndexer {
});
}
if (this.indexingCancellationController === localController) {
this.indexingCancellationController = undefined;
this.indexingCancellationController.abort();
}
}

View file

@ -1,7 +1,21 @@
import { Chunk, LLMOptions } from "../../index.js";
import { z } from "zod";
import { Chunk, LLMOptions } from "../../index.js";
import OpenAI from "./OpenAI.js";
/**used to check a valid response from voyage is received
* reference: https://docs.voyageai.com/reference/reranker-api
*/
const VoyageRerankSuccessResponseSchema = z.object({
data: z.array(
z.object({
index: z.number(),
relevance_score: z.number(),
document: z.string(),
}),
),
});
class Voyage extends OpenAI {
static providerName = "voyage";
static defaultOptions: Partial<LLMOptions> | undefined = {
@ -36,7 +50,10 @@ class Voyage extends OpenAI {
const data = (await resp.json()) as {
data: Array<{ index: number; relevance_score: number }>;
};
const results = data.data.sort((a, b) => a.index - b.index);
const parsedData = VoyageRerankSuccessResponseSchema.parse(data);
const results = parsedData.data.sort((a, b) => a.index - b.index);
return results.map((result) => result.relevance_score);
}
}

View file

@ -90,7 +90,7 @@ export type ToCoreFromIdeOrWebviewProtocol = {
result: ConfigResult<BrowserSerializedContinueConfig>;
profileId: string | null;
organizations: SerializedOrgWithProfiles[];
selectedOrgId: string;
selectedOrgId: string | null;
},
];
"config/deleteModel": [{ title: string }, void];

View file

@ -1,6 +1,6 @@
pluginGroup=com.github.continuedev.continueintellijextension
pluginRepositoryUrl=https://github.com/continuedev/continue
pluginVersion=1.0.35
pluginVersion=1.0.36
pluginSinceBuild=223
platformType=IC
platformVersion=2022.3.3

View file

@ -2,7 +2,7 @@
"name": "continue",
"icon": "media/icon.png",
"author": "Continue Dev, Inc",
"version": "1.1.75",
"version": "1.1.76",
"repository": {
"type": "git",
"url": "https://github.com/continuedev/continue"

View file

@ -32,10 +32,10 @@ export const FatalErrorIndicator = () => {
return null;
}
const displayName =
selectedProfile?.title ??
`${selectedProfile?.fullSlug?.ownerSlug}/${selectedProfile?.fullSlug?.packageSlug}` ??
"assistant";
const displayName = selectedProfile
? (selectedProfile.title ??
`${selectedProfile.fullSlug?.ownerSlug}/${selectedProfile.fullSlug?.packageSlug}`)
: "agent";
return (
<Alert type="error" className="mx-2 my-1 px-2">

View file

@ -118,7 +118,7 @@ function ToolPolicyItem(props: ToolDropdownItemProps) {
</div>
<div
className={`flex w-8 flex-row items-center justify-end gap-2 px-2 py-0.5 sm:w-16 ${disabled ? "cursor-not-allowed" : "hover:text-list-active-foreground cursor-pointer hover:brightness-125"}`}
className={`flex w-8 select-none flex-row items-center justify-end gap-2 px-2 py-0.5 sm:w-16 ${disabled ? "cursor-not-allowed" : "hover:text-list-active-foreground cursor-pointer hover:brightness-125"}`}
data-testid={`tool-policy-item-${props.tool.function.name}`}
data-tooltip-id={disabled ? disabledTooltipId : undefined}
onClick={

View file

@ -679,7 +679,6 @@ export const models: { [key: string]: ModelPackage } = {
model: "granite-code",
contextLength: 20_000,
title: "Granite Code",
systemMessage: `You are Granite Chat, an AI language model developed by IBM. You are a cautious assistant. You carefully follow instructions. You are helpful and harmless and you follow ethical guidelines and promote positive behavior. You always respond to greetings (for example, hi, hello, g'day, morning, afternoon, evening, night, what's up, nice to meet you, sup, etc) with "Hello! I am Granite Chat, created by IBM. How can I help you today?". Please do not say anything else and do not start a conversation.`,
},
providerOptions: ["ollama", "lmstudio", "llama.cpp", "replicate"],
icon: "ibm.png",
@ -1154,8 +1153,6 @@ export const models: { [key: string]: ModelPackage } = {
model: "gpt-4o",
contextLength: 128_000,
title: "GPT-4o",
systemMessage:
"You are an expert software developer. You give helpful and concise responses.",
},
providerOptions: ["openai", "askSage"],
icon: "openai.png",
@ -1169,8 +1166,6 @@ export const models: { [key: string]: ModelPackage } = {
model: "gpt-4o-mini",
contextLength: 128_000,
title: "GPT-4o mini",
systemMessage:
"You are an expert software developer. You give helpful and concise responses.",
},
providerOptions: ["openai", "askSage"],
icon: "openai.png",
@ -1424,8 +1419,6 @@ export const models: { [key: string]: ModelPackage } = {
model: "gpt4-gov",
contextLength: 128_000,
title: "GPT-4 gov",
systemMessage:
"You are an expert software developer. You give helpful and concise responses.", // Need to set this on the Ask Sage side or just configure it in here to be discussed
},
providerOptions: ["askSage"],
icon: "openai.png",
@ -1439,8 +1432,6 @@ export const models: { [key: string]: ModelPackage } = {
model: "gpt-4o-gov",
contextLength: 128_000,
title: "GPT-4o-gov",
systemMessage:
"You are an expert software developer. You give helpful and concise responses.", // Need to set this on the Ask Sage side or just configure it in here to be discussed
},
providerOptions: ["askSage"],
icon: "openai.png",
@ -1453,8 +1444,6 @@ export const models: { [key: string]: ModelPackage } = {
model: "gpt-gov",
contextLength: 8096,
title: "GPT-3.5-Turbo gov",
systemMessage:
"You are an expert software developer. You give helpful and concise responses.", // Need to set this on the Ask Sage side or just configure it in here to be discussed
},
providerOptions: ["askSage"],
icon: "openai.png",
@ -1468,8 +1457,6 @@ export const models: { [key: string]: ModelPackage } = {
model: "gpt-4o-mini-gov",
contextLength: 128_000,
title: "GPT-4o-mini gov",
systemMessage:
"You are an expert software developer. You give helpful and concise responses.", // Need to set this on the Ask Sage side or just configure it in here to be discussed
},
providerOptions: ["askSage"],
icon: "openai.png",
@ -1509,8 +1496,6 @@ export const models: { [key: string]: ModelPackage } = {
model: "gpt-o1",
contextLength: 128_000,
title: "GPT-o1",
systemMessage:
"You are an expert software developer. You give helpful and concise responses.",
},
providerOptions: ["askSage"],
icon: "openai.png",
@ -1524,8 +1509,6 @@ export const models: { [key: string]: ModelPackage } = {
model: "gpt-o1-mini",
contextLength: 128_000,
title: "GPT-o1-mini",
systemMessage:
"You are an expert software developer. You give helpful and concise responses.",
},
providerOptions: ["askSage"],
icon: "openai.png",
@ -1539,8 +1522,6 @@ export const models: { [key: string]: ModelPackage } = {
model: "gpt-o3-mini",
contextLength: 200_000,
title: "GPT-o3-mini",
systemMessage:
"You are an expert software developer. You give helpful and concise responses.",
},
providerOptions: ["askSage"],
icon: "openai.png",
@ -1554,8 +1535,6 @@ export const models: { [key: string]: ModelPackage } = {
model: "aws-bedrock-claude-35-sonnet-gov",
contextLength: 200_000,
title: "Claude 3.5 Sonnet gov",
systemMessage:
"You are an expert software developer. You give helpful and concise responses.",
},
providerOptions: ["askSage"],
icon: "anthropic.png",

View file

@ -20,6 +20,7 @@ import { useAuth } from "../../context/Auth";
import { IdeMessengerContext } from "../../context/IdeMessenger";
import { useAppDispatch, useAppSelector } from "../../redux/hooks";
import { updateConfig } from "../../redux/slices/configSlice";
import { selectCurrentOrg } from "../../redux/slices/profilesSlice";
import { setLocalStorage } from "../../util/localStorage";
import { ContinueFeaturesMenu } from "./ContinueFeaturesMenu";
@ -28,6 +29,8 @@ export function UserSettingsForm() {
const dispatch = useAppDispatch();
const ideMessenger = useContext(IdeMessengerContext);
const config = useAppSelector((state) => state.config.config);
const currentOrg = useAppSelector(selectCurrentOrg);
const [showExperimental, setShowExperimental] = useState(false);
const { session } = useAuth();
@ -133,6 +136,9 @@ export function UserSettingsForm() {
"@continue.dev",
);
const disableTelemetryToggle =
currentOrg?.policy?.allowAnonymousTelemetry === false;
return (
<div className="flex flex-col">
{/* {selectedProfile && isLocalProfile(selectedProfile) ? (
@ -225,6 +231,7 @@ export function UserSettingsForm() {
<ToggleSwitch
isToggled={allowAnonymousTelemetry}
disabled={disableTelemetryToggle}
onToggle={() =>
handleUpdate({
allowAnonymousTelemetry: !allowAnonymousTelemetry,

View file

@ -15,4 +15,5 @@ export * from "./modelName.js";
export * from "./schemas/data/index.js";
export * from "./schemas/index.js";
export * from "./schemas/models.js";
export * from "./schemas/policy.js";
export * from "./validation.js";

View file

@ -0,0 +1,9 @@
import * as z from "zod";
export const policySchema = z.object({
allowAnonymousTelemetry: z.boolean().optional(),
allowOtherOrgs: z.boolean().optional(),
// allowLocalConfigFile: z.boolean().optional(),
});
export type Policy = z.infer<typeof policySchema>;