# assistant edit tool: Fix editing files in context \(\#26751\) · gitcafe/zed

[View on GitCafe](https://git.cafe/gitcafe/zed/commit/1bf1c7223f5549217170e28eb30c8f9c8a2cd7c5)

Repository: [gitcafe/zed](https://git.cafe/gitcafe/zed)

Visibility: public

Requested revision: 1bf1c7223f5549217170e28eb30c8f9c8a2cd7c5

Requested commit: 1bf1c7223f5549217170e28eb30c8f9c8a2cd7c5

Commit: 1bf1c7223f5549217170e28eb30c8f9c8a2cd7c5

Tree: f7f382efc557defc1fce4341596e8d4764e93c37

Author: Agus Zubiaga

Committer: GitHub

## Message

```
assistant edit tool: Fix editing files in context (#26751)

When the user attached context in the thread, the editor model request
would fail because its tool use wouldn't be removed properly leading to
an API error.

Also, after an edit, we'd keep the old file snapshot in the context.
This would make the model think that the edits didn't apply and make it
go in a loop.

Release Notes:

- N/A
```

## Parents

- [ba8b9ec2c7aa8b667892b5559f59437f4fe6e78c](https://git.cafe/gitcafe/zed/commit/ba8b9ec2c7aa8b667892b5559f59437f4fe6e78c?format=markdown)

[Source at this commit](https://git.cafe/gitcafe/zed/tree/1bf1c7223f5549217170e28eb30c8f9c8a2cd7c5?format=markdown)
