Merge branch 'main' into nate/pr-checks

This commit is contained in:
Nate Sesti 2025-02-04 12:36:51 -08:00 • committed by GitHub
commit 4dcfb8ee79
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
18 changed files with 91 additions and 52 deletions

View file

@ -285,6 +285,7 @@ jobs:
cd core
npm test
env:
IGNORE_API_KEY_TESTS: ${{ github.event.pull_request.head.repo.fork }}
OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }}
ANTHROPIC_API_KEY: ${{ secrets.ANTHROPIC_API_KEY }}
GEMINI_API_KEY: ${{ secrets.GEMINI_API_KEY }}
@ -443,6 +444,7 @@ jobs:
chmod 600 ~/.ssh/id_rsa
ssh-keyscan -H "$SSH_HOST" >> ~/.ssh/known_hosts
echo -e "Host ssh-test-container\n\tHostName $SSH_HOST\n\tUser ec2-user\n\tIdentityFile ~/.ssh/id_rsa" >> ~/.ssh/config
if: ${{ github.event.pull_request.head.repo.fork == false }}
- name: Set up Xvfb
run: |
@ -452,7 +454,7 @@ jobs:
- name: Run e2e tests
run: |
cd extensions/vscode
TEST_FILE="${{ matrix.test_file }}" npm run ${{ matrix.command }}
IGNORE_SSH_TESTS="${{ github.event.pull_request.head.repo.fork }}" TEST_FILE="${{ matrix.test_file }}" npm run ${{ matrix.command }}
env:
DISPLAY: :99

View file

@ -246,6 +246,7 @@ export class CompletionProvider {
completionOptions,
cacheHit,
filepath: helper.filepath,
numLines: completion.split("\n").length,
completionId: helper.input.completionId,
gitRepo: await this.ide.getRepoName(helper.filepath),
uniqueId: await this.ide.getUniqueId(),

View file

@ -1,10 +1,4 @@
import {
Position,
Range,
RangeInFile,
RangeInFileWithContents,
TabAutocompleteOptions,
} from "../..";
import { Position, Range, RangeInFile, TabAutocompleteOptions } from "../..";
import { AutocompleteCodeSnippet } from "../snippets/types";
export type RecentlyEditedRange = RangeInFile & {
@ -42,6 +36,7 @@ export interface AutocompleteOutcome extends TabAutocompleteOptions {
modelName: string;
completionOptions: any;
cacheHit: boolean;
numLines: number;
filepath: string;
gitRepo?: string;
completionId: string;

View file

@ -338,11 +338,11 @@ export class ConfigHandler {
this.updateListeners.push(listener);
}
async reloadConfig() {
async reloadConfig(additionalContextProviders: IContextProvider[] = []) {
// TODO: this isn't right, there are two different senses in which you want to "reload"
const { config, errors, configLoadInterrupted } =
await this.currentProfile.reloadConfig();
await this.currentProfile.reloadConfig(additionalContextProviders);
if (config) {
this.inactiveProfiles.forEach((profile) => profile.clearConfig());
@ -392,6 +392,6 @@ export class ConfigHandler {
registerCustomContextProvider(contextProvider: IContextProvider) {
this.additionalContextProviders.push(contextProvider);
void this.reloadConfig();
void this.reloadConfig(this.additionalContextProviders);
}
}

View file

@ -50,12 +50,12 @@ export class ProfileLifecycleManager {
}
// Clear saved config and reload
async reloadConfig(): Promise<ConfigResult<ContinueConfig>> {
async reloadConfig(additionalContextProviders: IContextProvider[] = []): Promise<ConfigResult<ContinueConfig>> {
this.savedConfigResult = undefined;
this.savedBrowserConfigResult = undefined;
this.pendingConfigPromise = undefined;
return this.loadConfig([], true);
return this.loadConfig(additionalContextProviders, true);
}
async loadConfig(

View file

@ -124,12 +124,14 @@ export default async function doLoadConfig(
if (newConfig.analytics) {
await TeamAnalytics.setup(
newConfig.analytics as any, // TODO: Need to get rid of index.d.ts once and for all
newConfig.analytics,
uniqueId,
ideInfo.extensionVersion,
controlPlaneClient,
controlPlaneProxyInfo,
);
} else {
await TeamAnalytics.shutdown();
}
newConfig = await injectControlPlaneProxyInfo(

View file

@ -1,7 +1,5 @@
import os from "node:os";
import { Analytics } from "@continuedev/config-types";
import ContinueProxyAnalyticsProvider from "./analytics/ContinueProxyAnalyticsProvider.js";
import {
ControlPlaneProxyInfo,
@ -10,9 +8,10 @@ import {
import LogStashAnalyticsProvider from "./analytics/LogStashAnalyticsProvider.js";
import PostHogAnalyticsProvider from "./analytics/PostHogAnalyticsProvider.js";
import { ControlPlaneClient } from "./client.js";
import { AnalyticsConfig } from "../index.js";
function createAnalyticsProvider(
config: Analytics,
config: AnalyticsConfig,
): IAnalyticsProvider | undefined {
// @ts-ignore
switch (config.provider) {
@ -42,7 +41,7 @@ export class TeamAnalytics {
}
static async setup(
config: Analytics,
config: AnalyticsConfig,
uniqueId: string,
extensionVersion: string,
controlPlaneClient: ControlPlaneClient,
@ -52,22 +51,27 @@ export class TeamAnalytics {
TeamAnalytics.os = os.platform();
TeamAnalytics.extensionVersion = extensionVersion;
if (!config) {
await TeamAnalytics.provider?.shutdown();
TeamAnalytics.provider = undefined;
} else {
TeamAnalytics.provider = createAnalyticsProvider(config);
await TeamAnalytics.provider?.setup(
config,
uniqueId,
controlPlaneProxyInfo,
);
TeamAnalytics.provider = createAnalyticsProvider(config);
await TeamAnalytics.provider?.setup(
config,
uniqueId,
controlPlaneProxyInfo,
);
if (config.provider === "continue-proxy") {
(
TeamAnalytics.provider as ContinueProxyAnalyticsProvider
).controlPlaneClient = controlPlaneClient;
}
if (config.provider === "continue-proxy") {
(
TeamAnalytics.provider as ContinueProxyAnalyticsProvider
).controlPlaneClient = controlPlaneClient;
}
}
static async shutdown() {
if (TeamAnalytics.provider) {
await TeamAnalytics.provider.shutdown();
TeamAnalytics.provider = undefined;
TeamAnalytics.os = undefined;
TeamAnalytics.extensionVersion = undefined;
TeamAnalytics.uniqueId = "NOT_UNIQUE";
}
}
}

View file

@ -1,4 +1,4 @@
import { Analytics } from "@continuedev/config-types";
import { AnalyticsConfig } from "../..";
export interface AnalyticsMetadata {
extensionVersion: string;
@ -13,7 +13,7 @@ export interface ControlPlaneProxyInfo {
export interface IAnalyticsProvider {
capture(event: string, properties: { [key: string]: any }): Promise<void>;
setup(
config: Analytics,
config: AnalyticsConfig,
uniqueId: string,
controlPlaneProxyInfo?: ControlPlaneProxyInfo,
): Promise<void>;

2
core/index.d.ts vendored
View file

@ -1105,7 +1105,7 @@ export interface ExperimentalConfig {
}
export interface AnalyticsConfig {
type: string;
provider: string;
url?: string;
clientKey?: string;
}

View file

@ -26,7 +26,7 @@ export class DefaultCrawler {
});
if (!resp.ok) {
const text = await resp.text();
throw new Error(`Failed to crawl site: ${text}`);
throw new Error(`Failed to crawl site (${resp.status}): ${text}`);
}
const json = (await resp.json()) as PageData[];
return json;

View file

@ -152,11 +152,15 @@ describe("DocsCrawler", () => {
);
commonDocsSites.forEach((url) => {
test(`Default crawler common site: ${url}`, async () => {
const { pages, crawler } = await runCrawl(url);
expect(pages.length).toBeGreaterThanOrEqual(1);
expect(crawler).toEqual("default");
});
test(
`Default crawler common site: ${url}`,
async () => {
const { pages, crawler } = await runCrawl(url);
expect(pages.length).toBeGreaterThanOrEqual(1);
expect(crawler).toEqual("default");
},
TIMEOUT_MS,
);
});
});

View file

@ -178,6 +178,15 @@ function testLLM(
}
describe("LLM", () => {
if (process.env.IGNORE_API_KEY_TESTS === "true") {
test("Skipping API key tests", () => {
console.log(
"Skipping API key tests due to IGNORE_API_KEY_TESTS being set",
);
});
return;
}
testLLM(
new Anthropic({
model: "claude-3-5-sonnet-latest",

View file

@ -99,6 +99,21 @@ If you prefer to use a model from [OpenAI](../customize/model-providers/top-leve
]
```
### Grok-2 from xAI
If you prefer to use a model from [xAI](../customize/model-providers/top-level/xAI.md), then we recommend Grok-2.
```json title="config.json"
"models": [
{
"title": "Grok-2",
"provider": "xAI",
"model": "grok-2-latest",
"apiKey": "[XAI_API_KEY]"
}
]
```
### Gemini 1.5 Pro from Google
If you prefer to use a model from [Google](../customize/model-providers/top-level/gemini.md), then we recommend Gemini 1.5 Pro.

View file

@ -14,5 +14,6 @@ If you have the ability to use any model, we recommend [Claude 3.5 Sonnet](../mo
Otherwise, some of the next best options are:
- [GPT-4o](../model-providers/top-level/openai.md)
- [Grok-2](../model-providers/top-level/xAI.md)
- [Gemini 1.5 Pro](../model-providers/top-level/gemini.md)
- [Llama3.1 405B](../tutorials/llama3.1.md)

View file

@ -16,9 +16,9 @@ Each model has specific configuration options tailored to its provider and funct
**Properties:**
- `title` (**required**): The title to assign to your model, shown in dropdowns, etc.
- `provider` (**required**): The provider of the model, which determines the type and interaction method. Options inclued `openai`, `ollama`, etc., see intelliJ suggestions.
- `provider` (**required**): The provider of the model, which determines the type and interaction method. Options inclued `openai`, `ollama`, `xAI`, etc., see IntelliJ suggestions.
- `model` (**required**): The name of the model, used for prompt template auto-detection. Use `AUTODETECT` special name to get all available models.
- `apiKey`: API key required by providers like OpenAI, Anthropic, and Cohere.
- `apiKey`: API key required by providers like OpenAI, Anthropic, Cohere, and xAI.
- `apiBase`: The base URL of the LLM API.
- `contextLength`: Maximum context length of the model, typically in tokens (default: 2048).
- `maxStopWords`: Maximum number of stop words allowed, to avoid API errors with extensive lists.

View file

@ -3,7 +3,7 @@ pluginGroup=com.github.continuedev.continueintellijextension
pluginName=continue-intellij-extension
pluginRepositoryUrl=https://github.com/continuedev/continue
# SemVer format -> https://semver.org
pluginVersion=0.0.86
pluginVersion=0.0.87
# Supported build number ranges and IntelliJ Platform versions -> https://plugins.jetbrains.com/docs/intellij/build-number-ranges.html
pluginSinceBuild=223
# IntelliJ Platform Properties -> https://plugins.jetbrains.com/docs/intellij/tools-gradle-intellij-plugin.html#configuration-intellij-extension

View file

@ -1,18 +1,24 @@
import {
EditorView,
TextEditor,
InputBox,
Workbench,
Key,
VSBrowser,
TextEditor,
Workbench,
} from "vscode-extension-tester";
import { DEFAULT_TIMEOUT } from "../constants";
import { TestUtils } from "../TestUtils";
import { SSHSelectors } from "../selectors/SSH.selectors";
import { AutocompleteActions } from "../actions/Autocomplete.actions";
import { DEFAULT_TIMEOUT } from "../constants";
import { SSHSelectors } from "../selectors/SSH.selectors";
import { TestUtils } from "../TestUtils";
describe("SSH", function () {
if (process.env.IGNORE_SSH_TESTS === "true") {
it("Skipping SSH tests", () => {
console.log("Skipping SSH tests due to IGNORE_SSH_TESTS being set");
});
return;
}
it("Should display completions", async () => {
await TestUtils.waitForSuccess(async () => {
await new Workbench().executeCommand(

View file

@ -214,7 +214,7 @@
"command": "continue.toggleFullScreen",
"category": "Continue",
"title": "Toggle Full Screen",
"icon": "$(fullscreen)",
"icon": "$(link-external)",
"group": "Continue"
},
{