Draft
Conversation
added 8 commits
March 9, 2026 19:42
Controlled by screenshot_quality parameter or ANTHROPIC_SCREENSHOT_QUALITY env var. Default None (lossless PNG). Set to 1-95 for JPEG compression. Made-with: Cursor
ContentResult.to_content_blocks() was hardcoding mimeType="image/png" even when the screenshot had been JPEG-compressed, causing Anthropic API to reject the tool result with a 400 error. Made-with: Cursor
base64_to_content_block() was hardcoding media_type="image/png" and the call site was dropping content.mimeType from MCP responses. This caused Anthropic API to reject JPEG-compressed screenshots with a 400 error. Made-with: Cursor
Remove /tmp/compression_log.txt writes, _log_message_sizes function, and /tmp/compression_errors.txt writes that were used during local testing of the JPEG compression feature. Made-with: Cursor
dylanbowman314
requested changes
Mar 11, 2026
Contributor
dylanbowman314
left a comment
There was a problem hiding this comment.
add unit tests, otherwise lgetm
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.
Before there was no compression for images at all. For anthropic, at least.