Skip to content

fix: improve memory_search retry logic for Node 22#75

Merged
tryweb merged 2 commits intomainfrom
fix/memory-search-retry-node22
Apr 8, 2026
Merged

fix: improve memory_search retry logic for Node 22#75
tryweb merged 2 commits intomainfrom
fix/memory-search-retry-node22

Conversation

@tryweb
Copy link
Copy Markdown
Owner

@tryweb tryweb commented Apr 8, 2026

Summary

Fix flaky test memory_delete and memory_clear reject destructive operations without confirmation on Node 22.

Problem

  • Test consistently fails on Node 22 but passes on Node 20 and 24
  • Search returns "No relevant memory found" immediately after capture
  • Race condition: data not fully written before search executes

Solution

  • Add 200ms initial delay after capture before first search
  • Increase retry count from 3 to 5
  • Increase delay between retries from 100ms to 150ms
  • Simplify retryWithDelay to return last result instead of throwing error

Verification

  • Local test passes with 555ms duration

Developer added 2 commits April 9, 2026 00:04
- Add initial 200ms delay after capture before first search attempt
- Increase retry count from 3 to 5
- Increase delay between retries from 100ms to 150ms
- Simplify retryWithDelay to return last result instead of throwing
updateMemoryUsage implements delete+add internally. When fire-and-forget,
a subsequent memory_search can land in the delete/add gap and observe
zero rows, returning 'No relevant memory found.' in Node 22.

Fix: await the update in memory_search.
Test: remove unnecessary retry/delay workaround now that root cause is fixed.
@tryweb tryweb merged commit 6ba8191 into main Apr 8, 2026
9 checks passed
@tryweb tryweb deleted the fix/memory-search-retry-node22 branch April 8, 2026 16:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant