{{ message }}
Repository navigation
Python: fix(bedrock): merge per-call client kwargs into the Converse request - #9345
Merged
Eduard van Valkenburg (eavanvalkenburg) merged 2 commits intoOct 15, 2026
Conversation
…request _prepare_options accepted **kwargs but never used them, so anything passed through client_kwargs (guardrailConfig, requestMetadata, ...) was silently dropped. Merge them before the prompt-ARN cleanup so that branch still strips fields Converse rejects, mirroring the other clients. Fixes microsoft#9344 Signed-off-by: Manohar Paturi <186662190+ManoharPaturi@users.noreply.github.com>
Manohar Paturi (ManoharPaturi)
requested review from
SergeyMenshykh,
Tao Chen (TaoChenOSU),
Eduard van Valkenburg (eavanvalkenburg),
Giles Odigwe (giles17),
Jose Alvarez (jpalvarezl),
Evan Mattson (moonbox3),
Roger Barreto (rogerbarreto),
sophia-ramsey and
westey (westey-m)
as code owners
October 13, 2026 14:39
Manohar Paturi (ManoharPaturi)
deployed
to
github-app-auth
October 13, 2026 14:39 — with
GitHub Actions
Active
Manohar Paturi (ManoharPaturi)
deployed
to
github-app-auth
October 13, 2026 14:42 — with
GitHub Actions
Active
Contributor
There was a problem hiding this comment.
🟡 Changes recommended
Prompt cleanup checks the model selected before client_kwargs can override modelId.
1 open finding
What changed in this PR
Fixes Bedrock per-call client_kwargs being dropped from Converse requests.
Changes:
- Merges Bedrock-native kwargs into request options.
- Adds regression coverage for guardrail and metadata kwargs.
🧠 Review effort: Balanced
💡 Add a code-review agent skill for context-aware, tailored reviews. Learn more in the docs.
Signed-off-by: Manohar Paturi <186662190+ManoharPaturi@users.noreply.github.com>
Manohar Paturi (ManoharPaturi)
deployed
to
github-app-auth
October 13, 2026 14:46 — with
GitHub Actions
Active
Contributor
Author
Eduard van Valkenburg (eavanvalkenburg)
approved these changes
Oct 15, 2026
This branch was successfully deployed
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.


Motivation & Context
BedrockChatClient._prepare_optionsaccepted**kwargsbut never used them, so per-call client kwargs passed throughclient_kwargswere silently dropped from the Converse request.guardrailConfig,requestMetadataand friends just vanished. Issue #9344 has the repro.Description & Review Guide
run_options.update(kwargs)at the end of_prepare_options, placed before the prompt-ARN cleanup so that branch still strips fields Converse rejects when they arrive through kwargs.Related Issue
Fixes #9344
AI Assistance
Contribution Checklist
breaking changelabel (or add "[BREAKING]" to the title prefix, before or after any language prefix) — a workflow keeps the label and title prefix in sync automatically.