Repository navigation
perf(memory): re-index edited files when code recall finds them - #475
Merged
Merged
Conversation
The code index is refreshed at session start only, so a file the agent edits mid-session is recalled with its old text and line ranges until the next session. Code search now checks the files behind its FTS candidates (one stat each) and indexes again any that changed since they were indexed before ranking; a deleted file drops out. The file keeps all its chunks so an edit that grows it does not lose the new code to the cap. Tests that insert chunks for paths now create those files. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Merged
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.
What
Code search (per-turn recall,
memory code-search, the tool) now checks the files behind its FTS candidates and indexes again any file modified after it was indexed, then searches once more. A file that no longer exists drops out.Why
#473 refreshes the code index at session start only. A file the agent edits during the session is recalled with its old text and stale line ranges until the next session, which is exactly the code the conversation is about.
Cost
One
statper distinct candidate path (≤256 candidates, usually far fewer files); re-indexing happens only for files that actually changed.Notes
Tests
search_reindexes_candidate_files_edited_since_indexing: an edited file returns its new text and shifted line range, a deleted one disappears from hits and the index.cargo test -p whycodes-memory, fmt, clippy, budgets; memory line coverage measured locally (only the pre-existing Windows-only misses remain).🤖 Generated with Claude Code