Changesets · Branches · Tags · Compare
| Changeset | f73f501f39d0100d9b88a23995f26f18cab9f6345ec25f6997444c6e34bab10b |
|---|---|
| Author | Nate Sesti <33237525+sestinj@users.noreply.github.com> · 2025-07-05 10:32 -07:00 |
| Committer | GitHub <noreply@github.com> · 2025-07-05 10:32 -07:00 |
| Parents | 401f69e2e4c4, 1b64a25f9683 |
3 files changed
modified core/context/retrieval/pipelines/BaseRetrievalPipeline.ts +4 −2
| @@ -225,9 +225,11 @@ | ||
| 225 | 225 | .join(""); |
| 226 | 226 | const parsed = JSON.parse(responseContent); |
| 227 | 227 | toolCalls = parsed.tools || []; |
| 228 | - console.log("retrieveWithTools", toolCalls); | |
| 229 | 228 | } 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 | + ); | |
| 231 | 233 | return []; |
| 232 | 234 | } |
| 233 | 235 |
modified core/indexing/LanceDbIndex.ts +18 −1
| @@ -234,6 +234,23 @@ | ||
| 234 | 234 | return results; |
| 235 | 235 | } |
| 236 | 236 | |
| 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 | + | |
| 237 | 254 | async *update( |
| 238 | 255 | tag: IndexTag, |
| 239 | 256 | results: RefreshIndexResults, |
| @@ -297,7 +314,7 @@ | ||
| 297 | 314 | const lanceRows: LanceDbRow[] = []; |
| 298 | 315 | for (const item of cachedItems) { |
| 299 | 316 | try { |
| 300 | - const vector = JSON.parse(item.vector); | |
| 317 | + const vector = this.parseVector(item.vector); | |
| 301 | 318 | const { uuid, startLine, endLine, contents } = item; |
| 302 | 319 | |
| 303 | 320 | lanceRows.push({ |
modified gui/src/redux/slices/sessionSlice.ts +0 −1
| @@ -405,7 +405,6 @@ | ||
| 405 | 405 | } |
| 406 | 406 | } else if (message.role === "thinking" && message.signature) { |
| 407 | 407 | if (lastMessage.role === "thinking") { |
| 408 | - console.log("add signature", message.signature); | |
| 409 | 408 | lastMessage.signature = message.signature; |
| 410 | 409 | } |
| 411 | 410 | } else if ( |