Skip to content

Improve Edit tool: smallest old_string guidance, CRLF normalization, detailed errors, read-before-edit#1183

Merged
lewis617 merged 1 commit into
mainfrom
worktree-short-broad-fox
Jun 1, 2026
Merged

Improve Edit tool: smallest old_string guidance, CRLF normalization, detailed errors, read-before-edit#1183
lewis617 merged 1 commit into
mainfrom
worktree-short-broad-fox

Conversation

@lewis617
Copy link
Copy Markdown
Collaborator

@lewis617 lewis617 commented Jun 1, 2026

  • Add 'smallest old_string' guidance to Edit tool prompt (2-4 adjacent lines)
  • Normalize CRLF to LF before matching so models can use LF in old_string
  • Include attempted old_string in error message (truncated to 200 chars)
  • Enforce read-before-edit: reject edits to files not in filesInContext
  • Add hasFileInContext() method to MessageManager
  • Update specs/001-fs-tools with FR-020 through FR-023

…detailed errors, read-before-edit

- Add 'smallest old_string' guidance to Edit tool prompt (2-4 adjacent lines)
- Normalize CRLF to LF before matching so models can use LF in old_string
- Include attempted old_string in error message (truncated to 200 chars)
- Enforce read-before-edit: reject edits to files not in filesInContext
- Add hasFileInContext() method to MessageManager
- Update specs/001-fs-tools with FR-020 through FR-023
@lewis617 lewis617 merged commit 1a786fd into main Jun 1, 2026
1 check passed
@lewis617 lewis617 deleted the worktree-short-broad-fox branch June 1, 2026 09:40
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.

1 participant