Skip to content

fix(bedrock): normalize 3gp video format - #2306

Merged
chaynabors merged 1 commit into
strands-agents:mainfrom
he-yufeng:fix/bedrock-3gp-video-format
Jun 26, 2026
Merged

chaynabors merged 1 commit into
strands-agents:mainfrom
he-yufeng:fix/bedrock-3gp-video-format

Conversation

@he-yufeng

Copy link
Copy Markdown
Contributor

Summary

Fixes the Bedrock 3GP part of #2204.

Bedrock expects the video format enum to be three_gp, while common MIME/extension paths produce 3gp, 3gpp, or 3g2. The SDK currently forwards the value as-is, so a valid 3GP video content block can be rejected by the Bedrock Converse API.

This normalizes those aliases when formatting Bedrock video content blocks. Other media-format gaps from #2204 are left out of this PR.

To verify

Ran locally:

python -m pytest tests/strands/models/test_bedrock.py::test_format_request_maps_3gp_video_formats -q
python -m pytest tests/strands/models/test_bedrock.py -q
python -m ruff check src/strands/models/bedrock.py tests/strands/models/test_bedrock.py
python -m py_compile src/strands/models/bedrock.py tests/strands/models/test_bedrock.py
git diff --check

@he-yufeng
he-yufeng force-pushed the fix/bedrock-3gp-video-format branch from 5944452 to e814ac7 Compare May 20, 2026 19:09
@github-actions github-actions Bot removed the size/s label May 20, 2026
@he-yufeng
he-yufeng force-pushed the fix/bedrock-3gp-video-format branch from e814ac7 to 012dc57 Compare May 20, 2026 19:10
@github-actions github-actions Bot removed the size/s label May 20, 2026
@he-yufeng
he-yufeng force-pushed the fix/bedrock-3gp-video-format branch from 012dc57 to 444de41 Compare May 27, 2026 09:53
@github-actions github-actions Bot added size/s and removed size/s labels May 27, 2026
@he-yufeng

Copy link
Copy Markdown
Contributor Author

Rebased this onto current main and revalidated the Bedrock model path. Current head is 444de41. Validation from strands-py: uv run pytest tests/strands/models/test_bedrock.py -q --basetemp ...tmp\pytest-2306 -p no:cacheprovider: 169 passed; uv run ruff check src/strands/models/bedrock.py tests/strands/models/test_bedrock.py; python -m py_compile strands-py\src\strands\models\bedrock.py strands-py\tests\strands\models\test_bedrock.py; git diff --check origin/main...HEAD. Note: ruff format --check wants to reformat pre-existing lines in origin/main's bedrock.py as well, so I did not include unrelated formatting churn in this PR.

@yonib05 yonib05 added area-model Related to models or model providers bug Something isn't working python Pull requests that update python code labels May 27, 2026
@codecov

codecov Bot commented Jun 22, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@chaynabors
chaynabors merged commit 7bf4393 into strands-agents:main Jun 26, 2026
41 of 47 checks passed
chaynabors added a commit to chaynabors/harness-sdk that referenced this pull request Jun 26, 2026
Both surfaced on the Python 3.14 linux job after a sequence of merges today:

1. test_format_request_maps_3gp_video_formats (from strands-agents#2306) called a non-existent
   _format_request; the public method is format_request.

2. test_ingests_extracted_facts_through_add (from strands-agents#2859) called the async
   MemoryManager.init_agent without awaiting it, so the extractor was never
   wired up and assert_called_once failed.

This branch had an error being deployed

1 failed deployment
manual-approval 444de415 Deployed May 27, 2026 by he-yufeng via Trigger Strands Review #1142
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area-model Related to models or model providers bug Something isn't working python Pull requests that update python code size/s

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants