Python: Bug: Claude Opus 5.5 on Bedrock fails with "Unsupported content type" on reasoningContent blocks
Maintainer thường phản hồi trong vòng 2 ngày
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 3/5
- Thời gian dự kiến
- 1-2 ngày
- Mức phù hợp với người mới
- 65/100
Hướng nghiên cứu
The bug is in python/semantic_kernel/connectors/ai/bedrock/services/bedrock_chat_completion.py. Look at _create_chat_message_content (line 257) and _parse_content_block_delta_event (lines 346-348). The issue is that reasoningContent blocks from Claude Opus 5.5 are not handled. Compare with the Anthropic connector (anthropic_chat_completion.py lines 267-269) which skips unsupported blocks. Write a test using the provided reproduction script to verify the fix skips reasoningContent and returns the subsequent text or toolUse blocks.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
Thanks to the Python team for the Bedrock connector (#9100) and for dropping the model info check in #12395. Because of that, the Claude Opus 5.5 profile IDs load with no code change.
Describe the bug
With no thinking settings, Claude Opus 5.5 on Bedrock sends a reasoningContent block before the text or toolUse blocks whenever the model decides to think, and BedrockChatCompletion fails on it. This depends on the prompt (raw converse: "Weather in Paris? brief" 5/5, "Hello" 0/5), so a trivial prompt usually works. Opus 5 fails the same way (there even "Hello" had the block 3/3).
case (main ca40aa7, live us-east-1) |
result |
|---|---|
us.anthropic.claude-opus-5-5, "Weather in Paris? brief", non-streaming |
❌ 0/5 ServiceInvalidResponseError: Unsupported content type in the response: {'reasoningContent': ...} |
| same, streaming | ❌ 0/5 KeyError: 'toolUse' |
global.anthropic.claude-opus-5-5, both modes |
❌ 0/3 each, same errors |
us.anthropic.claude-opus-5, both modes |
❌ 0/3 each, same errors |
Opus 5.5, FunctionChoiceBehavior.Auto, model thinks before calling tools |
❌ 2/2 ServiceInvalidResponseError (auto_invoke False and True) |
| Opus 5.5, auto-invoke, model thinks on the turn after the tool result | ❌ 3/3 ServiceInvalidResponseError |
| Opus 5.5, "Hello" | ✅ 3/3 (no reasoning block) |
| Claude Haiku 4.5, Nova Lite | ✅ text returned |
Cause, in python/semantic_kernel/connectors/ai/bedrock/services/bedrock_chat_completion.py:
_create_chat_message_contenthandlestext,imageandtoolUse, and raises for anything else (L257)._parse_content_block_delta_eventtreats every delta withouttextastoolUse(L346-348). The reasoning delta is{"reasoningContent": {"text": ""}}, so it fails with aKeyError.
To Reproduce
# AWS_DEFAULT_REGION=us-east-1 python repro.py
import asyncio
from semantic_kernel.connectors.ai.bedrock import BedrockChatCompletion, BedrockChatPromptExecutionSettings
from semantic_kernel.contents import ChatHistory
async def main():
svc = BedrockChatCompletion(model_id="us.anthropic.claude-opus-5-5")
history = ChatHistory()
history.add_user_message("Weather in Paris? brief")
print(await svc.get_chat_message_content(history, BedrockChatPromptExecutionSettings(max_tokens=300)))
asyncio.run(main())
semantic_kernel.exceptions.service_exceptions.ServiceInvalidResponseError: Unsupported content type in the response: {'reasoningContent': {'reasoningText': {'text': '', 'signature': 'CA...'}}}
Failed 3/3 runs; raw converse returns ['reasoningContent', 'text'].
Tool-call rows: prompts and output
One get_weather(city) kernel function, FunctionChoiceBehavior.Auto, max_tokens=1000:
prompt A: "I am deciding between Paris, Lyon and Nice for a picnic tomorrow; think about which cities matter, check the weather where needed, and recommend one."
prompt B: "Think about whether tomorrow suits a picnic in Paris: check the weather with the tool, then recommend yes or no."
A Auto(auto_invoke=False) runs 1-2: ServiceInvalidResponseError: Unsupported content type in the response: {'reasoningContent': ...
A Auto(auto_invoke=True) runs 1-2: ServiceInvalidResponseError: Unsupported content type in the response: {'reasoningContent': ...
B Auto() runs 1-3: ServiceInvalidResponseError: Unsupported content type in the response: {'reasoningContent': ...
Expected behavior
The text reply or the tool calls come back. The connector doesn't surface reasoning today, so skipping these blocks would be enough, as the Anthropic connector does (it reads only TextBlock and tool-use blocks, anthropic_chat_completion.py L267-269). Locally that makes the ❌ rows pass, except that auto-invoke with parallel tool calls then hits the separate #14073. I have a small patch with unit tests and can open a PR.
Platform
- Language: Python
- Source: main branch (ca40aa7, 1.44.1)
- AI model: Bedrock
us.anthropic.claude-opus-5-5,global.anthropic.claude-opus-5-5,us.anthropic.claude-opus-5 - IDE: none (script)
- OS: macOS
Additional context
- Ngôn ngữ chính
- C#
- Star
- 28.6k
- Fork
- 4.8k
- Merge trung bình
- 13 giờ 24 phút
- Pull request đã merge (30 ngày)
- 11
Chuẩn bị môi trường
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của microsoft/semantic-kernel
-
python triage
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 85/100
microsoft/semantic-kernel#14491 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 2 ngày
-
python triage
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 82/100
microsoft/semantic-kernel#14490 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 2 ngày
-
Python: [Python] structured_outputs_transform reuses ChatHistory across calls (prompt pollution)Đang mởpython triage
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 88/100
microsoft/semantic-kernel#14483 · 2 bình luận ·
Maintainer thường phản hồi trong vòng 2 ngày
-
.NET python triage
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 74/100
microsoft/semantic-kernel#14482 · 3 bình luận ·
Maintainer thường phản hồi trong vòng 2 ngày
-
Python: [Python] as_agent_framework_tool drops parameter defaults (optionals become required)Đang mởpython triage
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 85/100
microsoft/semantic-kernel#14481 ·
Maintainer thường phản hồi trong vòng 2 ngày
Tất cả issue của microsoft/semantic-kernel
Issue tương tự
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 82/100
NethermindEth/nethermind#14012 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
dependencies Status: Triage
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100
json-schema-org/website#2518 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
agentic-workflows
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100
builtbybel/Flyoobe#498 ·
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 62/100
builtbybel/CrapFixer#112 ·