v2.0.1 — Embedder bugfixes
Patch release with two embedder fixes that surfaced in real-world workflows.
Fixed
-
Embedder crashed on legacy project DBs with "no such column" — Projects whose
index.dbpredated the v1.19a / v1.15 / archive-summary migrations crashedaidex_init({ embeddings: true })withSqliteError: no such column: m.body_text(ortasks.summary/note_history.summary). The embedder opens each project'sindex.dbread-only, so the writeablemigrateLegacySchema()path never ran — and the SELECTs inembeddings/store.tsreferenced the missing columns directly.openProjectIndexDb()now opens the DB writeable briefly to apply the same idempotent ALTER TABLEs, then reopens read-only. Belt-and-suspenders:readMethods/readMethodsForFile/readAllTasks/readNoteHistorynow checkPRAGMA table_infoand substituteNULLfor missing columns, so even a locked / read-only DB no longer crashes. -
Concurrent
indexProjectcalls loaded N copies of the embedding model — When severalaidex_init(orindexProject) calls fired before the embedder was warm, every caller raced past thethis.embedder == nullcheck inRealEmbeddings.getEmbedder()and started its owncreateEmbedder(). Each load pulled the ~7 GB ONNX model into RAM. 14 parallel calls reproducibly produced ~98 GB RSS. Fix: the in-flight load is now cached as aPromise<Embedder>, so concurrent callersawaitthe same load and the model is loaded exactly once. Verified with a 14-parallel stress harness: peak RSS during the run dropped from 12 GB to 92 MB; end-of-run RSS dropped from 98 GB to 12 GB.
Added
- Regression tests (
tests/embedder-fixes.test.js) — 12 jest tests covering legacy-schema migration on each affected table, defensive read paths when columns are missing, idempotency ofopenProjectIndexDb, and the Promise-cache mechanism that prevents the N-way embedder load.
Install / Upgrade
npm install -g aidex-mcp@2.0.1
Existing project indexes are unchanged — first aidex_init after upgrade will quietly migrate any legacy column gaps.