fix(cli): repair corrupted LanceDB indexes - #12914
Conversation
|
|
||
| private missing(error: unknown): boolean { | ||
| const message = error instanceof Error ? error.message : String(error) | ||
| return message.includes("Object at location ") && message.includes(".lance not found:") |
There was a problem hiding this comment.
SUGGESTION: Consider noting the LanceDB version this error text is matched against
missing() keys off LanceDB's exact error wording (Object at location ... .lance not found:), which is the only signal available since lancedb doesn't expose structured error codes — the gating is reasonable. The risk is that a future @lancedb/lancedb upgrade rewords this message, at which point self-repair silently stops triggering and init falls back to throwing. A short comment pinning the matched format to the current dependency version (0.26.x) would tell future upgraders to re-verify this string.
Reply with @kilocode-bot fix it to have Kilo Code address this issue.
| cleanupOlderThan: new Date(), | ||
| deleteUnverified: false, | ||
| }) | ||
| await table.optimize() |
There was a problem hiding this comment.
SUGGESTION: With startup optimization removed, version cleanup no longer has a periodic caller
Removing the this.optimizeTable() calls from init() makes sense — the old cleanupOlderThan: new Date() could delete data files that concurrent readers still referenced. But optimizeTable() is now only called from clearCollection(), and every upsert/delete creates a new LanceDB on-disk version, so long-lived workspaces that never clear the collection will accumulate versions unboundedly (the doc comment above still says "Should be called periodically to prevent unbounded disk space growth"). Since table.optimize() with default retention (~7 days) is far safer for concurrent readers than the old call, it may be worth keeping a throttled optimize (e.g. after a successful init, or driven by the orchestrator) — or, if running only on clear is the intended design, updating the doc comment to say so.
Reply with @kilocode-bot fix it to have Kilo Code address this issue.
Code Review SummaryStatus: 2 Issues Found | Recommendation: Address before merge Overview
The self-repair design is sound: repair is gated on LanceDB's specific missing-data-file error, retried exactly once ( Issue Details (click to expand)SUGGESTION
Files Reviewed (3 files)
Fix these issues in Kilo Cloud Reviewed by kimi-k3 · Input: 58.3K · Output: 13.3K · Cached: 411.6K Review guidance: REVIEW.md from base branch |
* fix(tui): prevent home wordmark corruption in height-constrained terminals (Kilo-Org#13069) * feat(prompt): mode-specific input placeholders (Kilo-Org#12388) * fix(tui): keep /share available to copy existing link (Kilo-Org#12532) * fix(tui): dismiss dialogs with ctrl+c (Kilo-Org#12884) * fix(app): terminal resize * fix(console): translations * fix(app): terminal PTY buffer carryover * fix(app): notifications on child sessions * Revert "feat(desktop): add WSL backend mode (Kilo-Org#12914)" This reverts commit 213a872. * release: v1.1.58 * refactor: kilo compat for v1.1.58 --------- Co-authored-by: Kit Langton <kit.langton@gmail.com> Co-authored-by: Adam <2363879+adamdotdevin@users.noreply.github.com> Co-authored-by: opencode <opencode@sst.dev>
This reverts commit 213a872.
* fix(tui): prevent home wordmark corruption in height-constrained terminals (Kilo-Org#13069) * feat(prompt): mode-specific input placeholders (Kilo-Org#12388) * fix(tui): keep /share available to copy existing link (Kilo-Org#12532) * fix(tui): dismiss dialogs with ctrl+c (Kilo-Org#12884) * fix(app): terminal resize * fix(console): translations * fix(app): terminal PTY buffer carryover * fix(app): notifications on child sessions * Revert "feat(desktop): add WSL backend mode (Kilo-Org#12914)" This reverts commit e63699f. * release: v1.1.58 * refactor: kilo compat for v1.1.58 --------- Co-authored-by: Kit Langton <kit.langton@gmail.com> Co-authored-by: Adam <2363879+adamdotdevin@users.noreply.github.com> Co-authored-by: opencode <opencode@sst.dev>
This reverts commit e63699f.
Summary
.lancedata file is missingWhy
Code indexes are derived data and can be regenerated from the workspace, but the existing recovery loop repeatedly reopened the same poisoned store. Recent schema recreation and shared worktree readers can leave a reader holding a snapshot whose data files were removed. Restricting self-repair to LanceDB’s missing-object error makes rebuilding safer than leaving indexing permanently unavailable, while unrelated initialization failures remain non-destructive.