fix(memory): await search-sync before returning results to prevent stale index (fixes #52115)#93791
Merged
vincentkoc merged 3 commits intoJun 17, 2026
Conversation
…ale 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 openclaw#52115
vincentkoc
force-pushed
the
fix/memory-search-sync-await-v2
branch
from
June 17, 2026 00:55
c691e98 to
34d15b4
Compare
Member
|
Maintainer repair applied and land-ready. Verification:
The repo-native prepare helper completed |
github-actions Bot
pushed a commit
to Desicool/openclaw
that referenced
this pull request
Jun 17, 2026
…ale index (fixes openclaw#52115) (openclaw#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 openclaw#52115 * test(memory): prove search waits for dirty sync * test(memory): align search with synchronous sync --------- Co-authored-by: Vincent Koc <[email protected]>
crh-code
pushed a commit
to crh-code/openclaw
that referenced
this pull request
Jun 18, 2026
…ale index (fixes openclaw#52115) (openclaw#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 openclaw#52115 * test(memory): prove search waits for dirty sync * test(memory): align search with synchronous sync --------- Co-authored-by: Vincent Koc <[email protected]>
This was referenced Jun 18, 2026
Closed
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.
Real behavior proof
memory_searchreturns stale results when the gateway has been running for a while becausestartAsyncSearchSyncfires off the index sync as a background task without waiting for completion.upstream/main(7d4001c), Node.js v24manager.async-search.test.tsandsearch-manager.test.tssuites, built the project withpnpm buildstartAsyncSearchSyncis nowasyncandawaits the sync operation before returning. The caller inMemoryIndexManager.search()awaits the result, ensuring the index is fresh before search results are read.