You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[BUG]: [playground] AWS Bedrock run crashes with JSONDecodeError when a tool result message contains plain text #16950
Running a playground prompt against an AWS Bedrock model fails immediately with json.decoder.JSONDecodeError whenever the prompt contains a TOOL message (a tool result) whose content is not valid JSON — which is the normal case for tool output.
BedrockClient._build_converse_messages builds every tool result as a JSON block, so the request cannot even be serialized (main, src/phoenix/server/api/helpers/playground_clients.py lines 1931-1933):
PlaygroundMessage content is a plain string, and tool results are usually plain text (e.g. "72 degrees and sunny"), so json.loads raises before any request is sent to AWS.
json.decoder.JSONDecodeError: Extra data: line 1 column 4 (char 3)
Expected: the tool result should be forwarded to Converse as text and the run should proceed, like the other provider clients do — the OpenAI client passes content straight into ChatCompletionToolMessageParam(content=content) and the Anthropic client into ToolResultBlockParam(content=content or ""). Bedrock's ToolResultContentBlock accepts a text field, so the string can be sent as-is.
Additional information
Reproduced on current main through BedrockClient._converse_build_request, which the playground chatCompletion subscription calls before every Converse request.
Activity