Elffuss BraidHub

kikocis/continue public

Merge pull request #6474 from continuedev/nate/quick-fixe

Quick fixes (codebase related)
Changesetf73f501f39d0100d9b88a23995f26f18cab9f6345ec25f6997444c6e34bab10b
AuthorNate Sesti <33237525+sestinj@users.noreply.github.com> · 2025-07-05 10:32 -07:00
CommitterGitHub <noreply@github.com> · 2025-07-05 10:32 -07:00
Parents401f69e2e4c4, 1b64a25f9683

Browse the files at this changeset

3 files changed

modified core/context/retrieval/pipelines/BaseRetrievalPipeline.ts +4 −2
@@ -225,9 +225,11 @@
225225 .join("");
226226 const parsed = JSON.parse(responseContent);
227227 toolCalls = parsed.tools || [];
228- console.log("retrieveWithTools", toolCalls);
229228 } catch (e) {
230- console.log("Failed to parse tool selection response", e);
229+ console.log(
230+ `Failed to parse tool selection response: ${toolSelectionResponse.content}\n\n`,
231+ e,
232+ );
231233 return [];
232234 }
233235
modified core/indexing/LanceDbIndex.ts +18 −1
@@ -234,6 +234,23 @@
234234 return results;
235235 }
236236
237+ /**
238+ * Due to a bug in indexing, some indexes have vectors
239+ * without the surrounding []. These would fail to parse
240+ * but this allows such existing indexes to function properly
241+ */
242+ private parseVector(vector: string): number[] {
243+ try {
244+ return JSON.parse(vector);
245+ } catch (err) {
246+ try {
247+ return JSON.parse(`[${vector}]`);
248+ } catch (err2) {
249+ throw new Error(`Failed to parse vector: ${vector}`, { cause: err2 });
250+ }
251+ }
252+ }
253+
237254 async *update(
238255 tag: IndexTag,
239256 results: RefreshIndexResults,
@@ -297,7 +314,7 @@
297314 const lanceRows: LanceDbRow[] = [];
298315 for (const item of cachedItems) {
299316 try {
300- const vector = JSON.parse(item.vector);
317+ const vector = this.parseVector(item.vector);
301318 const { uuid, startLine, endLine, contents } = item;
302319
303320 lanceRows.push({
modified gui/src/redux/slices/sessionSlice.ts +0 −1
@@ -405,7 +405,6 @@
405405 }
406406 } else if (message.role === "thinking" && message.signature) {
407407 if (lastMessage.role === "thinking") {
408- console.log("add signature", message.signature);
409408 lastMessage.signature = message.signature;
410409 }
411410 } else if (