55from agents .items import (
66 HandoffOutputItem ,
77 MessageOutputItem ,
8+ ReasoningItem ,
89 ToolCallOutputItem ,
910 TResponseInputItem ,
1011)
@@ -77,6 +78,12 @@ def _get_handoff_output_run_item(content: str) -> HandoffOutputItem:
7778 )
7879
7980
81+ def _get_reasoning_output_run_item () -> ReasoningItem :
82+ return ReasoningItem (
83+ agent = fake_agent (), raw_item = {"id" : "rid" , "summary" : [], "type" : "reasoning" }
84+ )
85+
86+
8087def test_empty_data ():
8188 handoff_input_data = HandoffInputData (
8289 input_history = (),
@@ -165,10 +172,12 @@ def test_removes_tools_from_new_items_and_history():
165172 _get_message_input_item ("Hello2" ),
166173 ),
167174 pre_handoff_items = (
175+ _get_reasoning_output_run_item (),
168176 _get_message_output_run_item ("123" ),
169177 _get_tool_output_run_item ("456" ),
170178 ),
171179 new_items = (
180+ _get_reasoning_output_run_item (),
172181 _get_message_output_run_item ("Hello" ),
173182 _get_tool_output_run_item ("World" ),
174183 ),
@@ -187,11 +196,13 @@ def test_removes_handoffs_from_history():
187196 _get_handoff_input_item ("World" ),
188197 ),
189198 pre_handoff_items = (
199+ _get_reasoning_output_run_item (),
190200 _get_message_output_run_item ("Hello" ),
191201 _get_tool_output_run_item ("World" ),
192202 _get_handoff_output_run_item ("World" ),
193203 ),
194204 new_items = (
205+ _get_reasoning_output_run_item (),
195206 _get_message_output_run_item ("Hello" ),
196207 _get_tool_output_run_item ("World" ),
197208 _get_handoff_output_run_item ("World" ),
0 commit comments