@@ -50,9 +50,13 @@ async def __call__(self, tool_schema, env_index, conversation_history):
5050 tool_calls = []
5151 tool_call = MCPToolCall (tool_name = "lake_move" , arguments = {"action" : action })
5252 tool_calls .append (tool_call )
53+ if self .step_count == 3 :
54+ self .step_count += 1
55+ no_tool_call = MCPToolCall (tool_name = "_no_tool_call" , arguments = {})
56+ return [no_tool_call ], None , "stop"
5357
5458 self .step_count += 1
55- return tool_calls , None
59+ return tool_calls , None , None
5660
5761 def add_tool_response (
5862 self ,
@@ -285,11 +289,11 @@ def mock_step_side_effect(env_index, tool_call):
285289 final_cp_step = final_msg .control_plane_step
286290 assert final_cp_step ["terminated" ] == True , "Final step should be terminated"
287291 assert final_cp_step ["reward" ] == 1.0 , "Final step should have correct reward"
288- assert final_cp_step ["termination_reason" ] == "control_plane_signal " , "Should terminate via control plane"
292+ assert final_cp_step ["termination_reason" ] == "stop " , "Should terminate via control plane"
289293 assert final_cp_step ["step" ] == 2 , "Should record final step"
290294
291295 # Validate policy interaction
292- assert policy .step_count == 4 , "Policy should have been called 3 times"
296+ assert policy .step_count == 4 , "Policy should have been called 4 times"
293297
294298 @pytest .mark .asyncio
295299 async def test_rollout_trajectory_recording_with_control_plane (self ):
0 commit comments