# Handle model refusal in ACP threads \(\#37383\) · gitcafe/zed

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

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

Visibility: public

Requested revision: 161d128d45e9d99c0629917f0589ce6ac1e4d000

Requested commit: 161d128d45e9d99c0629917f0589ce6ac1e4d000

Commit: 161d128d45e9d99c0629917f0589ce6ac1e4d000

Tree: 703e4c8760296912c07e11ca825a872265026888

Author: Richard Feldman

Committer: GitHub

## Message

```
Handle model refusal in ACP threads (#37383)

If the model refuses a prompt, we now:
* Show an error if it was a user prompt (and truncate it out of the
history)
* Respond with a failed tool call if the refusal was for a tool call

<img width="607" height="260" alt="Screenshot 2025-09-02 at 5 11 45 PM"
src="https://github.com/user-attachments/assets/070b5ee7-6ad6-4a63-8395-f9a5093cc40e"
/>
<img width="607" height="265" alt="Screenshot 2025-09-02 at 5 11 38 PM"
src="https://github.com/user-attachments/assets/98862586-390b-494e-b1f8-71d8341c8d9d"
/>



Release Notes:

- Improve handling of model refusals in ACP threads
```

## Parents

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

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