microsoft / microsoft/vscode

Copilot retries deterministic inaccessible-image HTTP 400 four times

Open
#331,428 0 comments 0 reactions 1 assignee Claimed by @justschen View on GitHub
Dominant language
TypeScript
Stars
193k
Forks
42.4k
PR merge metrics
PR metrics pending

Description

- Copilot Chat Extension Version: 0.61.0
- VS Code Version: 1.133.0
- OS: Windows 11
- Feature: Agent mode with auto-approve
- Error: `400 vision_attachment_not_accessible`

## Summary

When a restored chat contains a stale or expired image reference, the backend returns `vision_attachment_not_accessible`. Agent mode classifies the response as retryable and resends the unchanged request three additional times. The same restored session repeats the four-attempt failure on later clean turns.

This report is specifically about retry classification and recovery UX. Existing issues already cover image expiration and durable attachment persistence: #313973, #295731, and #314556.

## Steps to reproduce

1. Resume an older image-bearing chat whose image asset is no longer accessible.
2. Send a new text-only turn with no explicit attachment.
3. Observe HTTP 400 `vision_attachment_not_accessible`.
4. Agent mode logs automatic retries 1/3, 2/3, and 3/3, producing four failed requests total.

## Expected

`vision_attachment_not_accessible` is deterministic for an unchanged request and should not trigger connectivity probing or automatic resend. The client should preserve the error and offer recovery such as removing the unavailable image or asking the user to reattach it.

## Actual

One text-only turn produces four failed requests: the initial request followed by three automatic retries of the unchanged request. No response succeeds, and the inaccessible historical image remains eligible for replay on the next turn.

## Likely code paths

- `extensions/copilot/src/extension/prompt/node/chatMLFetcher.ts`
- Generic HTTP 400 currently falls through to `ChatFailKind.Unknown`.
- Unknown WebSocket CAPI codes, including `vision_attachment_not_accessible`, become `ChatFailKind.ServerError`.
- `extensions/copilot/src/extension/intents/node/toolCallingLoop.ts`
- `shouldAutoRetry()` retries nearly every non-success response in auto-approve/autopilot, including `BadRequest`.

## Related issues

- #313973: image asset expiration / inaccessible attachments
- #325232: restored chat repeatedly fails and retries; closed as duplicate
- #295731: screenshots are not durably restored
- #314556: session-scoped local binary resource persistence

This report is narrower: deterministic attachment bad requests should not be automatically retried unchanged.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.