Skip to content

reproduction: @ai-sdk/amazon-bedrock S3 / Image URL support - #17676

Closed
lgrammel wants to merge 1 commit into
mainfrom
bug-15792-1
Closed

reproduction: @ai-sdk/amazon-bedrock S3 / Image URL support#17676
lgrammel wants to merge 1 commit into
mainfrom
bug-15792-1

Conversation

@lgrammel

Copy link
Copy Markdown
Collaborator

Bug

@ai-sdk/amazon-bedrock S3 / Image URL support

Reproduction

  • On main, @ai-sdk/amazon-bedrock 5.0.27 cannot pass S3-hosted images to Amazon Bedrock, forcing users toward memory-intensive byte or base64 inputs.
  • examples/ai-functions/src/reproduction/amazon-bedrock-s3-image-url.ts observed AI_DownloadError for an s3:// image before inference; AWS documents that the URL should be forwarded as image.source.s3Location.
  • Passing the URL through with a custom download function still produced AI_UnsupportedFunctionalityError: 'File URL data' functionality not supported, so download configuration does not resolve the failure.
  • packages/amazon-bedrock/src/amazon-bedrock-s3-image-url.reproduction.test.ts and packages/amazon-bedrock/src/__fixtures__/amazon-bedrock-s3-image-url.json assert the expected Bedrock request; the test failed before fetch instead of producing the documented s3Location request.
  • The report did not provide the exact HTTPS URL or download configuration needed to independently match its contextual HTTPS APICallError; this does not affect the reproduced S3 failure.

Relevant Documentation

Related Issues

Reproduces #15792

@lgrammel lgrammel closed this in 1f92bdb Jul 22, 2026
lgrammel added a commit that referenced this pull request Jul 22, 2026
…ed through to inference (#17693)

## Background

The published Amazon Bedrock provider rejected S3-hosted images before
inference, forcing users to load image bytes into memory.

## Root Cause

The model declared no native URL support, causing the core downloader to
reject s3:// URLs, while Bedrock message conversion also unconditionally
rejected URL-backed files. Reproduction confirmed AI_DownloadError
through generateText and AI_UnsupportedFunctionalityError through direct
provider use.

## Summary

The provider now recognizes s3:// image URLs and serializes user and
tool-result images as Bedrock s3Location sources. Bedrock image source
types and a patch changeset were updated.

## Testing

Added regression coverage for native S3 URL declaration and conversion
of user and tool-result S3 images.

## End-to-end Validation

- `AWS_REGION=us-east-1 pnpm -C examples/ai-functions exec tsx
src/reproduction/amazon-bedrock-s3-image-url.ts` using a temporary Nova
variant reached live Bedrock and returned `Provided S3Location not
found`, confirming pass-through instead of the previous pre-inference
`AI_DownloadError`.

## Related Issues

Fixes #15792

Closes #17676

Backport of #17681

Co-authored-by: tommyOtsai
<171396937+tommyOtsai@users.noreply.github.com>
lgrammel added a commit that referenced this pull request Jul 22, 2026
…ed through to inference (#17694)

## Background

The published Amazon Bedrock provider rejected S3-hosted images before
inference, forcing users to load image bytes into memory.

## Root Cause

The model declared no native URL support, causing the core downloader to
reject s3:// URLs, while Bedrock message conversion also unconditionally
rejected URL-backed files. Reproduction confirmed AI_DownloadError
through generateText and AI_UnsupportedFunctionalityError through direct
provider use.

## Summary

The provider now recognizes s3:// image URLs and serializes user and
tool-result images as Bedrock s3Location sources. Bedrock image source
types and a patch changeset were updated.

## Testing

Added regression coverage for native S3 URL declaration and conversion
of user and tool-result S3 images.

## End-to-end Validation

- `AWS_REGION=us-east-1 pnpm -C examples/ai-functions exec tsx
src/reproduction/amazon-bedrock-s3-image-url.ts` using a temporary Nova
variant reached live Bedrock and returned `Provided S3Location not
found`, confirming pass-through instead of the previous pre-inference
`AI_DownloadError`.

## Related Issues

Fixes #15792

Closes #17676

Backport of #17681

Co-authored-by: tommyOtsai
<171396937+tommyOtsai@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant