# agent: Allow model to respond with stringified array when it edits \(\#52303\) · gitcafe/zed

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

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

Visibility: public

Requested revision: e9d1419c23f05325049c3dfe9742f627914a1e6c

Requested commit: e9d1419c23f05325049c3dfe9742f627914a1e6c

Commit: e9d1419c23f05325049c3dfe9742f627914a1e6c

Tree: 47519b3bdff83bfe55baa261e3cd5705f9ee6d2f

Author: Bennet Bo Fenner

Committer: GitHub

## Message

````
agent: Allow model to respond with stringified array when it edits (#52303)

## Context

Sometimes the model likes to respond with `"[...]"` for the edits array,
instead of just `[...]`, which causes deserialisation to fail:
```
Failed to receive tool input: invalid type: string "[{"old_text": ..., "new_text": ...}]", expected a sequence
```

## How to Review

<!-- Help reviewers focus their attention:
- For small PRs: note what to focus on (e.g., "error handling in
foo.rs")
- For large PRs (>400 LOC): provide a guided tour — numbered list of
files/commits to read in order. (The `large-pr` label is applied
automatically.)
     - See the review process guidelines for comment conventions -->

## Self-Review Checklist

<!-- Check before requesting review: -->
- [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:

- N/A

---------

Co-authored-by: Gaauwe Rombouts <mail@grombouts.nl>
````

## Parents

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

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