[PR #6139] fix(prebuilt): ignore nested warnings as a result of subclassing #4862

Closed
opened 2026-02-20 17:50:52 -05:00 by yindo · 0 comments
Owner

Original Pull Request: https://github.com/langchain-ai/langgraph/pull/6139

State: closed
Merged: Yes


Raised by @jacoblee93, the following was raising a cryptic deprecation warning:

import pytest
from langchain_core.language_models import FakeListChatModel
from langchain.agents import create_agent

@pytest.fixture
def test_llm():
    return FakeListChatModel(responses=["Hello from test agent!"])

@pytest.fixture
def simple_agent(test_llm):
    return create_agent(
      model=test_llm,
      tools=[],
      prompt="You are a helpful assistant."
    )

def test_basic_agent_execution(simple_agent):
    result = simple_agent.invoke({"messages": [{"role": "user", "content": "hi"}]})
    assert len(result["messages"]) == 2
    assert result["messages"][1].content == "Hello from test agent!"
<frozen abc>:106
  <frozen abc>:106: LangGraphDeprecatedSinceV10: AgentStatePydantic has been moved to langchain.agents. Please update your import to 'from langchain.agents import AgentStatePydantic'. Deprecated in LangGraph V1.0 to be removed in V2.0.

-- Docs: https://docs.pytest.org/en/stable/how-to/capture-warnings.html

This fixes that issue.

I don't actually think we should re-expose these new states in langchain.agents given that middleware agents don't use them. Need to make a call on that.

**Original Pull Request:** https://github.com/langchain-ai/langgraph/pull/6139 **State:** closed **Merged:** Yes --- Raised by @jacoblee93, the following was raising a cryptic deprecation warning: ```py import pytest from langchain_core.language_models import FakeListChatModel from langchain.agents import create_agent @pytest.fixture def test_llm(): return FakeListChatModel(responses=["Hello from test agent!"]) @pytest.fixture def simple_agent(test_llm): return create_agent( model=test_llm, tools=[], prompt="You are a helpful assistant." ) def test_basic_agent_execution(simple_agent): result = simple_agent.invoke({"messages": [{"role": "user", "content": "hi"}]}) assert len(result["messages"]) == 2 assert result["messages"][1].content == "Hello from test agent!" ``` ``` <frozen abc>:106 <frozen abc>:106: LangGraphDeprecatedSinceV10: AgentStatePydantic has been moved to langchain.agents. Please update your import to 'from langchain.agents import AgentStatePydantic'. Deprecated in LangGraph V1.0 to be removed in V2.0. -- Docs: https://docs.pytest.org/en/stable/how-to/capture-warnings.html ``` This fixes that issue. I don't actually think we should re-expose these new states in `langchain.agents` given that middleware agents don't use them. Need to make a call on that.
yindo added the pull-request label 2026-02-20 17:50:52 -05:00
yindo closed this issue 2026-02-20 17:50:52 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: langchain-ai/langgraph#4862