From 550f5327763caf9d333cee25867be7640dd161fc Mon Sep 17 00:00:00 2001 From: Yinghan Ma Date: Sat, 16 Aug 2025 15:58:09 -0700 Subject: [PATCH] fix the message parsing when there is no content only tool call --- eval_protocol/mcp/execution/base_policy.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/eval_protocol/mcp/execution/base_policy.py b/eval_protocol/mcp/execution/base_policy.py index 22bad57e..819b33dd 100644 --- a/eval_protocol/mcp/execution/base_policy.py +++ b/eval_protocol/mcp/execution/base_policy.py @@ -182,7 +182,7 @@ async def _generate_live_tool_calls( # This is crucial for proper tool call ID management in add_tool_response assistant_message_for_history = { "role": "assistant", - "content": response["choices"][0]["message"]["content"], + "content": response["choices"][0]["message"].get("content", ""), } usage_stats = CompletionUsage( prompt_tokens=response["usage"]["prompt_tokens"],