@@ -751,15 +751,6 @@ def test_tool_defers_execution_started_reads_flag_only() -> None:
751751# --- ToolUseSkipped wire event (opt-in per tool) ---
752752
753753
754- class _RecordingWire :
755- def __init__ (self , captured : list [object ]) -> None :
756- self .soul_side = self
757- self ._captured = captured
758-
759- def send (self , msg : object ) -> None :
760- self ._captured .append (msg )
761-
762-
763754class DummyToolEmitsSkipped (DummyToolA ):
764755 emits_tool_use_skipped : ClassVar [bool ] = True
765756
@@ -808,39 +799,3 @@ async def call(self, arguments: object) -> ToolReturnValue:
808799 ("exit" , "Shell" ),
809800 ]
810801 assert not any (isinstance (e , type ) and e .__name__ == "ToolUseSkipped" for e in captured )
811-
812-
813- async def test_cross_step_dedup_emits_tool_use_skipped_when_opted_in (tmp_path : Path ) -> None :
814- """Cross-step duplicate calls emit ToolUseSkipped only when the tool opts in."""
815- from unittest .mock import patch
816-
817- from pythinker_code .hooks .engine import HookEngine
818- from pythinker_code .wire .types import ToolUseSkipped
819-
820- ts = PythinkerToolset ()
821- ts .add (DummyToolEmitsSkipped ())
822- ts ._hook_engine = HookEngine ([], cwd = str (tmp_path ))
823- captured : list [object ] = []
824- args = '{"a":1}'
825-
826- with patch ("pythinker_code.soul.get_wire_or_none" , return_value = _RecordingWire (captured )):
827- ts .begin_step ([])
828- task1 = ts .handle (
829- ToolCall (id = "tc1" , function = ToolCall .FunctionBody (name = "ToolA" , arguments = args ))
830- )
831- assert isinstance (task1 , asyncio .Task )
832- await task1
833- prev = ts .end_step ()
834- ts .begin_step (prev )
835- task2 = ts .handle (
836- ToolCall (id = "tc2" , function = ToolCall .FunctionBody (name = "ToolA" , arguments = args ))
837- )
838- assert isinstance (task2 , asyncio .Task )
839- await task2
840- ts .end_step ()
841-
842- skipped = [e for e in captured if isinstance (e , ToolUseSkipped )]
843- assert len (skipped ) == 1
844- assert skipped [0 ].tool_call_id == "tc2"
845- assert skipped [0 ].tool_name == "ToolA"
846- assert skipped [0 ].reason == "dedup"
0 commit comments