# copilot: Fix rate limit due to Copilot-Vision-Request header \(\#30989\) · gitcafe/zed

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

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

Visibility: public

Requested revision: f915c24279f6fb13f2f9006886909d779d9cf57c

Requested commit: f915c24279f6fb13f2f9006886909d779d9cf57c

Commit: f915c24279f6fb13f2f9006886909d779d9cf57c

Tree: ae406564546c7a44061af879897bdec8e724a65d

Author: Umesh Yadav

Committer: GitHub

## Message

```
copilot: Fix rate limit due to Copilot-Vision-Request header (#30989)

Issues: #30994

I've implemented an important optimisation in response to GitHub
Copilot's recent rate limit on concurrent Vision API calls. Previously,
our system was defaulting to vision header: true for all API calls. To
prevent unnecessary calls and adhere to the new limits, I've updated our
logic: the vision header is now only sent if the current message is a
vision message, specifically when the preceding message includes an
image.

Prompt used to reproduce and verify the fix: `Give me a context for my
agent crate about. Browse my repo.`

Release Notes:

- copilot: Set Copilot-Vision-Request header based on message content
```

## Parents

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

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