fix(file): set success=false when file write blocked by staleness/partial-read guard (#59600) - #59685
webtecnica wants to merge 1 commit into
Conversation
…tial-read guard (NousResearch#59600) When a file was previously read with offset/limit pagination (partial view), subsequent write_file calls returned success: true with a valid-looking diff but the write was never applied — the only indication was a _warning metadata field. This caused silent data loss: calling agents saw success: true and assumed the change landed. Fix: set result_dict["success"] = False alongside the _warning on both code paths (with and without resolved path), so calling agents can detect the failure and retry with a full read.
Related: part of the #59600 silent-persistence cluster. This PR fixes the |
|
Thanks for isolating the two Automated hermes-sweeper review found that the change is based on a contradictory premise:
The related #59600 report concerns the patch path, and the member comment identifies separate sibling PRs for that mechanism. This write-file change cannot correctly implement its stated "write was skipped" behavior without first adding and validating an actual pre-write blocking contract. This is an automated hermes-sweeper review. |
Summary
When a file was previously read with
offset/limitpagination (partial view), subsequentwrite_filecalls returnedsuccess: truewith a valid-looking diff — but the write was never applied. The only indication of failure was a_warningmetadata field, which is easy to miss.Fix
Set
result_dict["success"] = Falsealongside the_warningon both code paths (with and without resolved path), so calling agents can detect the failure and retry with a full read.Changes
tools/file_tools.pyCloses #59600