@@ -202,7 +202,6 @@ async def init_orchestration(
202202 # The orchestrator uses agent.name to identify them
203203 participant_list = list (participants .values ())
204204 cls .logger .info ("Participants for workflow: %s" , list (participants .keys ()))
205- print (f"[DEBUG] Participants for workflow: { list (participants .keys ())} " , flush = True )
206205
207206 builder = (
208207 MagenticBuilder ()
@@ -277,24 +276,17 @@ async def get_current_or_new_orchestration(
277276 cls .logger .error (
278277 "Failed to create agents for user '%s': %s" , user_id , e
279278 )
280- print (f"Failed to create agents for user '{ user_id } ': { e } " )
281279 raise
282280 try :
283281 cls .logger .info ("Initializing new orchestration for user '%s'" , user_id )
284- print (f"[DEBUG] Initializing new orchestration for user '{ user_id } '" )
285282 workflow = await cls .init_orchestration (
286283 agents , team_config , team_service .memory_context , user_id
287284 )
288285 orchestration_config .orchestrations [user_id ] = workflow
289- print (f"[DEBUG] Stored workflow for user '{ user_id } ': { workflow is not None } " )
290- print (f"[DEBUG] orchestrations keys: { list (orchestration_config .orchestrations .keys ())} " )
291286 except Exception as e :
292287 cls .logger .error (
293288 "Failed to initialize orchestration for user '%s': %s" , user_id , e
294289 )
295- print (f"Failed to initialize orchestration for user '{ user_id } ': { e } " )
296- import traceback
297- traceback .print_exc ()
298290 raise
299291 return orchestration_config .get_current_orchestration (user_id )
300292
@@ -310,13 +302,9 @@ async def run_orchestration(self, user_id: str, input_task) -> None:
310302 self .logger .info (
311303 "Starting orchestration job '%s' for user '%s'" , job_id , user_id
312304 )
313- print (f"[DEBUG] run_orchestration called for user '{ user_id } '" )
314- print (f"[DEBUG] orchestrations keys before get: { list (orchestration_config .orchestrations .keys ())} " )
315305
316306 workflow = orchestration_config .get_current_orchestration (user_id )
317- print (f"[DEBUG] workflow is None: { workflow is None } " )
318307 if workflow is None :
319- print (f"[ERROR] Orchestration not initialized for user '{ user_id } '" )
320308 raise ValueError ("Orchestration not initialized for user." )
321309 # Fresh thread per participant to avoid cross-run state bleed
322310 executors = getattr (workflow , "executors" , {})
@@ -393,7 +381,7 @@ async def run_orchestration(self, user_id: str, input_task) -> None:
393381 final_output : str | None = None
394382
395383 self .logger .info ("Starting workflow execution..." )
396- print ( f"[ORCHESTRATOR] 🚀 Starting workflow with max_rounds= { orchestration_config . max_rounds } " , flush = True )
384+
397385 last_message_id : str | None = None
398386 async for event in workflow .run_stream (task_text ):
399387 try :
@@ -448,10 +436,9 @@ async def run_orchestration(self, user_id: str, input_task) -> None:
448436 agent_name ,
449437 call_num
450438 )
451- print (f"[ORCHESTRATOR] 📤 REQUEST SENT round={ event .round_index } to agent={ agent_name } (call #{ call_num } )" , flush = True )
452439
453440 if call_num > 1 :
454- print ( f"[ORCHESTRATOR] ⚠️ WARNING: Agent '{ agent_name } ' called { call_num } times! " , flush = True )
441+ self . logger . warning ( " Agent '%s ' called %d times" , agent_name , call_num )
455442
456443 # Handle group chat response received - THIS IS WHERE AGENT RESPONSES COME
457444 elif isinstance (event , GroupChatResponseReceivedEvent ):
@@ -513,10 +500,6 @@ async def run_orchestration(self, user_id: str, input_task) -> None:
513500 final_text = final_output if final_output else ""
514501
515502 # Log agent call summary
516- print (f"\n [ORCHESTRATOR] 📊 AGENT CALL SUMMARY:" , flush = True )
517- for agent_name , count in agent_call_counts .items ():
518- status = "✅" if count == 1 else "⚠️ DUPLICATE"
519- print (f" { status } { agent_name } : called { count } time(s)" , flush = True )
520503 self .logger .info ("Agent call counts: %s" , agent_call_counts )
521504
522505 # Log results
0 commit comments