The agent engineering platform.
Python agentsaiai-agentsanthropicchatgptdeepagentsenterpriseframeworkgeminigenerative-ailangchainlanggraphllmmultiagentopen-sourceopenaipydanticpythonragtypescript
chore(langchain): check agents integration tests with mypy (#34308)
Christophe Bornetbbc1d46efe7f
diff --git a/libs/langchain_v1/pyproject.toml b/libs/langchain_v1/pyproject.tomlindex ae6376f8c6..c93d0a84fc 100644--- a/libs/langchain_v1/pyproject.toml+++ b/libs/langchain_v1/pyproject.toml@@ -94,7 +94,7 @@ line-length = 100strict = trueignore_missing_imports = trueenable_error_code = "deprecated"-exclude = ["tests/unit_tests/agents/*", "tests/integration_tests/agents/*"]+exclude = ["tests/unit_tests/agents/*"]# TODO: activate for 'strict' checkingdisallow_any_generics = falsediff --git a/libs/langchain_v1/tests/integration_tests/agents/middleware/test_shell_tool_integration.py b/libs/langchain_v1/tests/integration_tests/agents/middleware/test_shell_tool_integration.pyindex 82b3e1b258..7e8389f6e6 100644--- a/libs/langchain_v1/tests/integration_tests/agents/middleware/test_shell_tool_integration.py+++ b/libs/langchain_v1/tests/integration_tests/agents/middleware/test_shell_tool_integration.py@@ -7,9 +7,13 @@ from typing import Anyimport pytestfrom langchain_core.messages import HumanMessage+from langgraph._internal._typing import StateLike+from langgraph.graph.state import CompiledStateGraph+from typing_extensions import TypedDictfrom langchain.agents import create_agentfrom langchain.agents.middleware.shell_tool import ShellToolMiddleware+from langchain.agents.middleware.types import _InputAgentStatedef _get_model(provider: str) -> Any:@@ -33,7 +37,7 @@ def test_shell_tool_basic_execution(tmp_path: Path, provider: str) -> None:pytest.importorskip(f"langchain_{provider}")workspace = tmp_path / "workspace"- agent = create_agent(+ agent: CompiledStateGraph[Any, Any, _InputAgentState, Any] = create_agent(model=_get_model(provider),middleware=[ShellToolMiddleware(workspace_root=workspace)],)@@ -55,7 +59,7 @@ def test_shell_tool_basic_execution(tmp_path: Path, provider: str) -> None:def test_shell_session_persistence(tmp_path: Path) -> None:"""Test shell session state persists across multiple tool calls."""workspace = tmp_path / "workspace"- agent = create_agent(+ agent: CompiledStateGraph[Any, Any, _InputAgentState, Any] = create_agent(model=_get_model("anthropic"),middleware=[ShellToolMiddleware(workspace_root=workspace)],)@@ -82,7 +86,7 @@ def test_shell_session_persistence(tmp_path: Path) -> None:def test_shell_tool_error_handling(tmp_path: Path) -> None:"""Test shell tool captures command errors."""workspace = tmp_path / "workspace"- agent = create_agent(+ agent: CompiledStateGraph[Any, Any, _InputAgentState, Any] = create_agent(model=_get_model("anthropic"),middleware=[ShellToolMiddleware(workspace_root=workspace)],)@@ -121,7 +125,7 @@ def test_shell_tool_with_custom_tools(tmp_path: Path) -> None:"""Greet someone by name."""return f"Hello, {name}!"- agent = create_agent(+ agent: CompiledStateGraph[Any, Any, _InputAgentState, Any] = create_agent(model=_get_model("anthropic"),tools=[custom_greeting],middleware=[ShellToolMiddleware(workspace_root=workspace)],