Skip to content

Commit 8cec3fb

Browse files
authored
Merge branch 'main' into feat/watsonx_reranker_integration
2 parents 523b1e4 + 1a98c53 commit 8cec3fb

File tree

103 files changed

+2635
-559
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

103 files changed

+2635
-559
lines changed

.github/workflows/pr_checks.yaml

Lines changed: 16 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -275,7 +275,7 @@ jobs:
275275
cd core
276276
npm test
277277
env:
278-
IGNORE_API_KEY_TESTS: ${{ github.event.pull_request.head.repo.fork }}
278+
IGNORE_API_KEY_TESTS: ${{ github.event.pull_request.head.repo.fork == true && github.actor == 'dependabot[bot]' }}
279279
OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }}
280280
ANTHROPIC_API_KEY: ${{ secrets.ANTHROPIC_API_KEY }}
281281
GEMINI_API_KEY: ${{ secrets.GEMINI_API_KEY }}
@@ -409,6 +409,14 @@ jobs:
409409
path: extensions/vscode/node_modules
410410
key: ${{ runner.os }}-vscode-node-modules-${{ hashFiles('extensions/vscode/package-lock.json') }}
411411

412+
# We don't want to cache the Continue extension, so it is deleted at the end of the job
413+
- uses: actions/cache@v4
414+
id: test-extensions-cache
415+
with:
416+
path: extensions/vscode/e2e/.test-extensions
417+
# package.json used as the key because that's where the download script is defined
418+
key: vscode-test-extensions-${{ hashFiles('extensions/vscode/package.json') }}
419+
412420
- name: Download build artifact
413421
uses: actions/download-artifact@v4
414422
with:
@@ -436,7 +444,7 @@ jobs:
436444
chmod 600 ~/.ssh/id_rsa
437445
ssh-keyscan -H "$SSH_HOST" >> ~/.ssh/known_hosts
438446
echo -e "Host ssh-test-container\n\tHostName $SSH_HOST\n\tUser ec2-user\n\tIdentityFile ~/.ssh/id_rsa" >> ~/.ssh/config
439-
if: ${{ github.event.pull_request.head.repo.fork == false }}
447+
if: ${{ github.event.pull_request.head.repo.fork == false && github.actor != 'dependabot[bot]' }}
440448

441449
- name: Set up Xvfb
442450
run: |
@@ -446,10 +454,15 @@ jobs:
446454
- name: Run e2e tests
447455
run: |
448456
cd extensions/vscode
449-
IGNORE_SSH_TESTS="${{ github.event.pull_request.head.repo.fork }}" TEST_FILE="${{ matrix.test_file }}" npm run ${{ matrix.command }}
457+
IGNORE_SSH_TESTS="${{ github.event.pull_request.head.repo.fork == false && github.actor != 'dependabot[bot]' }}" TEST_FILE="${{ matrix.test_file }}" npm run ${{ matrix.command }}
450458
env:
451459
DISPLAY: :99
452460

461+
- name: Delete continue from test extensions
462+
run: |
463+
cd extensions/vscode
464+
rm -rf e2e/.test-extensions/continue*
465+
453466
- name: Upload e2e test screenshots
454467
if: failure()
455468
uses: actions/upload-artifact@v4
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
name: "Label / close stale issues"
2+
on:
3+
schedule:
4+
- cron: "30 1 * * *"
5+
6+
jobs:
7+
stale:
8+
permissions:
9+
issues: write
10+
pull-requests: write
11+
runs-on: ubuntu-latest
12+
steps:
13+
- uses: actions/stale@v9
14+
with:
15+
close-issue-message: "This issue was closed because it wasn't updated for 10 days after being marked stale. If it's still important, please reopen + comment and we'll gladly take another look!"
16+
stale-issue-message: "This issue hasn't been updated in 90 days and will be closed after an additional 10 days without activity. If it's still important, please leave a comment and share any new information that would help us address the issue."
17+
days-before-stale: 90
18+
days-before-close: 10
19+
days-before-pr-stale: -1
20+
days-before-pr-close: -1
21+
operations-per-run: 1000
22+
stale-issue-label: "stale"
23+
stale-pr-label: "stale"
24+
exempt-issue-labels: "needs-triage,no-stale,high,highest"
25+
exempt-pr-labels: "no-stale"

binary/core-dev-server.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
const path = require('path');
2+
process.env.CONTINUE_DEVELOPMENT = true;
3+
4+
process.env.CONTINUE_GLOBAL_DIR = path.join(process.env.PROJECT_DIR, 'extensions', '.continue-debug');
5+
6+
require('./out/index.js');

binary/package-lock.json

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

binary/prompt-logs.js

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
const fs = require('fs');
2+
const path = require('path');
3+
4+
const logDirPath = path.join(__dirname, '..', 'extensions', '.continue-debug', 'logs');
5+
const logFilePath = path.join(logDirPath, "prompt.log");
6+
7+
if (!fs.existsSync(logDirPath)) {
8+
fs.mkdirSync(logDirPath, { recursive: true });
9+
}
10+
11+
if (!fs.existsSync(logFilePath)) {
12+
fs.createWriteStream(logFilePath).end();
13+
}
14+
15+
console.log("Watching logs at " + logFilePath)
16+
17+
fs.watch(logFilePath, () => {
18+
// console.clear();
19+
fs.createReadStream(logFilePath).pipe(process.stdout);
20+
});

core/autocomplete/CompletionProvider.ts

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -134,6 +134,13 @@ export class CompletionProvider {
134134
token: AbortSignal | undefined,
135135
): Promise<AutocompleteOutcome | undefined> {
136136
try {
137+
// Create abort signal if not given
138+
if (!token) {
139+
const controller = this.loggingService.createAbortController(
140+
input.completionId,
141+
);
142+
token = controller.signal;
143+
}
137144
const startTime = Date.now();
138145
const options = await this._getAutocompleteOptions();
139146

@@ -158,14 +165,6 @@ export class CompletionProvider {
158165
return undefined;
159166
}
160167

161-
// Create abort signal if not given
162-
if (!token) {
163-
const controller = this.loggingService.createAbortController(
164-
input.completionId,
165-
);
166-
token = controller.signal;
167-
}
168-
169168
const [snippetPayload, workspaceDirs] = await Promise.all([
170169
getAllSnippets({
171170
helper,

core/commands/slash/onboard.ts

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,7 @@ import ignore from "ignore";
22

33
import type { FileType, IDE, SlashCommand } from "../..";
44
import {
5-
defaultIgnoreDir,
6-
defaultIgnoreFile,
5+
DEFAULT_IGNORE,
76
getGlobalContinueIgArray,
87
gitIgArrayFromFile,
98
} from "../../indexing/ignore";
@@ -58,10 +57,7 @@ const OnboardSlashCommand: SlashCommand = {
5857
};
5958

6059
async function getEntriesFilteredByIgnore(dir: string, ide: IDE) {
61-
const ig = ignore()
62-
.add(defaultIgnoreDir)
63-
.add(defaultIgnoreFile)
64-
.add(getGlobalContinueIgArray());
60+
const ig = ignore().add(DEFAULT_IGNORE).add(getGlobalContinueIgArray());
6561
const entries = await ide.listDir(dir);
6662

6763
const ignoreUri = joinPathsToUri(dir, ".gitignore");

core/config/load.ts

Lines changed: 14 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,11 @@ import * as fs from "fs";
33
import os from "os";
44
import path from "path";
55

6+
import {
7+
ConfigResult,
8+
ConfigValidationError,
9+
ModelRole,
10+
} from "@continuedev/config-yaml";
611
import { fetchwithRequestOptions } from "@continuedev/fetch";
712
import * as JSONC from "comment-json";
813
import * as tar from "tar";
@@ -31,14 +36,16 @@ import {
3136
import {
3237
slashCommandFromDescription,
3338
slashFromCustomCommand,
34-
} from "../commands/index.js";
39+
} from "../commands/index";
3540
import { AllRerankers } from "../context/allRerankers";
3641
import { MCPManagerSingleton } from "../context/mcp";
42+
import CodebaseContextProvider from "../context/providers/CodebaseContextProvider";
3743
import ContinueProxyContextProvider from "../context/providers/ContinueProxyContextProvider";
3844
import CustomContextProviderClass from "../context/providers/CustomContextProvider";
3945
import FileContextProvider from "../context/providers/FileContextProvider";
4046
import { contextProviderClassFromName } from "../context/providers/index";
4147
import PromptFilesContextProvider from "../context/providers/PromptFilesContextProvider";
48+
import { useHub } from "../control-plane/env";
4249
import { allEmbeddingsProviders } from "../indexing/allEmbeddingsProviders";
4350
import { BaseLLM } from "../llm";
4451
import { llmFromDescription } from "../llm/llms";
@@ -62,14 +69,8 @@ import {
6269
getContinueDotEnv,
6370
getEsbuildBinaryPath,
6471
} from "../util/paths";
65-
66-
import {
67-
ConfigResult,
68-
ConfigValidationError,
69-
ModelRole,
70-
} from "@continuedev/config-yaml";
71-
import { useHub } from "../control-plane/env";
7272
import { localPathToUri } from "../util/pathToUri";
73+
7374
import {
7475
defaultContextProvidersJetBrains,
7576
defaultContextProvidersVsCode,
@@ -78,7 +79,7 @@ import {
7879
} from "./default";
7980
import { getSystemPromptDotFile } from "./getSystemPromptDotFile";
8081
import { modifyAnyConfigWithSharedConfig } from "./sharedConfig";
81-
import { getModelByRole } from "./util";
82+
import { getModelByRole, isSupportedLanceDbCpuTargetForLinux } from "./util";
8283
import { validateConfig } from "./validation.js";
8384

8485
export function resolveSerializedConfig(
@@ -172,10 +173,9 @@ function loadSerializedConfig(
172173
? [...defaultSlashCommandsVscode]
173174
: [...defaultSlashCommandsJetBrains];
174175

175-
// Temporarily disabling this check until we can verify the commands are accuarate
176-
// if (!isSupportedLanceDbCpuTarget(ide)) {
177-
// config.disableIndexing = true;
178-
// }
176+
if (os.platform() === "linux" && !isSupportedLanceDbCpuTargetForLinux(ide)) {
177+
config.disableIndexing = true;
178+
}
179179

180180
return { config, errors, configLoadInterrupted: false };
181181
}
@@ -232,13 +232,6 @@ export function isContextProviderWithParams(
232232
return (contextProvider as ContextProviderWithParams).name !== undefined;
233233
}
234234

235-
const getCodebaseProvider = async (params: any) => {
236-
const { default: CodebaseContextProvider } = await import(
237-
"../context/providers/CodebaseContextProvider"
238-
);
239-
return new CodebaseContextProvider(params);
240-
};
241-
242235
/** Only difference between intermediate and final configs is the `models` array */
243236
async function intermediateToFinalConfig(
244237
config: Config,
@@ -405,7 +398,7 @@ async function intermediateToFinalConfig(
405398
new FileContextProvider({}),
406399
// Add codebase provider if indexing is enabled
407400
...(!config.disableIndexing
408-
? [await getCodebaseProvider(codebaseContextParams)]
401+
? [new CodebaseContextProvider(codebaseContextParams)]
409402
: []),
410403
// Add prompt files provider if enabled
411404
...(loadPromptFiles ? [new PromptFilesContextProvider({})] : []),

core/config/sharedConfig.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ export const sharedConfigSchema = z
2020
promptPath: z.string(),
2121

2222
// `ui` in `ContinueConfig`
23+
showSessionTabs: z.boolean(),
2324
codeBlockToolbarPosition: z.enum(["top", "bottom"]),
2425
fontSize: z.number(),
2526
codeWrap: z.boolean(),
@@ -134,6 +135,10 @@ export function modifyAnyConfigWithSharedConfig<
134135
configCopy.disableSessionTitles = sharedConfig.disableSessionTitles;
135136
}
136137

138+
if (sharedConfig.showSessionTabs !== undefined) {
139+
configCopy.ui.showSessionTabs = sharedConfig.showSessionTabs;
140+
}
141+
137142
configCopy.experimental = {
138143
...configCopy.experimental,
139144
};

core/config/util.ts

Lines changed: 17 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { execSync } from "child_process";
1+
import fs from "fs";
22
import os from "os";
33

44
import {
@@ -121,63 +121,49 @@ export function getModelByRole<T extends keyof ExperimentalModelRoles>(
121121
*
122122
* See here for details: https://github.com/continuedev/continue/issues/940
123123
*/
124-
export function isSupportedLanceDbCpuTarget(ide: IDE) {
124+
export function isSupportedLanceDbCpuTargetForLinux(ide?: IDE) {
125125
const CPU_FEATURES_TO_CHECK = ["avx2", "fma"] as const;
126126

127127
const globalContext = new GlobalContext();
128-
const globalContextVal = globalContext.get("isSupportedLanceDbCpuTarget");
128+
const globalContextVal = globalContext.get(
129+
"isSupportedLanceDbCpuTargetForLinux",
130+
);
129131

130132
// If we've already checked the CPU target, return the cached value
131133
if (globalContextVal !== undefined) {
132134
return globalContextVal;
133135
}
134136

135137
const arch = os.arch();
136-
const platform = os.platform();
137138

138139
// This check only applies to x64
139140
//https://github.com/lancedb/lance/issues/2195#issuecomment-2057841311
140141
if (arch !== "x64") {
141-
globalContext.update("isSupportedLanceDbCpuTarget", true);
142+
globalContext.update("isSupportedLanceDbCpuTargetForLinux", true);
142143
return true;
143144
}
144145

145146
try {
146-
const cpuFlags = (() => {
147-
switch (platform) {
148-
case "darwin":
149-
return execSync("sysctl -n machdep.cpu.features")
150-
.toString()
151-
.toLowerCase();
152-
case "linux":
153-
return execSync("cat /proc/cpuinfo").toString().toLowerCase();
154-
case "win32":
155-
return execSync("wmic cpu get caption /format:list")
156-
.toString()
157-
.toLowerCase();
158-
default:
159-
return "";
160-
}
161-
})();
147+
const cpuFlags = fs.readFileSync("/proc/cpuinfo", "utf-8").toLowerCase();
162148

163-
const isSupportedLanceDbCpuTarget = cpuFlags
149+
const isSupportedLanceDbCpuTargetForLinux = cpuFlags
164150
? CPU_FEATURES_TO_CHECK.every((feature) => cpuFlags.includes(feature))
165151
: true;
166152

167153
// If it's not a supported CPU target, and it's the first time we are checking,
168154
// show a toast to inform the user that we are going to disable indexing.
169-
if (!isSupportedLanceDbCpuTarget) {
155+
if (!isSupportedLanceDbCpuTargetForLinux && ide) {
170156
// We offload our async toast to `showUnsupportedCpuToast` to prevent making
171-
// our config loading async upstream of `isSupportedLanceDbCpuTarget`
157+
// our config loading async upstream of `isSupportedLanceDbCpuTargetForLinux`
172158
void showUnsupportedCpuToast(ide);
173159
}
174160

175161
globalContext.update(
176-
"isSupportedLanceDbCpuTarget",
177-
isSupportedLanceDbCpuTarget,
162+
"isSupportedLanceDbCpuTargetForLinux",
163+
isSupportedLanceDbCpuTargetForLinux,
178164
);
179165

180-
return isSupportedLanceDbCpuTarget;
166+
return isSupportedLanceDbCpuTargetForLinux;
181167
} catch (error) {
182168
// If we can't determine CPU features, default to true
183169
return true;
@@ -187,11 +173,13 @@ export function isSupportedLanceDbCpuTarget(ide: IDE) {
187173
async function showUnsupportedCpuToast(ide: IDE) {
188174
const shouldOpenLink = await ide.showToast(
189175
"warning",
190-
"Codebase indexing is disabled due to CPU incompatibility",
176+
"Codebase indexing disabled - Your Linux system lacks required CPU features (AVX2, FMA)",
191177
"Learn more",
192178
);
193179

194180
if (shouldOpenLink) {
195-
void ide.openUrl("https://github.com/continuedev/continue/pull/3551");
181+
void ide.openUrl(
182+
"https://docs.continue.dev/troubleshooting#i-received-a-codebase-indexing-disabled---your-linux-system-lacks-required-cpu-features-avx2-fma-notification",
183+
);
196184
}
197185
}

0 commit comments

Comments
 (0)