feat: writing filetime reads to disk to persist across process being killed#5045
Closed
rodnnnney wants to merge 3 commits intoanomalyco:devfrom
Closed
feat: writing filetime reads to disk to persist across process being killed#5045rodnnnney wants to merge 3 commits intoanomalyco:devfrom
rodnnnney wants to merge 3 commits intoanomalyco:devfrom
Conversation
bot comment Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Collaborator
|
/review |
Contributor
|
lgtm |
00637c0 to
71e0ba2
Compare
f1ae801 to
08fa7f7
Compare
Contributor
|
Closing this pull request because it has had no updates for more than 60 days. If you plan to continue working on it, feel free to reopen or open a new PR. |
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.
Addressing Issue #4406
File read content saved to disk associated timestamp existed beyond solely in memory.
It would lead to double reads when you read a chat in a session -> kill it -> revisit the session and try to invoke write tool call
Steps to reproduce bug:
Read a file
read index.tsExit via
ctrl + cReinit your local -> bun dev
Go back to the session ->
bun dev+/session(find session you just readindex.tsin )Ask it to
write a comment on top of index.ts-> throws an error saying you didn't read it -> re-reads wastes tokensExample:

Solution:
We are already persisting the read tool call output. However, we didn't have a way to know how when it happened. So, we write to disk when the read time was. We were already doing the in memory check but added backup to persist across releases.
Other Conditions I considered:
Changing a file between a save that you want to edit will STILL force a re-read (intended behaviour):
