From 728db10b1f38c9c56f097d2847f0330977d5eba2 Mon Sep 17 00:00:00 2001 From: Mason Daugherty Date: Fri, 9 Jan 2026 21:25:20 -0500 Subject: [PATCH] fix: suppress unintended deprecation warning (#6669) 1. Any import `from langgraph.prebuilt import X` (even `ToolNode`, `ToolRuntime`, etc.) 2. -> Loads `langgraph/prebuilt/__init__.py` 3. -> Line 3 imports `create_react_agent` from `chat_agent_executor.py` 4. -> `chat_agent_executor.py` loads completely 5. -> Line 111 evaluates: `StateSchema = TypeVar("StateSchema", bound=AgentState | AgentStatePydantic)` 6. -> Accessing `AgentStatePydantic` triggers its `@deprecated` decorator -> warning --- libs/prebuilt/langgraph/prebuilt/chat_agent_executor.py | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/libs/prebuilt/langgraph/prebuilt/chat_agent_executor.py b/libs/prebuilt/langgraph/prebuilt/chat_agent_executor.py index 42352fefb..4076cfa4b 100644 --- a/libs/prebuilt/langgraph/prebuilt/chat_agent_executor.py +++ b/libs/prebuilt/langgraph/prebuilt/chat_agent_executor.py @@ -108,8 +108,13 @@ with warnings.catch_warnings(): structured_response: StructuredResponse -StateSchema = TypeVar("StateSchema", bound=AgentState | AgentStatePydantic) -StateSchemaType = type[StateSchema] +with warnings.catch_warnings(): + warnings.filterwarnings( + "ignore", + category=LangGraphDeprecatedSinceV10, + ) + StateSchema = TypeVar("StateSchema", bound=AgentState | AgentStatePydantic) + StateSchemaType = type[StateSchema] PROMPT_RUNNABLE_NAME = "Prompt"