#11113: fix(memory-lancedb): preserve error cause in LanceDB load failure
extensions: memory-lancedb
stale
Fixes lint error on `main` - the `preserve-caught-error` rule requires the original error to be attached via `cause` when re-throwing.
### Changes
- Adds `{ cause: err }` to the `Error` constructor in `loadLanceDB()`
### Testing
- `pnpm lint` passes locally
### AI-assisted
Built with Claude. Lightly tested (lint only).
<!-- greptile_comment -->
<h2>Greptile Overview</h2>
<h3>Greptile Summary</h3>
This PR updates the LanceDB plugin’s lazy import error handling to comply with the `preserve-caught-error` lint rule by rethrowing with an `Error` that includes the original exception as `cause`.
The change is localized to `extensions/memory-lancedb/index.ts` in `loadLanceDB()`, which wraps failures from `import("@lancedb/lancedb")` (commonly missing native bindings) so downstream callers see a consistent plugin-scoped error message while still preserving the underlying error for debugging.
<h3>Confidence Score: 5/5</h3>
- This PR is safe to merge with minimal risk.
- The change is a single-line update that adds an error `cause` when rethrowing in `loadLanceDB()`, aligning with lint requirements and improving debuggability without affecting control flow or external interfaces.
- No files require special attention
<!-- greptile_other_comments_section -->
<sub>(4/5) You can add custom instructions or style guidelines for the agent [here](https://app.greptile.com/review/github)!</sub>
<!-- /greptile_comment -->
Most Similar PRs
#15896: fix(memory-lancedb): capture even with injected recall context
by aelaguiz · 2026-02-14
76.7%
#22692: fix(memory-lancedb): [P1] add missing runtime deps — plugin broken ...
by mahsumaktas · 2026-02-21
74.4%
#4036: fix: include cause detail in agent connection error diagnostic
by anajuliabit · 2026-01-29
70.2%
#12844: fix(llm-task): use correct import path for built/npm installs
by scout-wolfe · 2026-02-09
70.1%
#13176: fix: resolve llm-task module import for global installs
by striking · 2026-02-10
69.8%
#17566: memory-lancedb: support local OpenAI-compatible embeddings
by lumenradley · 2026-02-15
69.7%
#4881: docs(plugin): clarify memory-lancedb is bundled (no npm install nee...
by AverageSuami · 2026-01-30
69.3%
#3401: fix(memory-lancedb): improve autoCapture with turn-by-turn processing
by mike-nott · 2026-01-28
69.2%
#19061: fix(llm-task): correct fallback import path from src/ to dist/
by Operative-001 · 2026-02-17
68.3%
#18998: fix(llm-task): fall back to dist/ path for runEmbeddedPiAgent import
by Phineas1500 · 2026-02-17
67.7%