Home / Function/ _kill_process() — langchain Function Reference

_kill_process() — langchain Function Reference

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

Entity Profile

Dependency Diagram

graph TD
  689aee59_b72f_671f_1bc6_26e76e9d6fba["_kill_process()"]
  cf4eeaa4_4bcc_69d9_a0f3_664b1eecb4e8["ShellSession"]
  689aee59_b72f_671f_1bc6_26e76e9d6fba -->|defined in| cf4eeaa4_4bcc_69d9_a0f3_664b1eecb4e8
  8e7ca27f_5ba4_f43b_b7dd_ea19f14cf7c4["stop()"]
  8e7ca27f_5ba4_f43b_b7dd_ea19f14cf7c4 -->|calls| 689aee59_b72f_671f_1bc6_26e76e9d6fba
  style 689aee59_b72f_671f_1bc6_26e76e9d6fba fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

libs/langchain_v1/langchain/agents/middleware/shell_tool.py lines 401–410

    def _kill_process(self) -> None:
        if not self._process:
            return

        if hasattr(os, "killpg"):
            with contextlib.suppress(ProcessLookupError):
                os.killpg(os.getpgid(self._process.pid), signal.SIGKILL)
        else:  # pragma: no cover
            with contextlib.suppress(ProcessLookupError):
                self._process.kill()

Domain

Subdomains

Called By

Frequently Asked Questions

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

Analyze Your Own Codebase

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

Try Supermodel Free