fix(copilot): don't auto-retry expired vision attachments, show actionable error - #334129
Open
Birarpanjot Singh Kanwer (arpankanwer) wants to merge 4 commits into
Conversation
…nable error Expired pasted images return vision_attachment_not_accessible 400 on every request. ToolCallingLoop retried the same poisoned payload 3x with 'Recovering from request error'. Skip auto-retry for this error (mirrors isContextOverflowBadRequest precedent) and surface remove-attachment / new conversation guidance. Fixes microsoft#334126
Contributor
There was a problem hiding this comment.
🟡 Changes recommended
The new retry and error-message branches need regression tests, and their duplicated classifier should be centralized.
Once you've addressed the issues Copilot identified, you can request another Copilot review.
Review details
- Files reviewed: 2/2 changed files
- Comments generated: 3
- Review effort level: Balanced
…tter tests Address Copilot review on microsoft#334129: extract shared isVisionAttachmentInaccessibleError helper in commonTypes and reuse it from ToolCallingLoop.shouldAutoRetry; cover the retry exemption and both error-message variants with tests.
Justin Chen (justschen)
approved these changes
Sep 3, 2026
Justin Chen (justschen)
left a comment
Collaborator
There was a problem hiding this comment.
awesome, thanks!
Giuseppe Cianci (Giuspepe)
approved these changes
Sep 3, 2026
Author
|
Justin Chen (@justschen) Happy to help! Thanks for the quick review. |
roblourens
approved these changes
Sep 3, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #334126
Expired pasted images return
vision_attachment_not_accessible400 on every request, including text-only prompts.ToolCallingLoop.shouldAutoRetryretried the same poisoned payload 3x with 'Recovering from request error', bricking the conversation.Changes:
toolCallingLoop.ts: skip auto-retry for vision-attachment-inaccessible BadRequest/Failed (mirrorsisContextOverflowBadRequestprecedent insearchSubagentToolCallingLoop.ts)commonTypes.ts: actionable error 'Remove the image attachment or start a new conversation' with request IDs preservedVerified with logic repro: vision errors no longer retry, generic BadRequest still retries, Success unaffected.