Repository navigation
fix: clarify refusal message when only metadata was read (#761) - #788
Merged
will-lamerton merged 1 commit intoAug 9, 2026
Merged
will-lamerton merged 1 commit into
will-lamerton merged 1 commit into
Conversation
…ore-edit guard's refusal messages in diff_edit, string_replace, and write_file didn't explain that files over 300 lines require a ranged read_file call (start_line/end_line) to actually see content, not just metadata. Updated all three messages to make this explicit so the model can recover in one step instead of guessing. Closes Nano-Collective#761
DeepamJha
requested review from
Avtrkrb,
akramcodez and
will-lamerton
as code owners
August 4, 2026 07:26
akramcodez
approved these changes
Aug 4, 2026
akramcodez
left a comment
Member
There was a problem hiding this comment.
LGTM such a great work @DeepamJha just maintain the pr content :)
2 tasks done
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.
Closes #761
Description
read_file's metadata-only response (files over 300 lines with noline range) correctly does not call
markFileSeen, since the modelhasn't actually seen the file's contents. However, the refusal
messages in
diff_edit,string_replace, andwrite_file(whichcheck
hasSeenFile) didn't explain why the edit was refused aftera metadata read, or what to do about it.
Per the maintainer's noted judgment call in the issue: kept the
metadata-response behavior as-is (not marking seen), and instead
made all three refusal messages explicit that files over 300 lines
require specifying
start_line/end_lineonread_fileto readactual content — so the model (or contributor) can recover in one
step instead of guessing why the edit was blocked.
Updated all three call sites for consistency, not just the one
implied by the issue's reproduction steps, since all three tools
share the same
hasSeenFileguard and refusal pattern.Type of Change
Changeset
pnpm changeset)Testing
Automated Tests
bash scripts/test.sh)Verified against
maindirectly: both show the same 63 pre-existingfailures unrelated to this change (coverage threshold issues in
fetch-models.tsand others); this change introduces none.Manual Testing
Reviewed the change against the reported repro steps in #761 —
message wording verified for accuracy in all three files.
Checklist