Home / Function/ test_truncation_indicator_present() — langchain Function Reference

test_truncation_indicator_present() — langchain Function Reference

Architecture documentation for the test_truncation_indicator_present() function in test_shell_tool.py from the langchain codebase.

Entity Profile

Dependency Diagram

graph TD
  7d297cbd_fe8f_8f47_c2d2_a8b6159516ac["test_truncation_indicator_present()"]
  f21fd460_1d0c_cb92_cfa1_eae0890e2f58["test_shell_tool.py"]
  7d297cbd_fe8f_8f47_c2d2_a8b6159516ac -->|defined in| f21fd460_1d0c_cb92_cfa1_eae0890e2f58
  1bc202d6_8b54_02e9_fadd_ff3171c38a75["_empty_state()"]
  7d297cbd_fe8f_8f47_c2d2_a8b6159516ac -->|calls| 1bc202d6_8b54_02e9_fadd_ff3171c38a75
  style 7d297cbd_fe8f_8f47_c2d2_a8b6159516ac fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

libs/langchain_v1/tests/unit_tests/agents/middleware/implementations/test_shell_tool.py lines 75–88

def test_truncation_indicator_present(tmp_path: Path) -> None:
    policy = HostExecutionPolicy(max_output_lines=5, command_timeout=5.0)
    middleware = ShellToolMiddleware(workspace_root=tmp_path / "workspace", execution_policy=policy)
    runtime = Runtime()
    state = _empty_state()
    try:
        updates = middleware.before_agent(state, runtime)
        if updates:
            state.update(cast("ShellToolState", updates))
        resources = middleware._get_or_create_resources(state)
        result = middleware._run_shell_tool(resources, {"command": "seq 1 20"}, tool_call_id=None)
        assert "Output truncated" in result
    finally:
        middleware.after_agent(state, runtime)

Domain

Subdomains

Frequently Asked Questions

What does test_truncation_indicator_present() do?
test_truncation_indicator_present() is a function in the langchain codebase, defined in libs/langchain_v1/tests/unit_tests/agents/middleware/implementations/test_shell_tool.py.
Where is test_truncation_indicator_present() defined?
test_truncation_indicator_present() is defined in libs/langchain_v1/tests/unit_tests/agents/middleware/implementations/test_shell_tool.py at line 75.
What does test_truncation_indicator_present() call?
test_truncation_indicator_present() calls 1 function(s): _empty_state.

Analyze Your Own Codebase

Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.

Try Supermodel Free