# agent: Overwrite files more cautiously \(\#30649\) · gitcafe/zed

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

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

Visibility: public

Requested revision: 255d8f7cf806dd67070b834eb070c67c1c2a53de

Requested commit: 255d8f7cf806dd67070b834eb070c67c1c2a53de

Commit: 255d8f7cf806dd67070b834eb070c67c1c2a53de

Tree: 6bbeec9ea36286c2b0a7e5e99b8acd2f0664ee74

Author: Oleksiy Syvokon

Committer: GitHub

## Message

```
agent: Overwrite files more cautiously (#30649)

1. The `edit_file` tool tended to use `create_or_overwrite` a bit too
often, leading to corruption of long files. This change replaces the
boolean flag with an `EditFileMode` enum, which helps Agent make a more
deliberate choice when overwriting files.

With this change, the pass rate of the new eval increased from 10% to
100%.

2. eval: Added ability to run eval on top of an existing thread. Threads
can now be loaded from JSON files in the `SerializedThread` format,
which makes it easy to use real threads as starting points for
tests/evals.

3. Don't try to restore tool cards when running in headless or eval mode
-- we don't have a window to properly do this.

Release Notes:

- N/A
```

## Parents

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

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