@@ -1322,6 +1322,10 @@ def _create_and_initialize_step(
13221322 parent_step = get_current_step ()
13231323 is_root_step = parent_step is None
13241324
1325+ # #region agent log - Debug: Step creation
1326+ print (f"[OPENLAYER_DEBUG] tracer:_create_and_initialize_step | step_name={ step_name } | is_root_step={ is_root_step } | parent={ parent_step .name if parent_step else None } " , flush = True )
1327+ # #endregion
1328+
13251329 if parent_step is None :
13261330 logger .debug ("Starting a new trace..." )
13271331 current_trace = traces .Trace ()
@@ -1345,6 +1349,9 @@ def _handle_trace_completion(
13451349 on_flush_failure : Optional [OnFlushFailureCallback ] = None ,
13461350) -> None :
13471351 """Handle trace completion and data streaming."""
1352+ # #region agent log - Debug: Trace completion entry
1353+ print (f"[OPENLAYER_DEBUG] tracer:_handle_trace_completion | step_name={ step_name } | is_root_step={ is_root_step } " , flush = True )
1354+ # #endregion
13481355 if is_root_step :
13491356 logger .debug ("Ending the trace..." )
13501357 current_trace = get_current_trace ()
@@ -1398,6 +1405,9 @@ def _handle_trace_completion(
13981405 client = _get_client ()
13991406
14001407 if client :
1408+ # #region agent log - Debug: About to publish trace
1409+ print (f"[OPENLAYER_DEBUG] tracer:_handle_trace_completion | PUBLISHING | inferenceId={ trace_data .get ('inferenceId' , 'unknown' )[:8 ]} | step_name={ step_name } " , flush = True )
1410+ # #endregion
14011411 try :
14021412 response = client .inference_pipelines .data .stream (
14031413 inference_pipeline_id = inference_pipeline_id ,
0 commit comments