.Net: Python: Bedrock connector rejects parallel tool calls (toolResult blocks not merged into one Converse message)
维护者通常 6 天内回复
评估
调研方向
从 connectors/ai/bedrock/services/bedrock_chat_completion.py:173-180 开始,将其历史记录格式与 anthropic_chat_completion.py 进行比较,后者会合并连续的并行工具消息。检查 kernel.py invoke_function_call 和现有的无网络回归测试。当并行的 toolUse 块及其 toolResult 块被分组到后续请求所需的单个 Converse 消息中时,即表示完成。
由索引模型根据 Issue 内容生成。
描述
Describe the bug
Using the Python Bedrock chat completion connector with a model that calls multiple tools in one turn (e.g. Claude Sonnet 4.5), the follow-up Converse request is rejected:
Expected toolResult blocks at messages.X.content for the following Ids: ... but found: ...
Root cause
The function-calling loop (kernel.py invoke_function_call) appends one ChatMessageContent per tool call and one per tool result. BedrockChatCompletion._prepare_chat_history_for_request (connectors/ai/bedrock/services/bedrock_chat_completion.py:173-180) maps each ChatMessageContent 1:1 to a Converse message, so N parallel tool results become N separate role:"user" messages, each with a single toolResult. Converse requires all toolResult blocks for an assistant turn in a single user message (and all toolUse blocks in a single assistant message).
Expected behavior
Chat history with parallel tool calls is usable in follow-up requests without manual merging.
Note
This is the Python counterpart of #13647 (reported for .NET). The sibling Anthropic connector already merges consecutive parallel tool messages (anthropic_chat_completion.py: formatted_messages[-1][content_key] += ...); the Bedrock connector does not. I have a minimal fix + network-free regression test ready and would be happy to open a PR.
Platform
Python, semantic_kernel.connectors.ai.bedrock.
- 主要语言
- C#
- 星标
- 28.7k
- 派生
- 4.8k
- 平均合并
- 8 天 9 小时
- 30 天内合并 PR
- 67
环境准备
在浏览器里用你自己的 GitHub 账号启动这个项目的开发容器。
- 没有 Dockerfile 或 Docker Compose 文件
- 有 Pull Request 模板
- 阅读贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
microsoft/semantic-kernel 的其他 Issue
-
.Net: gpt-image-1 is the default image model in the .NET OpenAI connector, and OpenAI shuts it down on October 23可能已有人在做 @nightcityblade 于 26 天前认领。 未关闭.NET triage
难度 2/5 1-3 小时 新手友好度 73/100
microsoft/semantic-kernel#14526 · 1 条评论 ·
维护者通常 6 天内回复
-
Python: VolatileMemoryStore.get_batch and get_nearest_matches ignore with_embeddings=False (deepcopy result is discarded)可能已有人在做 @VANDRANKI 于 27 天前认领。 未关闭python triage
难度 2/5 1-3 小时 新手友好度 84/100
microsoft/semantic-kernel#14522 ·
维护者通常 6 天内回复
-
.Net: Bug: BinaryContent does not decode the %xx escapes of a non-base64 data URI可能已有人在做 @Laurianti 于 27 天前认领。 未关闭.NET triage
难度 2/5 1-3 小时 新手友好度 76/100
microsoft/semantic-kernel#14518 ·
维护者通常 6 天内回复
-
Python: FunctionCallContent.combine_arguments drops a streamed "{}" chunk, producing invalid JSON arguments可能已有人在做 @VANDRANKI 于 28 天前认领。 未关闭python triage
难度 2/5 1-3 小时 新手友好度 82/100
microsoft/semantic-kernel#14512 · 2 条评论 ·
维护者通常 6 天内回复
-
Python: NAMED_ARG_REGEX character-class bug [${1}] lets non-$-prefixed values ({, 1, }) be silently parsed as variable references可能已有人在做 @aniketkrs 于 32 天前认领。 未关闭python triage
难度 2/5 1-3 小时 新手友好度 85/100
microsoft/semantic-kernel#14491 · 1 条评论 ·
维护者通常 6 天内回复
查看 microsoft/semantic-kernel 的全部 Issue
相似的 Issue
-
bug 優先: 低
难度 2/5 1-3 小时 新手友好度 76/100
维护者通常 1 天内回复
-
难度 1/5 1 小时以内 新手友好度 92/100
-
area-ai bug untriaged
难度 2/5 1-3 小时 新手友好度 67/100
dotnet/extensions#7893 ·
维护者通常 1 天内回复
-
难度 1/5 1 小时以内 新手友好度 72/100
-
documentation good first issue
难度 2/5 1-3 小时 新手友好度 85/100