test_async_can_jump_to_integration() — langchain Function Reference
Architecture documentation for the test_async_can_jump_to_integration() function in test_decorators.py from the langchain codebase.
Entity Profile
Dependency Diagram
graph TD 58d6df01_ca59_3024_d92c_5c03378adcf6["test_async_can_jump_to_integration()"] 85a104a3_11cf_6539_d0c0_ba69a17a41d4["test_decorators.py"] 58d6df01_ca59_3024_d92c_5c03378adcf6 -->|defined in| 85a104a3_11cf_6539_d0c0_ba69a17a41d4 68028dcd_ea5b_7d3a_0d75_c9ebd1cef92b["before_model()"] 58d6df01_ca59_3024_d92c_5c03378adcf6 -->|calls| 68028dcd_ea5b_7d3a_0d75_c9ebd1cef92b style 58d6df01_ca59_3024_d92c_5c03378adcf6 fill:#6366f1,stroke:#818cf8,color:#fff
Relationship Graph
Source Code
libs/langchain_v1/tests/unit_tests/agents/middleware/core/test_decorators.py lines 481–506
async def test_async_can_jump_to_integration() -> None:
"""Test can_jump_to parameter in a full agent with async middleware."""
calls = []
@before_model(can_jump_to=["end"])
async def async_early_exit(
state: AgentState[Any], *_args: Any, **_kwargs: Any
) -> dict[str, Any] | None:
calls.append("async_early_exit")
if state["messages"][0].content == "exit":
return {"jump_to": "end"}
return None
agent = create_agent(model=FakeToolCallingModel(), middleware=[async_early_exit])
# Agent is already compiled
# Test with early exit
result = await agent.ainvoke({"messages": [HumanMessage("exit")]})
assert calls == ["async_early_exit"]
assert len(result["messages"]) == 1
# Test without early exit
calls.clear()
result = await agent.ainvoke({"messages": [HumanMessage("hello")]})
assert calls == ["async_early_exit"]
assert len(result["messages"]) > 1
Domain
Subdomains
Calls
Source
Frequently Asked Questions
What does test_async_can_jump_to_integration() do?
test_async_can_jump_to_integration() is a function in the langchain codebase, defined in libs/langchain_v1/tests/unit_tests/agents/middleware/core/test_decorators.py.
Where is test_async_can_jump_to_integration() defined?
test_async_can_jump_to_integration() is defined in libs/langchain_v1/tests/unit_tests/agents/middleware/core/test_decorators.py at line 481.
What does test_async_can_jump_to_integration() call?
test_async_can_jump_to_integration() calls 1 function(s): before_model.
Analyze Your Own Codebase
Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.
Try Supermodel Free