Files
langgraph/libs
Sydney RunkleandGitHub fdebb1dd18 fix(prebuilt): ignore nested warnings as a result of subclassing (#6139)
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.
2025-09-14 19:32:31 -04:00
..