You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
langModelServer silently drops PDF/document blocks from inbound Anthropic requests #325672
langModelServer exposes an Anthropic-compatible /v1/messages endpoint (langModelServer.ts:49), and AnthropicAdapter.parseRequest converts the inbound body via anthropicMessagesToRawMessages (anthropicAdapter.ts:42).
That converter handles text, image, thinking, redacted_thinking, tool_use, and tool_result. Anthropic document blocks (e.g. base64 PDFs) fall into the catch-all branch in anthropicMessageConverter.ts:
}else{// thinking or unsupported types are ignored}
Inside tool_result content, only text and image are mapped, so document is dropped there too.
Impact: an external agent that POSTs a PDF as a document block gets no error and no warning — the PDF is discarded before the model sees it, and the model answers as if the document was never attached. Silent data loss.
Notes:
Pre-existing; not introduced by Fix BYOK Anthropic endpoints sending PDFs as image blocks #324960 (that PR fixes the outbound converter, apiMessageToAnthropicMessage). - The BYOK provider path is unaffected: it sends convertedMessages directly to Anthropic and only uses the reverse converter for logging (anthropicProvider.ts:130).
Joaquín Ruales (@jruales) with a BYOK anthropic model, attach a PDF and ask it questions related to the PDF. Previously, the model would fail to see the pdf
This bug has been fixed in the latest release of VS Code Insiders!
Bhavya U (@bhavyaus), you can help us out by commenting /verified if things are now working as expected.
If things still don't seem right, please ensure you're on version 5918810 of Insiders (today's or later - you can use Help: About in the command palette to check), and leave a comment letting us know what isn't working as expected.
Activity
jruales commentedon Aug 3, 2026
Bhavya U (@bhavyaus) how do I do this? "an external agent that POSTs a PDF as a document block"
bhavyaus commentedon Aug 3, 2026
Joaquín Ruales (@jruales) with a BYOK anthropic model, attach a PDF and ask it questions related to the PDF. Previously, the model would fail to see the pdf
jruales commentedon Aug 3, 2026
The description above says "The BYOK provider path is unaffected", so shouldn't it be the non-BYOK version to be tested?
bhavyaus commentedon Aug 3, 2026
Fixed. Please ignore the notes.
vs-code-engineering commentedon Aug 3, 2026
This bug has been fixed in the latest release of VS Code Insiders!
Bhavya U (@bhavyaus), you can help us out by commenting
/verifiedif things are now working as expected.If things still don't seem right, please ensure you're on version 5918810 of Insiders (today's or later - you can use
Help: Aboutin the command palette to check), and leave a comment letting us know what isn't working as expected.Happy Coding!
bhavyaus commentedon Aug 4, 2026
/verified