Hacktoberfest 2026:维护者为十月标记出来的 issue,仍然开放、适合新手。 浏览 Hacktoberfest issue

.Net: Python: Bedrock connector rejects parallel tool calls (toolResult blocks not merged into one Converse message)

未关闭
#14,073 1 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

维护者通常 6 天内回复

@kimnamu 已经在做这个了。

开始于 2026年6月13日。

  • #14074 来自 @kimnamu —— 未关闭

评估

难度
3/5
预计耗时
1-2 天
新手友好度
68/100
Issue 类型
缺陷
描述清晰度
描述清楚
活跃度
冷清
技术栈
aws, python
领域
ai, backend

调研方向

从 connectors/ai/bedrock/services/bedrock_chat_completion.py:173-180 开始,将其历史记录格式与 anthropic_chat_completion.py 进行比较,后者会合并连续的并行工具消息。检查 kernel.py invoke_function_call 和现有的无网络回归测试。当并行的 toolUse 块及其 toolResult 块被分组到后续请求所需的单个 Converse 消息中时,即表示完成。

由索引模型根据 Issue 内容生成。

描述

.NET python triage
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

环境准备

在 Codespaces 中打开

在浏览器里用你自己的 GitHub 账号启动这个项目的开发容器。

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

microsoft/semantic-kernel 的其他 Issue

查看 microsoft/semantic-kernel 的全部 Issue

相似的 Issue

更多 C# Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。