Repository navigation
fix(embeddings): persist model cache outside node_modules - #179
Open
HengYangDS wants to merge 5 commits into
Open
HengYangDS wants to merge 5 commits into
HengYangDS wants to merge 5 commits into
Conversation
This was referenced Sep 26, 2026
3 of 4 tasks
AndrewSpell
added a commit
to AndrewSpell/episodic-memory
that referenced
this pull request
Oct 10, 2026
Author
|
CI for this embedding cache location fix still awaits approval. The request on #180 has the current head and run link. Local validation remains in this PR’s description; hosted execution and installed use are unverified. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #173. npm updates can remove embedding model files kept under
node_modules, forcing another download. This stores the cache under Episodic Memory's durable configuration directory, with an absolute cache override and explicit offline mode passed through the existing Codex MCP allowlist.Initialization preserves the host's existing local/remote loading restrictions. Offline mode only denies remote downloads; it never enables a permission the host disabled. The BGE model, q8 dtype, query prefix, output dimensions, lazy failure handling and thread controls stay intact. Sync reports errors without a misleading success headline and retains its exit semantics.
Transformers.js configuration is process-global. Hosts sharing that module must coordinate cache and permissions; this does not provide concurrent per-model isolation. The exact Transformers.js 4.2.0 constraint is a bounded compatibility choice. A later version needs its own model/ABI qualification.
Validation
Head:
fedc911d4842aac6982f58ed8ab357617baf63d9; base:7e06519357777badd7a115d2014a7ef845904310.On macOS arm64, Node 24.19.0 (ABI 137), native npm and declared Vitest 3.2.7, six permission regressions failed before the correction. The final focused gate passed 22 tests; the full suite passed 371 tests across 66 files, including packaged MCP tests.
Seven actual-model regressions cover seeded offline loading, native host denial, empty/partial offline refusal with zero fetches, and fixture-transport recovery. Separate public Hub witnesses downloaded an empty cache in eight fetches and restored a missing ONNX file in two. Both produced finite normalized 384-dimensional embeddings with matching model-file hashes. The installation used a warmed package cache; it is not a cold package-network guarantee.
Native build output changes only the intended cache/initialization sections of the MCP bundle. Unrelated dependency churn was removed without hand-editing vendor code. Earlier socket-path and test-assertion failures remain retained; no host signing policy was changed.
Hosted Linux/Windows, later Node/Transformers versions, merge and installed-user acceptance remain pending. The existing workflow approval request on #180 covers this PR.