Skip to content

fix(copilot): don't auto-retry expired vision attachments, show actionable error - #334129

Open
Birarpanjot Singh Kanwer (arpankanwer) wants to merge 4 commits into
microsoft:mainfrom
arpankanwer:fix/vision-attachment-inaccessible-334126
Open

fix(copilot): don't auto-retry expired vision attachments, show actionable error#334129
Birarpanjot Singh Kanwer (arpankanwer) wants to merge 4 commits into
microsoft:mainfrom
arpankanwer:fix/vision-attachment-inaccessible-334126

Conversation

@arpankanwer

Copy link
Copy Markdown

Fixes #334126

Expired pasted images return vision_attachment_not_accessible 400 on every request, including text-only prompts. ToolCallingLoop.shouldAutoRetry retried 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 (mirrors isContextOverflowBadRequest precedent in searchSubagentToolCallingLoop.ts)
  • commonTypes.ts: actionable error 'Remove the image attachment or start a new conversation' with request IDs preserved

Verified with logic repro: vision errors no longer retry, generic BadRequest still retries, Success unaffected.

…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
Copilot AI balanced review requested due to automatic review settings September 2, 2026 22:03

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 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

Comment thread extensions/copilot/src/extension/intents/node/toolCallingLoop.ts Outdated
Comment thread extensions/copilot/src/platform/chat/common/commonTypes.ts Outdated
Comment thread extensions/copilot/src/platform/chat/common/commonTypes.ts
…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.

@justschen Justin Chen (justschen) left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

awesome, thanks!

@arpankanwer

Copy link
Copy Markdown
Author

Justin Chen (@justschen) Happy to help! Thanks for the quick review.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Old pasted image permanently breaks later text-only requests with vision_attachment_not_accessible

5 participants