_empty_state() — langchain Function Reference
Architecture documentation for the _empty_state() function in test_shell_tool.py from the langchain codebase.
Entity Profile
Dependency Diagram
graph TD 1bc202d6_8b54_02e9_fadd_ff3171c38a75["_empty_state()"] f21fd460_1d0c_cb92_cfa1_eae0890e2f58["test_shell_tool.py"] 1bc202d6_8b54_02e9_fadd_ff3171c38a75 -->|defined in| f21fd460_1d0c_cb92_cfa1_eae0890e2f58 b59c26d0_28af_7afe_c898_0027616440fd["test_executes_command_and_persists_state()"] b59c26d0_28af_7afe_c898_0027616440fd -->|calls| 1bc202d6_8b54_02e9_fadd_ff3171c38a75 c17b03c1_b453_f139_05ae_208fa059c86c["test_restart_resets_session_environment()"] c17b03c1_b453_f139_05ae_208fa059c86c -->|calls| 1bc202d6_8b54_02e9_fadd_ff3171c38a75 7d297cbd_fe8f_8f47_c2d2_a8b6159516ac["test_truncation_indicator_present()"] 7d297cbd_fe8f_8f47_c2d2_a8b6159516ac -->|calls| 1bc202d6_8b54_02e9_fadd_ff3171c38a75 3705c4c5_c468_1a63_c8a7_e783d4c9e763["test_timeout_returns_error()"] 3705c4c5_c468_1a63_c8a7_e783d4c9e763 -->|calls| 1bc202d6_8b54_02e9_fadd_ff3171c38a75 3bad62a8_53b2_0104_58f8_2e0c9b5553b6["test_redaction_policy_applies()"] 3bad62a8_53b2_0104_58f8_2e0c9b5553b6 -->|calls| 1bc202d6_8b54_02e9_fadd_ff3171c38a75 cf4a1b72_8d63_f795_52b9_b97bf37a9567["test_startup_and_shutdown_commands()"] cf4a1b72_8d63_f795_52b9_b97bf37a9567 -->|calls| 1bc202d6_8b54_02e9_fadd_ff3171c38a75 72869c65_85d9_0d1a_9c29_ba4e4960df93["test_normalize_env_coercion()"] 72869c65_85d9_0d1a_9c29_ba4e4960df93 -->|calls| 1bc202d6_8b54_02e9_fadd_ff3171c38a75 bc326a45_6693_2d8f_363c_80a80c889718["test_shell_tool_missing_command_string()"] bc326a45_6693_2d8f_363c_80a80c889718 -->|calls| 1bc202d6_8b54_02e9_fadd_ff3171c38a75 434b01d0_ac34_85b4_27d5_4de5878ec2d3["test_tool_message_formatting_with_id()"] 434b01d0_ac34_85b4_27d5_4de5878ec2d3 -->|calls| 1bc202d6_8b54_02e9_fadd_ff3171c38a75 8186ea47_5d07_904f_f2f3_eb3ebb575a72["test_nonzero_exit_code_returns_error()"] 8186ea47_5d07_904f_f2f3_eb3ebb575a72 -->|calls| 1bc202d6_8b54_02e9_fadd_ff3171c38a75 019aa08f_0fbc_aacb_8e14_2d6e3a44d7d5["test_truncation_by_bytes()"] 019aa08f_0fbc_aacb_8e14_2d6e3a44d7d5 -->|calls| 1bc202d6_8b54_02e9_fadd_ff3171c38a75 9e0e7046_2a79_5153_a4c3_5584476a8366["test_startup_command_failure()"] 9e0e7046_2a79_5153_a4c3_5584476a8366 -->|calls| 1bc202d6_8b54_02e9_fadd_ff3171c38a75 9f0a1841_d7ba_5871_1e6b_d441c9eadbc5["test_shutdown_command_failure_logged()"] 9f0a1841_d7ba_5871_1e6b_d441c9eadbc5 -->|calls| 1bc202d6_8b54_02e9_fadd_ff3171c38a75 style 1bc202d6_8b54_02e9_fadd_ff3171c38a75 fill:#6366f1,stroke:#818cf8,color:#fff
Relationship Graph
Source Code
libs/langchain_v1/tests/unit_tests/agents/middleware/implementations/test_shell_tool.py lines 24–25
def _empty_state() -> ShellToolState:
return {"messages": []}
Domain
Subdomains
Called By
- test_async_methods_delegate_to_sync()
- test_empty_output_replaced_with_no_output()
- test_executes_command_and_persists_state()
- test_get_or_create_resources_creates_when_missing()
- test_get_or_create_resources_reuses_existing()
- test_nonzero_exit_code_returns_error()
- test_normalize_env_coercion()
- test_redaction_policy_applies()
- test_restart_resets_session_environment()
- test_shell_middleware_resumable_after_interrupt()
- test_shell_tool_missing_command_string()
- test_shutdown_command_failure_logged()
- test_shutdown_command_timeout_logged()
- test_startup_and_shutdown_commands()
- test_startup_command_failure()
- test_stderr_output_labeling()
- test_timeout_returns_error()
- test_tool_message_formatting_with_id()
- test_truncation_by_bytes()
- test_truncation_indicator_present()
Source
Frequently Asked Questions
What does _empty_state() do?
_empty_state() is a function in the langchain codebase, defined in libs/langchain_v1/tests/unit_tests/agents/middleware/implementations/test_shell_tool.py.
Where is _empty_state() defined?
_empty_state() is defined in libs/langchain_v1/tests/unit_tests/agents/middleware/implementations/test_shell_tool.py at line 24.
What calls _empty_state()?
_empty_state() is called by 20 function(s): test_async_methods_delegate_to_sync, test_empty_output_replaced_with_no_output, test_executes_command_and_persists_state, test_get_or_create_resources_creates_when_missing, test_get_or_create_resources_reuses_existing, test_nonzero_exit_code_returns_error, test_normalize_env_coercion, test_redaction_policy_applies, and 12 more.
Analyze Your Own Codebase
Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.
Try Supermodel Free