Fix Chroma ONNX Model Cache Corruption
Addresses the persistent embedding pipeline failures reported across #1104, #1105, #1110, and subsequent sessions. Three root causes identified and fixed:
Changes
- Removed nuclear
bun pm cache rmfrom bothsmart-install.jsandsync-marketplace.cjs. This was added in v10.2.2 for the now-removed sharp dependency but destroyed all cached packages, breaking the ONNX resolution chain. - Added
bun installin plugin cache directory after marketplace sync. The cache directory had apackage.jsonwith@chroma-core/default-embedas a dependency but never ran install, so the worker couldn't resolve it at runtime. - Moved HuggingFace model cache to
~/.claude-mem/models/outsidenode_modules. The ~23MB ONNX model was stored insidenode_modules/@huggingface/transformers/.cache/, so any reinstall or cache clear corrupted it. - Added self-healing retry for Protobuf parsing failures. If the downloaded model is corrupted, the cache is cleared and re-downloaded automatically on next use.
Files Changed
scripts/smart-install.js— removedbun pm cache rmscripts/sync-marketplace.cjs— removedbun pm cache rm, addedbun installin cache dirsrc/services/sync/ChromaSync.ts— moved model cache, added corruption recovery