fix(anthropic): map webp images explicitly - #2304
Merged
chaynabors merged 2 commits intoJun 26, 2026
Merged
Conversation
he-yufeng
had a problem deploying
to
manual-approval
May 19, 2026 04:05 — with
GitHub Actions
Failure
he-yufeng
had a problem deploying
to
manual-approval
May 19, 2026 04:05 — with
GitHub Actions
Failure
he-yufeng
force-pushed
the
fix/anthropic-webp-media-type
branch
from
May 27, 2026 09:50
4f45551 to
2ba48cb
Compare
Contributor
Author
|
Rebased this onto current main and revalidated the Anthropic model path. Current head is 2ba48cb. Validation from strands-py: uv sync --extra dev --extra anthropic; uv run pytest tests/strands/models/test_anthropic.py -q --basetemp ...tmp\pytest-2304 -p no:cacheprovider: 58 passed; uv run ruff check src/strands/models/anthropic.py tests/strands/models/test_anthropic.py; uv run ruff format --check src/strands/models/anthropic.py tests/strands/models/test_anthropic.py; python -m py_compile strands-py\src\strands\models\anthropic.py strands-py\tests\strands\models\test_anthropic.py; git diff --check origin/main...HEAD. |
he-yufeng
had a problem deploying
to
manual-approval
May 27, 2026 09:50 — with
GitHub Actions
Failure
he-yufeng
had a problem deploying
to
manual-approval
May 27, 2026 09:50 — with
GitHub Actions
Failure
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
he-yufeng
had a problem deploying
to
manual-approval
June 23, 2026 15:48 — with
GitHub Actions
Failure
chaynabors
enabled auto-merge (squash)
June 26, 2026 14:49
mehtarac
approved these changes
Jun 26, 2026
pgrayy
approved these changes
Jun 26, 2026
This was referenced Jul 7, 2026
This was referenced Jul 10, 2026
This was referenced Jul 21, 2026
Merged
This was referenced Aug 3, 2026
This was referenced Aug 4, 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 the Anthropic WebP part of #2204.
The Anthropic formatter was relying on
mimetypes.types_mapfor image media types. That map is platform/Python-install dependent, so.webpcan fall back toapplication/octet-streameven though Strands already acceptswebpas an image format.This keeps a small explicit map for the Anthropic image formats Strands supports and falls back to
mimetypesonly for unknown formats.Validation:
python -m pip install -e ".[anthropic]"python -m pytest tests/strands/models/test_anthropic.py -qpython -m ruff check src/strands/models/anthropic.py tests/strands/models/test_anthropic.pypython -m ruff format --check src/strands/models/anthropic.py tests/strands/models/test_anthropic.pygit diff --check