fix(memory): requeue files that fail indexing for retry - #644
Closed
s97472091-pixel wants to merge 1 commit into
Closed
fix(memory): requeue files that fail indexing for retry#644s97472091-pixel wants to merge 1 commit into
s97472091-pixel wants to merge 1 commit into
Conversation
_do_file_sync() recorded the mtime before calling store.index_file(), so a transient index failure was silently dropped: the file's mtime was already captured and later watcher ticks considered it unchanged, so the index was never retried until the file changed again or the process restarted. Return (failed_deletes, failed_indexes) from _do_file_sync() and re-enqueue failed indexes into _pending_changes (like failed deletes into _pending_deletes) so the next watcher sync retries them without requiring an mtime change, keeping the manager dirty while pending. Fixes use-agent-os#638
1 task
Contributor
|
Closing as superseded. Reviewed alongside the other two PRs on issue #638; #781 was picked. Your fix is correct — I verified it in a worktree and it keeps the manager dirty with the failed path back on This PR also currently conflicts with Thanks for the contribution — this was close. |
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.
Fixes #638
Problem
MemorySyncManager._do_file_sync()records the mtime before callingstore.index_file(). Whenindex_file()raises a transient error, the path is logged and dropped — but its mtime was already captured, so later watcher ticks consider the file unchanged and the index is never retried until the file is modified again or the process restarts.Change
_do_file_sync()now returns a(failed_deletes, failed_indexes)pair. Failed indexes are re-enqueued into_pending_changes(mirroring how failed deletes already re-enqueue into_pending_deletes), and the manager stays dirty while a failed path is pending. The next watcher sync retries the unchanged file and clears the pending state after success.Acceptance criteria coverage
index_file()fails ✅Tests
4 new offline regression tests (fake store, no network/provider): transient failure then successful retry, persistent failure stays pending+dirty, clean sync after retry does not duplicate, and delete-failure retry preserved. Full memory suite: 389 passed; ruff + mypy clean.