fix(memory): requeue failed index_file paths in MemorySyncManager (#638) - #646
Closed
Tiktokaiagent wants to merge 4 commits into
Closed
fix(memory): requeue failed index_file paths in MemorySyncManager (#638)#646Tiktokaiagent wants to merge 4 commits into
Tiktokaiagent wants to merge 4 commits into
Conversation
1 task
Tiktokaiagent
force-pushed
the
fix/638-memory-sync-retry
branch
from
September 1, 2026 01:28
c4537a0 to
e77c1d7
Compare
When _do_file_sync calls index_file() and it raises, the path's mtime was already recorded in _mtimes, so the next watcher tick would skip it and never retry. The file remains on disk but searches use stale index data. Fix: pop the path from _mtimes on exception and set _dirty=True so the next watcher tick (or search-time sync) retries indexing. Fixes use-agent-os#638
…e-agent-os#638) - test_failed_index_file_is_requeued_for_retry — verifies that when index_file raises, the path is removed from _mtimes so the next watcher tick retries indexing instead of skipping it as unchanged. - uv run pytest tests/test_memory_sync_manager_architecture.py -v — 4 passed
Tiktokaiagent
force-pushed
the
fix/638-memory-sync-retry
branch
from
September 1, 2026 17:31
7cdc525 to
7ccec63
Compare
Tiktokaiagent
force-pushed
the
fix/638-memory-sync-retry
branch
from
September 1, 2026 17:49
7ccec63 to
4ec1302
Compare
Contributor
|
Closing — this does not meet the acceptance criteria in issue #638. Popping the path from self._dirty = bool(self._pending_changes or self._pending_deletes or session_sync_failed)Since the failed path is not put back on The issue asks for "keep the manager dirty while a failed path is pending" — without it, nothing triggers a search-time retry and the file waits for the poll interval. #781 was picked for this issue. Thanks for looking at it. |
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.
Summary
When
_do_file_sync()callsindex_file()and it raises, the path's mtime was already recorded in_mtimes, so the next watcher tick skips it as unchanged. The file remains on disk but searches use stale or missing index data.Fix
_mtimesonindex_file()exception so the next watcher tick sees it as new_dirty = Trueto ensure the next search-time sync retriesChanges
src/agentos/memory/sync_manager.py: 2 lines changedTests
New regression test in
tests/test_memory_sync_manager_architecture.py:Fixes #638