# agent: Remove last turn after a refusal \(\#31220\) · gitcafe/zed

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

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

Visibility: public

Requested revision: ceb51641142897664b38af14617af482905d0d9d

Requested commit: ceb51641142897664b38af14617af482905d0d9d

Commit: ceb51641142897664b38af14617af482905d0d9d

Tree: d62c85aee742f862c0a11937cc92e9b2135eebbb

Author: Marshall Bowers

Committer: GitHub

## Message

```
agent: Remove last turn after a refusal (#31220)

This is a follow-up to https://github.com/zed-industries/zed/pull/31217
that removes the last turn after we get a `refusal` stop reason, as
advised by the Anthropic docs.

Meant to include it in that PR, but accidentally merged it before
pushing these changes 🤦🏻‍♂️.

Release Notes:

- N/A
```

## Parents

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

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