@@ -434,29 +434,9 @@ def test_langchain_agent(
434434 assert chat_spans [1 ]["data" ][SPANDATA .GEN_AI_RESPONSE_FINISH_REASONS ] == ["stop" ]
435435
436436 # Verify that available tools are always recorded regardless of PII settings
437- tools_found = False
438437 for chat_span in chat_spans :
439- span_data = chat_span .get ("data" , {})
440- if SPANDATA .GEN_AI_REQUEST_AVAILABLE_TOOLS in span_data :
441- tools_found = True
442- tools_data = span_data [SPANDATA .GEN_AI_REQUEST_AVAILABLE_TOOLS ]
443- assert tools_data is not None , (
444- "Available tools should always be recorded regardless of PII settings"
445- )
446-
447- if isinstance (tools_data , str ):
448- # If serialized as string, should contain tool name
449- assert "get_word_length" in tools_data
450- else :
451- # If still a list, verify structure
452- assert len (tools_data ) >= 1
453- names = [
454- tool .get ("name" ) for tool in tools_data if isinstance (tool , dict )
455- ]
456- assert "get_word_length" in names
457-
458- # Ensure we found at least one span with tools data
459- assert tools_found , "No spans found with tools data"
438+ tools_data = chat_span ["data" ][SPANDATA .GEN_AI_REQUEST_AVAILABLE_TOOLS ]
439+ assert "get_word_length" in tools_data
460440
461441
462442def test_langchain_error (sentry_init , capture_events ):
0 commit comments