Skip to content

agent: Do not fail if buffer has changed on disk - #55606

Merged
bennetbo merged 1 commit into
mainfrom
optimistic-read-file-tool
May 4, 2026
Merged

agent: Do not fail if buffer has changed on disk#55606
bennetbo merged 1 commit into
mainfrom
optimistic-read-file-tool

Conversation

@bennetbo

@bennetbo bennetbo commented May 4, 2026

Copy link
Copy Markdown
Member

Previously, we would always return an error if the LLM attempted to edit a file that had been modified on disk or by the user in the meantime. However, this often led to unnecessary failures and slowdowns. So, instead of failing every time, we now attempt to resolve a match. If we don't find one, we return an error to inform the LLM that the file has been modified since the last read.

Self-Review Checklist:

  • I've reviewed my own diff for quality, security, and reliability
  • Unsafe blocks (if any) have justifying comments
  • The content is consistent with the UI/UX checklist
  • Tests cover the new/changed behavior
  • Performance impact has been considered and is acceptable

Release Notes:

  • agent: Do not fail edit tool if file has unsaved changes

@cla-bot cla-bot Bot added the cla-signed The user has signed the Contributor License Agreement label May 4, 2026
@bennetbo
bennetbo requested a review from benbrandt May 4, 2026 08:38
@zed-community-bot zed-community-bot Bot added the staff Pull requests authored by a current member of Zed staff label May 4, 2026
@bennetbo
bennetbo added this pull request to the merge queue May 4, 2026
Merged via the queue into main with commit 7de9671 May 4, 2026
41 checks passed
@bennetbo
bennetbo deleted the optimistic-read-file-tool branch May 4, 2026 08:57
ebaah46 pushed a commit to ebaah46/zed that referenced this pull request May 6, 2026
Previously, we would always return an error if the LLM attempted to edit
a file that had been modified on disk or by the user in the meantime.
However, this often led to unnecessary failures and slowdowns. So,
instead of failing every time, we now attempt to resolve a match. If we
don't find one, we return an error to inform the LLM that the file has
been modified since the last read.

Self-Review Checklist:

- [x] I've reviewed my own diff for quality, security, and reliability
- [x] Unsafe blocks (if any) have justifying comments
- [x] The content is consistent with the [UI/UX
checklist](https://github.com/zed-industries/zed/blob/main/CONTRIBUTING.md#uiux-checklist)
- [x] Tests cover the new/changed behavior
- [x] Performance impact has been considered and is acceptable

Release Notes:

- agent: Do not fail edit tool if file has unsaved changes
jonx pushed a commit to jonx/zed-aros that referenced this pull request Jul 17, 2026
Previously, we would always return an error if the LLM attempted to edit
a file that had been modified on disk or by the user in the meantime.
However, this often led to unnecessary failures and slowdowns. So,
instead of failing every time, we now attempt to resolve a match. If we
don't find one, we return an error to inform the LLM that the file has
been modified since the last read.

Self-Review Checklist:

- [x] I've reviewed my own diff for quality, security, and reliability
- [x] Unsafe blocks (if any) have justifying comments
- [x] The content is consistent with the [UI/UX
checklist](https://github.com/zed-industries/zed/blob/main/CONTRIBUTING.md#uiux-checklist)
- [x] Tests cover the new/changed behavior
- [x] Performance impact has been considered and is acceptable

Release Notes:

- agent: Do not fail edit tool if file has unsaved changes
jolutz pushed a commit to jolutz/zed that referenced this pull request Aug 8, 2026
Previously, we would always return an error if the LLM attempted to edit
a file that had been modified on disk or by the user in the meantime.
However, this often led to unnecessary failures and slowdowns. So,
instead of failing every time, we now attempt to resolve a match. If we
don't find one, we return an error to inform the LLM that the file has
been modified since the last read.

Self-Review Checklist:

- [x] I've reviewed my own diff for quality, security, and reliability
- [x] Unsafe blocks (if any) have justifying comments
- [x] The content is consistent with the [UI/UX
checklist](https://github.com/zed-industries/zed/blob/main/CONTRIBUTING.md#uiux-checklist)
- [x] Tests cover the new/changed behavior
- [x] Performance impact has been considered and is acceptable

Release Notes:

- agent: Do not fail edit tool if file has unsaved changes
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cla-signed The user has signed the Contributor License Agreement staff Pull requests authored by a current member of Zed staff

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants