Fix API embedding fallback order and cache isolation#26
Merged
AVIDS2 merged 1 commit intoAVIDS2:mainfrom Mar 27, 2026
Merged
Conversation
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
AVIDS2
approved these changes
Mar 27, 2026
Owner
AVIDS2
left a comment
There was a problem hiding this comment.
我手动对照了当前 main 和这次修复的目标,两个核心问题在主线里都是真实存在的:
MEMORIX_EMBEDDING=auto目前仍然优先本地fastembed / transformers,不会在 API embedding 已配置时优先走远端 API。- API embedding cache 与 probe-dimension cache 目前没有按完整 embedding config(尤其是
requestedDimensions)隔离,存在 stale cache 复用风险。
这条 PR 的修复范围集中、方向正确,而且把测试和文档一起补上了:
auto改为 API-first(当 embedding API 配置存在时)- embedding cache 与 probe-dimension cache 按
baseUrl + model + requestedDimensions隔离 - 保留旧 probe cache 结构的兼容读取
- 增加了对应回归测试
我已经手动复审过,批准这条 PR。感谢这次补得很扎实。
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.
Summary
This fixes two related embedding issues:
MEMORIX_EMBEDDING=autonow prefers a configured remote embedding API before falling back to local providersCloses #25.
What changed
automode when embedding API config is presentbaseUrl + model + requestedDimensionsdocs/CONFIGURATION.mdandCHANGELOG.mdVerification
Passed:
npx vitest run tests/embedding/provider.test.ts tests/embedding/api-provider.test.tsnpm run lintnpm run buildnpx vitest run tests/integration/release-blockers.test.ts tests/git/extractor.test.ts tests/git/subdir-scan.test.tsNote on remaining local failures:
tests/git/extractor.test.tstests/git/subdir-scan.test.tsThose still fail in my local fork because the assertions are hard-coded to the upstream remote (
AVIDS2/memorix) and to a specific sibling-repo layout, while this branch is running fromRaviTharuma/memorixinside a workspace that also containsCLIProxyAPI. They are unrelated to this patch.