From 30dfa1c22d9b9d1b938484cd412a11b856e07064 Mon Sep 17 00:00:00 2001 From: Alexander Alderman Webb Date: Tue, 15 Sep 2026 16:25:48 +0200 Subject: [PATCH 1/3] ref(langchain): Stop setting gen_ai.tool.definitions on Invoke Agent spans --- sentry_sdk/integrations/langchain.py | 2 -- 1 file changed, 2 deletions(-) diff --git a/sentry_sdk/integrations/langchain.py b/sentry_sdk/integrations/langchain.py index 73d0d55575..5b52c61afb 100644 --- a/sentry_sdk/integrations/langchain.py +++ b/sentry_sdk/integrations/langchain.py @@ -1135,8 +1135,6 @@ def new_invoke(self: "Any", *args: "Any", **kwargs: "Any") -> "Any": if run_name: span.set_attribute(SPANDATA.GEN_AI_FUNCTION_ID, run_name) - _set_tools_on_span(span, tools) - # Run the agent result = f(self, *args, **kwargs) From f47fc8287b9dc6d8f78ee68119c041c85efa51ac Mon Sep 17 00:00:00 2001 From: Alexander Alderman Webb Date: Tue, 15 Sep 2026 16:26:27 +0200 Subject: [PATCH 2/3] . --- tests/integrations/langchain/test_langchain.py | 6 ------ 1 file changed, 6 deletions(-) diff --git a/tests/integrations/langchain/test_langchain.py b/tests/integrations/langchain/test_langchain.py index f7c7c18e42..939eeef2dd 100644 --- a/tests/integrations/langchain/test_langchain.py +++ b/tests/integrations/langchain/test_langchain.py @@ -3328,11 +3328,6 @@ def test_langchain_data_collection_tools( for s in spans if s["attributes"].get("sentry.op") == "gen_ai.chat" ] - invoke_agent_span = next( - s["attributes"] - for s in spans - if s["attributes"].get("sentry.op") == "gen_ai.invoke_agent" - ) assert len(chat_spans) == 2 @@ -3351,7 +3346,6 @@ def test_langchain_data_collection_tools( ): collected = key in expected_present assert (key in chat_spans[1]) is collected - assert (key in invoke_agent_span) is collected @pytest.mark.parametrize("send_default_pii", [True, False]) From 51a36b010bff937c8577ba226a29628aae119054 Mon Sep 17 00:00:00 2001 From: Alexander Alderman Webb Date: Tue, 15 Sep 2026 17:21:56 +0200 Subject: [PATCH 3/3] . --- sentry_sdk/integrations/langchain.py | 2 -- 1 file changed, 2 deletions(-) diff --git a/sentry_sdk/integrations/langchain.py b/sentry_sdk/integrations/langchain.py index 5b52c61afb..8b07ae8adc 100644 --- a/sentry_sdk/integrations/langchain.py +++ b/sentry_sdk/integrations/langchain.py @@ -1190,8 +1190,6 @@ def new_stream(self: "Any", *args: "Any", **kwargs: "Any") -> "Any": if run_name: span.set_attribute(SPANDATA.GEN_AI_FUNCTION_ID, run_name) - _set_tools_on_span(span, tools) - input = args[0].get("input") if len(args) >= 1 else None if input is not None and record_inputs: normalized_messages = normalize_message_roles([input])