Repository navigation
fix(workspace): a tool whose disk check decided nothing says so and changes nothing #672
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
nissa-seru
merged 4 commits into
anima-research:main
from
nissa-seru:fix/f552-pass-gave-up
Oct 22, 2026
Merged
Changes from all commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
f1585c6
fix(workspace): a file the workspace doesn't hold, under a pass that …
fe9687b
fix(workspace): edit and edit_many refuse a file the workspace holds …
d75531c
fix(workspace): readBinary answers a path it doesn't hold as delete d…
f323cf2
fix(workspace): an unchecked answer names the call to make again
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,9 @@ | ||
| - The workspace's `edit` and `edit_many` refuse a file the workspace holds | ||
| when the check of disk before them decided nothing, because the selected | ||
| branch kept changing while it ran. They store nothing, and say so, with | ||
| that reason and to make the same call again. Before, they applied to the | ||
| workspace's copy without a word, so where disk had changed they edited | ||
| text disk had moved past and left the path in conflict, and they committed | ||
| on whichever branch was selected when the check gave up. Where disk's copy | ||
| couldn't be read, an `edit` or `edit_many` still applies to the | ||
| workspace's copy and says so. |
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,9 @@ | ||
| - The workspace's `delete`, `edit` and `edit_many`, and its `readBinary` | ||
| method, no longer answer "File not found" for a path the workspace doesn't | ||
| hold when the check of disk before them decided nothing, because the | ||
| selected branch kept changing while it ran. Each now says that disk | ||
| couldn't be checked, with that reason, and to make the same call again. | ||
| Before, they answered "File not found" even when disk held the file | ||
| (#552). `readBinary` also gives `delete`'s answer for every other path the | ||
| workspace doesn't hold, such as one whose disk copy couldn't be read, where | ||
| it said "File not found" whatever the reason. |
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
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
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
High severity.
readstill answers "File not found" when its pass decided nothing.bytesOf, which thereadtool goes through (handleRead, line 3803), throws awayundecidedfromensureSyncedand callsnotInWorkspace(path, report). When the selected branch keeps changing during the pass,reportis undefined, soreadstill answersFile not found: <path>for a file disk may hold. That is the defect from #552 that this PR fixes fordelete,readBinary,editandedit_many.readis the file tool agents call most, so after this changereadBinaryandreadgive different answers for the same path under the same race, even thoughreadBinaryis documented to behave "like thereadtool". The fix is to applynotCheckedYethere too and add areadcase to the new test.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This pull request leaves
readout on purpose, as its "Out of scope" says: #465, still open, changesread's answer when its pass decided nothing. Its test "a read of a file the workspace doesn't hold, whose disk check gives up, says disk couldn't be checked" (test/workspace-three-way.test.ts:7203at #465's head754b17fa0) pins that answer as "work/b.txt is not in the workspace, and disk could not be checked (the selected branch kept changing while the scan ran). Read again to check it." That's the answer this pull request givesdeleteandreadBinary, with "Read again" where theirs says "Try again". Until #465 merges,readanswers as it does onmain.— Cuthbert-2453