@@ -83,12 +83,14 @@ def _prepare_communication_payload(
8383 encryption_handler = self ._get_encryption_handler (sender_agent )
8484 if encryption_handler and hasattr (recipient_agent , 'security_config' ) and recipient_agent .security_config :
8585 try :
86+ logger .info (f"Starting encrypted communication from '{ sender_agent .role } ' to '{ recipient_agent .role } '" )
8687 # Encrypt the message for the recipient
8788 encrypted_msg = encryption_handler .encrypt_message (
8889 message_payload ,
8990 recipient_agent .security_config .fingerprint ,
9091 message_type = "agent_communication"
9192 )
93+ logger .info (f"Encrypted communication established between '{ sender_agent .role } ' and '{ recipient_agent .role } '" )
9294 logger .debug (f"Encrypted communication from { sender_agent .role } to { recipient_agent .role } " )
9395 return encrypted_msg
9496 except Exception as e :
@@ -118,11 +120,13 @@ def _process_received_communication(
118120 encryption_handler = self ._get_encryption_handler (recipient_agent )
119121 if encryption_handler :
120122 try :
123+ logger .info (f"Starting decryption of received communication for '{ recipient_agent .role } '" )
121124 # Convert dict to EncryptedMessage if needed
122125 if isinstance (message , dict ):
123126 message = EncryptedMessage (** message )
124127
125128 decrypted = encryption_handler .decrypt_message (message )
129+ logger .info (f"Successfully decrypted communication for '{ recipient_agent .role } '" )
126130 logger .debug (f"Decrypted communication for { recipient_agent .role } " )
127131 return decrypted
128132 except Exception as e :
@@ -253,6 +257,7 @@ def _execute(
253257
254258 # Execute with processed communication context
255259 if isinstance (communication_payload , EncryptedMessage ):
260+ logger .info (f"Executing encrypted communication task for agent '{ self .sanitize_agent_name (target_agent .role )} '" )
256261 logger .debug (f"Executing encrypted communication task for agent '{ self .sanitize_agent_name (target_agent .role )} '" )
257262 # For encrypted messages, pass the encrypted payload as additional context
258263 # The target agent will need to handle decryption during execution
@@ -261,6 +266,7 @@ def _execute(
261266 enhanced_context += f"\n ADDITIONAL_CONTEXT: { context } "
262267 result = target_agent .execute_task (task_with_assigned_agent , enhanced_context )
263268 else :
269+ logger .info (f"Executing plain communication task for agent '{ self .sanitize_agent_name (target_agent .role )} '" )
264270 logger .debug (f"Executing plain communication task for agent '{ self .sanitize_agent_name (target_agent .role )} '" )
265271 result = target_agent .execute_task (task_with_assigned_agent , context )
266272
0 commit comments