feat: add BedrockTransport + wire all Bedrock transport paths - #27075
Closed
Master-Rensei wants to merge 1 commit into
Closed
feat: add BedrockTransport + wire all Bedrock transport paths#27075Master-Rensei wants to merge 1 commit into
Master-Rensei wants to merge 1 commit into
Conversation
Add BedrockTransport wrapping agent/bedrock_adapter.py behind the ProviderTransport ABC. Fourth and final transport. Wire ALL transport methods to production paths in run_agent.py: - build_kwargs: _build_api_kwargs bedrock branch (L6713) - normalize_response: main normalize loop, new bedrock_converse branch (handles both raw boto3 dicts and already-normalized SimpleNamespace) - validate_response: response validation, new bedrock_converse branch - finish_reason: new bedrock_converse branch in finish_reason extraction The truncation path (L9588) intentionally groups bedrock with chat_completions — both have the same response.choices shape because normalize_converse_response runs at the dispatch site. 17 new tests. 231 bedrock/converse/transport tests pass (0 failures). PR 6 of the provider transport refactor.
Collaborator
|
Duplicate of #13814 (already merged). This PR reopens a previously closed fork branch, but the feature (BedrockTransport) was already landed via a salvage PR. |
2 tasks
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.
Summary
PR 6 of the provider transport refactor (PRs 1-5: #12975, #13073, #13366, #13430, #13447).
Fourth and final transport — completes the transport layer with all 4 api_modes covered. All transport methods wired to production paths.
What ships
agent/transports/bedrock.py— BedrockTransport (155 lines)All transport methods wired:
build_kwargs()_build_api_kwargsbedrock branch (L6713)normalize_response()bedrock_conversebranch (L10828)validate_response()bedrock_conversebranch (L9389)finish_reasonbedrock_conversebranch (L9559)convert_messages()/convert_tools()build_kwargs()normalize_response()handles two shapes: raw boto3 dicts (from direct converse calls) and already-normalized SimpleNamespace with .choices (from the dispatch site at L5169).The truncation path (L9588) intentionally groups bedrock with chat_completions — both have the same
response.choicesshape becausenormalize_converse_responsealready runs at the dispatch site.Transport coverage — complete
Test plan