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
a00b07371aStephen Murray committed on 5/30/2025, 4:32:49 PM· committed by GitHubparentf725b5e
1 file changedLine totals unavailable