Skip to content

Prepare standard request compression adoption for the Bedrock Runtime client - #111

Draft
gouveags wants to merge 4 commits into
aws:developfrom
gouveags:feat/request-compression-adoption
Draft

gouveags wants to merge 4 commits into
aws:developfrom
gouveags:feat/request-compression-adoption

Conversation

@gouveags

@gouveags gouveags commented Oct 19, 2026 •

Copy link
Copy Markdown

Related issue: #110.

Scope

Prepare Bedrock Runtime client tests and usage guidance for the standard request-compression settings inherited from Smithy Python: disable_request_compression and request_min_compression_size_bytes (default 10240; inclusive range 0 through 10485760).

This draft changes only the README, compression regression tests and a feature changelog entry. All generated source matches the PR base. The compact-schema/model migration is excluded and left to the normal SDK regeneration process.

Tests cover defaults, threshold endpoints, environment configuration and client-setting precedence. They also check that Converse, ConverseStream, InvokeModel and InvokeModelWithResponseStream remain uncompressed at both default and zero thresholds when the service model does not advertise compression.

Prerequisites

This PR is not ready to merge. It requires:

  1. Smithy request compression to merge and be released.
  2. Normal SDK client regeneration compatible with that runtime, plus a minimum-dependency update.
  3. Re-running these client tests and static checks against the resulting released dependencies.

No compatibility shim, copied compression engine, dependency bump or manual service metadata is introduced here. Current declared dependencies do not provide these compression controls; the README marks the example as pending upstream support.

Bedrock Runtime additionally needs service acceptance and upstream compression metadata before requests can actually be compressed. Mantle's provider-compatible APIs require separate service/client integration. Compression can reduce upload bytes; this PR establishes neither endpoint acceptance nor a latency improvement.

Validation

Revision: d9ad0b2e9a820eeda5b37a574443d5dd0690b3b1.

  • Verified zero generated-source diff against base 8f209d245501792c7b18ce197c194170ca4d6564.
  • Ruff lint/format on the retained test file and git diff --check passed.
  • Before removing the generated migration, the unchanged 13-test compression suite passed with local Smithy 1ae921bac24a6ecebc61b8b43cd36382d359b4ec.
  • After removal, the suite cannot collect against that runtime: existing generated models call APIOperation(schema=...), while the newer runtime requires static_schema=.... This is the expected unresolved regeneration prerequisite, not a passing final-checkout test result.
  • Final runtime tests and strict typing remain pending those upstream prerequisites. Live AWS tests, endpoint acceptance and the supported-Python matrix were not run.

Re-run from clients/aws-sdk-bedrock-runtime once compatible runtime dependencies and normally regenerated client source are available:

PYTHONPATH=src python -m pytest tests/test_request_compression.py -q
pyright --project pyproject.toml src tests

Related contribution: botocore threshold-range fix, independent of this draft.

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

@gouveags gouveags changed the title Adopt shared request-compression configuration in the Bedrock Runtime client Adopt standard request compression configuration in the Bedrock Runtime client Oct 26, 2026
@gouveags
gouveags marked this pull request as draft October 26, 2026 14:56
@gouveags gouveags changed the title Adopt standard request compression configuration in the Bedrock Runtime client Prepare standard request compression adoption for the Bedrock Runtime client Oct 26, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant