# language_models: Treat a \`block_reason\` from Gemini as a refusal \(\#38670\) · gitcafe/zed

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

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

Visibility: public

Requested revision: e484f49ee8a3c6d9cd390beb65fdff57f05bac7d

Requested commit: e484f49ee8a3c6d9cd390beb65fdff57f05bac7d

Commit: e484f49ee8a3c6d9cd390beb65fdff57f05bac7d

Tree: c3df689b211843f1df957920e1d6894876d4d874

Author: Marshall Bowers

Committer: GitHub

## Message

```
language_models: Treat a `block_reason` from Gemini as a refusal (#38670)

This PR updates the Gemini provider to treat a
`prompt_feedback.block_reason` as a refusal, as Gemini does not seem to
return a `stop_reason` to use in this case.

<img width="639" height="162" alt="Screenshot 2025-09-22 at 4 23 15 PM"
src="https://github.com/user-attachments/assets/7a86d67e-06c1-49ea-b58f-fa80666f0f8c"
/>

Previously this would just result in no feedback to the user.

Release Notes:

- Added an error message when a Gemini response contains a
`block_reason`.
```

## Parents

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

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