Skip to content

Commit a96f7a7

Browse files
sestinjPatrick-Erichsendevbyjonah
authored
Dev (#1643)
* docs: add docs and schema for "OS" provider (#1536) * ignore .env * ✨ use and cache imports for autocomplete (#1456) * ✨ use and cache imports for autocomplete * fix tsc * add voyage rerank-1 * import Handlebars * feat: update onboarding w/ embeddings model (#1570) * chore(gui): remove unused pages * feat: add embeddings step * feat: update styles * feat: copy button updates * fix: correct pull command for embed model * fix: remove commented code * fix: remove commented code * feat: simplify copy btn props * chore: rename onboarding selection event * feat: add provider config * fix: undo msg name * remove dead code * fix: invalid mode check * fix: remove testing logic * fix: fullscreen gui retains context when hidden, fixed fullscreen focusing (#1582) * small UI tweaks * media query * feat: add best experience onboarding * small fixes * feat: add free trial card to onboarding (#1600) * feat: add free trial card to onboarding * add import * chore: add telemetry for full screen toggle (#1618) * rerank-lite-1 * basic tests for VS Code extension * chore: onboarding metrics (#1626) * fix: pageview tracking * feat: add onboarding telemetry * create single `onboardingStatus` type * improved var naming * remove console logs * fix double adding of context providers * fix cross-platform build validation * Update troubleshooting.md (#1637) * add back skip onboarding button * fix free trial embeddings error * Nate/indexing fixes (#1642) * fix pausing of indexing * don't send empty array to openai embeddings * catch embeddings errors without stopping entire indexing process * update version --------- Co-authored-by: Patrick Erichsen <[email protected]> Co-authored-by: Jonah Wagner <[email protected]>
1 parent b770863 commit a96f7a7

File tree

12 files changed

+71
-23
lines changed

12 files changed

+71
-23
lines changed

core/config/load.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -144,12 +144,12 @@ function loadSerializedConfig(
144144
// Set defaults if undefined (this lets us keep config.json uncluttered for new users)
145145
config.contextProviders ??=
146146
ideType === "vscode"
147-
? defaultContextProvidersVsCode
148-
: defaultContextProvidersJetBrains;
147+
? [...defaultContextProvidersVsCode]
148+
: [...defaultContextProvidersJetBrains];
149149
config.slashCommands ??=
150150
ideType === "vscode"
151-
? defaultSlashCommandsVscode
152-
: defaultSlashCommandsJetBrains;
151+
? [...defaultSlashCommandsVscode]
152+
: [...defaultSlashCommandsJetBrains];
153153

154154
return config;
155155
}

core/core.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,9 @@ export class Core {
4040
indexingState: IndexingProgressUpdate;
4141
private globalContext = new GlobalContext();
4242
private docsService = DocsService.getInstance();
43+
private readonly indexingPauseToken = new PauseToken(
44+
this.globalContext.get("indexingPaused") === true,
45+
);
4346

4447
private abortedMessageIds: Set<string> = new Set();
4548

@@ -79,9 +82,6 @@ export class Core {
7982
);
8083

8184
// Codebase Indexer and ContinueServerClient depend on IdeSettings
82-
const indexingPauseToken = new PauseToken(
83-
this.globalContext.get("indexingPaused") === true,
84-
);
8585
let codebaseIndexerResolve: (_: any) => void | undefined;
8686
this.codebaseIndexerPromise = new Promise(
8787
async (resolve) => (codebaseIndexerResolve = resolve),
@@ -103,7 +103,7 @@ export class Core {
103103
new CodebaseIndexer(
104104
this.configHandler,
105105
this.ide,
106-
new PauseToken(false),
106+
this.indexingPauseToken,
107107
continueServerClient,
108108
),
109109
);
@@ -569,7 +569,7 @@ export class Core {
569569
});
570570
on("index/setPaused", (msg) => {
571571
new GlobalContext().update("indexingPaused", msg.data);
572-
indexingPauseToken.paused = msg.data;
572+
this.indexingPauseToken.paused = msg.data;
573573
});
574574
on("index/indexingProgressBarInitialized", async (msg) => {
575575
// Triggered when progress bar is initialized.

core/indexing/LanceDbIndex.ts

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -105,10 +105,20 @@ export class LanceDbIndex implements CodebaseIndex {
105105
continue;
106106
}
107107

108-
// Calculate embeddings
109-
const embeddings = await this.embeddingsProvider.embed(
110-
chunks.map((c) => c.content),
111-
);
108+
let embeddings: number[][];
109+
try {
110+
// Calculate embeddings
111+
embeddings = await this.embeddingsProvider.embed(
112+
chunks.map((c) => c.content),
113+
);
114+
} catch (e) {
115+
// Rather than fail the entire indexing process, we'll just skip this file
116+
// so that it may be picked up on the next indexing attempt
117+
console.warn(
118+
`Failed to generate embedding for ${chunks[0]?.filepath} with provider: ${this.embeddingsProvider.id}: ${e}`,
119+
);
120+
continue;
121+
}
112122

113123
if (embeddings.some((emb) => emb === undefined)) {
114124
throw new Error(

core/indexing/embeddings/FreeTrialEmbeddingsProvider.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,9 @@ class FreeTrialEmbeddingsProvider extends BaseEmbeddingsProvider {
3232
return (
3333
await Promise.all(
3434
batchedChunks.map(async (batch) => {
35+
if (batch.length === 0) {
36+
return [];
37+
}
3538
const fetchWithBackoff = () =>
3639
withExponentialBackoff<Response>(async () =>
3740
this.fetch(new URL("embeddings", constants.a), {

core/indexing/embeddings/OpenAIEmbeddingsProvider.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,10 @@ class OpenAIEmbeddingsProvider extends BaseEmbeddingsProvider {
4747
return (
4848
await Promise.all(
4949
batchedChunks.map(async (batch) => {
50+
if (batch.length === 0) {
51+
return [];
52+
}
53+
5054
const fetchWithBackoff = () =>
5155
withExponentialBackoff<Response>(() =>
5256
this.fetch(this._getEndpoint(), {

core/indexing/indexCodebase.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -149,7 +149,8 @@ export class CodebaseIndexer {
149149
progress =
150150
(completedDirs +
151151
(completedRelativeExpectedTime +
152-
indexProgress * codebaseIndex.relativeExpectedTime) /
152+
Math.min(1.0, indexProgress) *
153+
codebaseIndex.relativeExpectedTime) /
153154
totalRelativeExpectedTime) /
154155
workspaceDirs.length;
155156
yield {

docs/docs/troubleshooting.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ To solve many problems, the first step is reading the logs to find the relevant
2727
If you're getting a response from the LLM that doesn't seem to make sense, you can
2828

2929
1. Open the "Output" panel (right next to the terminal)
30-
2. In the dropdown, select "Continue - LLM Prompts/Completions
30+
2. In the dropdown, select "Continue - LLM Prompts/Completions"
3131
3. View the exact prompts that were sent to the LLM and the completions recieved
3232

3333
### JetBrains

extensions/vscode/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "continue",
33
"icon": "media/icon.png",
4-
"version": "0.9.169",
4+
"version": "0.9.170",
55
"repository": {
66
"type": "git",
77
"url": "https://github.com/continuedev/continue"

extensions/vscode/scripts/prepackage-cross-platform.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,7 @@ async function package(target, os, arch, exe) {
142142
// Validate the all of the necessary files are present
143143
validateFilesPresent([
144144
// Queries used to create the index for @code context provider
145-
"tree-sitter/code-snippet-queries/tree-sitter-c_sharp-tags.scm",
145+
"tree-sitter/code-snippet-queries/c_sharp.scm",
146146

147147
// Queries used for @outline and @highlights context providers
148148
"tag-qry/tree-sitter-c_sharp-tags.scm",

gui/src/components/loaders/IndexingProgressBar.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -183,7 +183,7 @@ const IndexingProgressBar = ({
183183
}}
184184
></BlinkingDot>
185185
<StatusHeading>
186-
Click to resume indexing ({Math.trunc(indexingState.progress * 100)}
186+
Indexing paused ({Math.trunc(indexingState.progress * 100)}
187187
%)
188188
</StatusHeading>
189189
</FlexDiv>

0 commit comments

Comments
 (0)