Home / Function/ _run_shutdown_commands() — langchain Function Reference

_run_shutdown_commands() — langchain Function Reference

Architecture documentation for the _run_shutdown_commands() function in shell_tool.py from the langchain codebase.

Function python LangChainCore Runnables calls 1 called by 1

Entity Profile

Dependency Diagram

graph TD
  a8939a21_12d2_1636_cdd0_de50dcefea64["_run_shutdown_commands()"]
  4e57a0ff_f1a5_e2e9_6949_569d7cd6d70a["ShellToolMiddleware"]
  a8939a21_12d2_1636_cdd0_de50dcefea64 -->|defined in| 4e57a0ff_f1a5_e2e9_6949_569d7cd6d70a
  b37f648b_77a3_f369_ff04_cd19c43be87b["after_agent()"]
  b37f648b_77a3_f369_ff04_cd19c43be87b -->|calls| a8939a21_12d2_1636_cdd0_de50dcefea64
  da18dc22_e4fc_2b4a_2829_9217c9f5d8f5["execute()"]
  a8939a21_12d2_1636_cdd0_de50dcefea64 -->|calls| da18dc22_e4fc_2b4a_2829_9217c9f5d8f5
  style a8939a21_12d2_1636_cdd0_de50dcefea64 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

libs/langchain_v1/langchain/agents/middleware/shell_tool.py lines 734–749

    def _run_shutdown_commands(self, session: ShellSession) -> None:
        if not self._shutdown_commands:
            return
        for command in self._shutdown_commands:
            try:
                result = session.execute(command, timeout=self._execution_policy.command_timeout)
                if result.timed_out:
                    LOGGER.warning("Shutdown command '%s' timed out.", command)
                elif result.exit_code not in {0, None}:
                    LOGGER.warning(
                        "Shutdown command '%s' exited with %s.", command, result.exit_code
                    )
            except (RuntimeError, ToolException, OSError) as exc:
                LOGGER.warning(
                    "Failed to run shutdown command '%s': %s", command, exc, exc_info=True
                )

Domain

Subdomains

Calls

Called By

Frequently Asked Questions

What does _run_shutdown_commands() do?
_run_shutdown_commands() is a function in the langchain codebase, defined in libs/langchain_v1/langchain/agents/middleware/shell_tool.py.
Where is _run_shutdown_commands() defined?
_run_shutdown_commands() is defined in libs/langchain_v1/langchain/agents/middleware/shell_tool.py at line 734.
What does _run_shutdown_commands() call?
_run_shutdown_commands() calls 1 function(s): execute.
What calls _run_shutdown_commands()?
_run_shutdown_commands() is called by 1 function(s): after_agent.

Analyze Your Own Codebase

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

Try Supermodel Free