Skip to content

fix: clarify refusal message when only metadata was read (#761) - #788

Merged
will-lamerton merged 1 commit into
Nano-Collective:mainfrom
DeepamJha:fix/read-file-metadata-marks-seen
Aug 9, 2026
Merged

will-lamerton merged 1 commit into
Nano-Collective:mainfrom
DeepamJha:fix/read-file-metadata-marks-seen

Conversation

@DeepamJha

Copy link
Copy Markdown
Contributor

Closes #761

Description

read_file's metadata-only response (files over 300 lines with no
line range) correctly does not call markFileSeen, since the model
hasn't actually seen the file's contents. However, the refusal
messages in diff_edit, string_replace, and write_file (which
check hasSeenFile) didn't explain why the edit was refused after
a 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_line on read_file to read
actual 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 hasSeenFile guard and refusal pattern.

Type of Change

  • Bug fix

Changeset

  • Added a changeset (pnpm changeset)

Testing

Automated Tests

  • All existing tests pass (bash scripts/test.sh)

Verified against main directly: both show the same 63 pre-existing
failures unrelated to this change (coverage threshold issues in
fetch-models.ts and 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

  • Code follows project style guidelines
  • Self-review completed
  • No breaking changes

…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

@akramcodez akramcodez left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM such a great work @DeepamJha just maintain the pr content :)

@will-lamerton
will-lamerton merged commit 62917a9 into Nano-Collective:main Aug 9, 2026
10 of 11 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

read_file metadata path skips markFileSeen, forcing an extra read before edits

3 participants