Skip to content

v2.0.1 — Embedder bugfixes

Choose a tag to compare

@CSCSoftware CSCSoftware released this 05 May 21:56
· 40 commits to master since this release

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.db predated the v1.19a / v1.15 / archive-summary migrations crashed aidex_init({ embeddings: true }) with SqliteError: no such column: m.body_text (or tasks.summary / note_history.summary). The embedder opens each project's index.db read-only, so the writeable migrateLegacySchema() path never ran — and the SELECTs in embeddings/store.ts referenced 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 / readNoteHistory now check PRAGMA table_info and substitute NULL for missing columns, so even a locked / read-only DB no longer crashes.

  • Concurrent indexProject calls loaded N copies of the embedding model — When several aidex_init (or indexProject) calls fired before the embedder was warm, every caller raced past the this.embedder == null check in RealEmbeddings.getEmbedder() and started its own createEmbedder(). 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 a Promise<Embedder>, so concurrent callers await the 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 of openProjectIndexDb, 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.