openclaw/extensions/memory-core
liuhao1024 b3a1472875
fix(memory): await search-sync before returning results to prevent stale index (fixes #52115) (#93791)
* fix(memory): await search-sync before returning results to prevent stale index

When the gateway process has been running for a while, memory_search
returns stale results because startAsyncSearchSync fires off the index
sync as a background task (void ... .catch()) without waiting for it
to complete. Search results are then read from the old index state.

Change startAsyncSearchSync from sync/fire-and-forget to async/await
so that the index is synced before search results are returned. This
ensures memory_search reflects the current filesystem state, matching
the behavior of the CLI  command which creates
a fresh manager each time.

Fixes #52115

* test(memory): prove search waits for dirty sync

* test(memory): align search with synchronous sync

---------

Co-authored-by: Vincent Koc <25068+vincentkoc@users.noreply.github.com>
2026-06-17 09:04:24 +08:00
..
src fix(memory): await search-sync before returning results to prevent stale index (fixes #52115) (#93791) 2026-06-17 09:04:24 +08:00
api.ts fix: store memory-core dreams state in sqlite (#91056) 2026-06-06 18:38:45 -07:00
cli-metadata.ts docs: document large extension sources 2026-06-04 21:40:44 -04:00
cli.ts docs: document large extension sources 2026-06-04 21:40:44 -04:00
doctor-contract-api.test.ts refactor: store Zalo hosted media in plugin state 2026-06-06 22:56:48 -07:00
doctor-contract-api.ts refactor: store Zalo hosted media in plugin state 2026-06-06 22:56:48 -07:00
index.test.ts docs: document large extension sources 2026-06-04 21:40:44 -04:00
index.ts fix(memory): keep memory_search in transient qmd mode (#92639) 2026-06-13 14:14:54 +00:00
manager-runtime.ts docs: document large extension sources 2026-06-04 21:40:44 -04:00
openclaw.plugin.json fix(agents): retry empty post-tool final turns (#93073) 2026-06-15 00:08:57 -07:00
package.json chore(release): sync main to 2026.6.8 2026-06-17 07:25:30 +08:00
runtime-api.ts fix: store memory-core dreams state in sqlite (#91056) 2026-06-06 18:38:45 -07:00
tsconfig.json