@@ -309,9 +309,9 @@ def _get_action_event(
309309 tool_call : MessageToolCall ,
310310 llm_response_id : str ,
311311 on_event : ConversationCallbackType ,
312- thought : list [TextContent ] = [] ,
312+ thought : list [TextContent ] | None = None ,
313313 reasoning_content : str | None = None ,
314- thinking_blocks : list [ThinkingBlock | RedactedThinkingBlock ] = [] ,
314+ thinking_blocks : list [ThinkingBlock | RedactedThinkingBlock ] | None = None ,
315315 responses_reasoning_item : ReasoningItemModel | None = None ,
316316 ) -> ActionEvent | None :
317317 """Converts a tool call into an ActionEvent, validating arguments.
@@ -328,9 +328,9 @@ def _get_action_event(
328328 # Persist assistant function_call so next turn has matching call_id
329329 tc_event = ActionEvent (
330330 source = "agent" ,
331- thought = thought ,
331+ thought = thought or [] ,
332332 reasoning_content = reasoning_content ,
333- thinking_blocks = thinking_blocks ,
333+ thinking_blocks = thinking_blocks or [] ,
334334 responses_reasoning_item = responses_reasoning_item ,
335335 tool_call = tool_call ,
336336 tool_name = tool_call .name ,
@@ -380,9 +380,9 @@ def _get_action_event(
380380 # Persist assistant function_call so next turn has matching call_id
381381 tc_event = ActionEvent (
382382 source = "agent" ,
383- thought = thought ,
383+ thought = thought or [] ,
384384 reasoning_content = reasoning_content ,
385- thinking_blocks = thinking_blocks ,
385+ thinking_blocks = thinking_blocks or [] ,
386386 responses_reasoning_item = responses_reasoning_item ,
387387 tool_call = tool_call ,
388388 tool_name = tool_call .name ,
@@ -401,9 +401,9 @@ def _get_action_event(
401401
402402 action_event = ActionEvent (
403403 action = action ,
404- thought = thought ,
404+ thought = thought or [] ,
405405 reasoning_content = reasoning_content ,
406- thinking_blocks = thinking_blocks ,
406+ thinking_blocks = thinking_blocks or [] ,
407407 responses_reasoning_item = responses_reasoning_item ,
408408 tool_name = tool .name ,
409409 tool_call_id = tool_call .id ,
0 commit comments