Skip to content

Commit 2650122

Browse files
author
OpenClaw Assistant
committed
fix(memory-core): use Promise.allSettled in searchMemoryCorpusSupplements to prevent single supplement failure from discarding all results
Promise.all fails fast — if one corpus supplement (e.g. memory-wiki) throws, all supplement results are lost, including from healthy supplements. Switch to Promise.allSettled so surviving results are still returned when individual supplements fail.
1 parent 1d6de8d commit 2650122

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

extensions/memory-core/src/tools.shared.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -163,10 +163,10 @@ export async function searchMemoryCorpusSupplements(params: {
163163
return [];
164164
}
165165
const results = (
166-
await Promise.all(
167-
supplements.map(async (registration) => await registration.supplement.search(params)),
166+
await Promise.allSettled(
167+
supplements.map((registration) => registration.supplement.search(params)),
168168
)
169-
).flat();
169+
).flatMap((r) => (r.status === "fulfilled" ? r.value : []));
170170
return results
171171
.toSorted((left, right) => {
172172
if (left.score !== right.score) {

0 commit comments

Comments
 (0)