# copilot: Fix vision request detection for follow-up messages \(\#31760\) · gitcafe/zed

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

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

Visibility: public

Requested revision: a00b07371aa2c2da3b503fdafd889a1c3761c16e

Requested commit: a00b07371aa2c2da3b503fdafd889a1c3761c16e

Commit: a00b07371aa2c2da3b503fdafd889a1c3761c16e

Tree: 5555cf61dc37f58fd550826b7b519af0a4239c17

Author: Stephen Murray

Committer: GitHub

## Message

```
copilot: Fix vision request detection for follow-up messages (#31760)

Previously, the vision request header was only set if the last message
in a thread contained an image. This caused 400 errors from the Copilot
API when sending follow-up messages in a thread that contained images in
earlier messages.

Modified the `is_vision_request` check to scan all messages in a thread
for image content instead of just the last one, ensuring the proper
header is set for the entire conversation.

Added a unit test to verify all cases function correctly.

Release Notes:

- Fix GitHub Copilot chat provider error when sending follow-up messages
in threads containing images
```

## Parents

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

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