fix: Bug: Openclaw Extension OSS Mode lacks threshold restrictions (#4106) (#4115)

This commit is contained in:
mem0-bot[bot]
2026-02-22 18:44:11 -08:00
committed by GitHub
parent ab5e930cf7
commit aa4a944b51
+9 -1
View File
@@ -268,9 +268,17 @@ class OSSProvider implements Mem0Provider {
if (options.keyword_search != null) opts.keyword_search = options.keyword_search;
if (options.reranking != null) opts.reranking = options.reranking;
if (options.source) opts.source = options.source;
if (options.threshold != null) opts.threshold = options.threshold;
const results = await this.memory.search(query, opts);
return normalizeSearchResults(results);
const normalized = normalizeSearchResults(results);
// Filter results by threshold if specified (client-side filtering as fallback)
if (options.threshold != null) {
return normalized.filter(item => (item.score ?? 0) >= options.threshold!);
}
return normalized;
}
async get(memoryId: string): Promise<MemoryItem> {