Repository navigation
Python: Fix Bedrock parallel tool result handling. - #9796
Open
Patel Namraa (Namraa310806) wants to merge 1 commit into
Open
Patel Namraa (Namraa310806) wants to merge 1 commit into
Patel Namraa (Namraa310806) wants to merge 1 commit into
Conversation
Patel Namraa (Namraa310806)
temporarily deployed
to
github-app-auth
October 28, 2026 13:09 — with
GitHub Actions
Inactive
Patel Namraa (Namraa310806)
requested review from
Darren Cohen (dargilco),
Jose Alvarez (jpalvarezl) and
sophia-ramsey
as code owners
October 28, 2026 13:09
Patel Namraa (Namraa310806)
temporarily deployed
to
github-app-auth
October 28, 2026 13:09 — with
GitHub Actions
Inactive
3 tasks done
Member
|
/review |
Contributor
There was a problem hiding this comment.
MAF Automated Review — Iteration 1
Result: No findings
Scope: full PR (1 commit(s)): beb7d2916d36
Model: gpt-5.6-sol
Overview
The change keeps pending Bedrock tool-use IDs across consecutive tool messages, consumes each accepted result once, and merges those results into one Bedrock user turn. Request-local state, explicit ID matching, duplicate and unknown-result filtering, and focused regression coverage protect the pairing behavior. No publishable Critical, High, or Medium defect was established.
Reviewed the supplied pull-request change set across correctness, security/reliability, architecture, and failure behavior.
No publishable findings remained after source verification for this scope.
This branch was previously 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
When multiple tool calls are issued in parallel, their results may arrive as separate consecutive
toolmessages. The Bedrock message preparation logic could silently drop some of these results.For example, if an assistant issues two parallel tool calls (
c1andc2) and their results arrive in separate messages, processing the first result cleared the pending tool-use IDs. As a result, the second result could no longer be matched and was discarded.This causes the Bedrock request to contain an incomplete set of tool results even though all results were provided by the framework.
Description & Review Guide
What are the major changes?
toolmessages.usermessage.What is the impact of these changes?
What do you want reviewers to focus on?
Related Issue
Fixes #9794
AI Assistance
AI assistance details:
AI assistance was used to help report and explain the bug clearly, polish the issue and PR descriptions, and assist with implementation and test development. I reviewed and verified the submitted changes and take responsibility for them.
Contribution Checklist