Changesets · Branches · Tags · Compare
| Changeset | 070dc2895891153a3f6f4e24dab008263025af380d57cbf3129ce79c64ef4b46 |
|---|---|
| Author | Nate <sestinj@gmail.com> · 2025-07-05 09:53 -07:00 |
| Committer | Nate <sestinj@gmail.com> · 2025-07-05 09:53 -07:00 |
| Parents | f840a2b4e8a4 |
2 files changed
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 ( |