{"record":{"id":"8624705edb03d43b","repo":"calesthio/OpenMontage","slug":"command-cmd-name-r-not-found-self-install-inst","errorCode":null,"errorMessage":"Command {cmd_name!r} not found. {self.install_instructions}","messagePattern":"Command (.+?) not found\\. (.+?)","errorType":"exception","errorClass":"DependencyError","httpStatus":null,"severity":"error","filePath":"tools/base_tool.py","lineNumber":311,"sourceCode":"\n    # ---- Status reporting ----\n\n    def get_status(self) -> ToolStatus:\n        \"\"\"Check if this tool's dependencies are satisfied.\"\"\"\n        try:\n            self.check_dependencies()\n            return ToolStatus.AVAILABLE\n        except DependencyError:\n            return ToolStatus.UNAVAILABLE\n\n    def check_dependencies(self) -> None:\n        \"\"\"Verify all dependencies are installed. Raises DependencyError if not.\"\"\"\n        for dep in self.dependencies:\n            if dep.startswith((\"cmd:\", \"binary:\")):\n                prefix = \"cmd:\" if dep.startswith(\"cmd:\") else \"binary:\"\n                cmd_name = dep[len(prefix):]\n                if shutil.which(cmd_name) is None:\n                    raise DependencyError(\n                        f\"Command {cmd_name!r} not found. {self.install_instructions}\"\n                    )\n            elif dep.startswith(\"env:\"):\n                env_name = dep[4:]\n                if not os.environ.get(env_name):\n                    raise DependencyError(\n                        f\"Environment variable {env_name!r} not set. {self.install_instructions}\"\n                    )\n            elif dep.startswith(\"python:\"):\n                module_name = dep[7:]\n                try:\n                    __import__(module_name)\n                except ImportError:\n                    raise DependencyError(\n                        f\"Python module {module_name!r} not installed. {self.install_instructions}\"\n                    )\n\n    def get_info(self) -> dict[str, Any]:","sourceCodeStart":293,"sourceCodeEnd":329,"githubUrl":"https://github.com/calesthio/OpenMontage/blob/95e1c3d0ab93482159818560f6a8c8e866b9139f/tools/base_tool.py#L293-L329","documentation":"Raised by BaseTool.check_dependencies when a dependency declared with the cmd: or binary: prefix is not found on PATH via shutil.which. It surfaces as DependencyError with the tool's install_instructions appended, telling you exactly which external executable the tool needs and how to install it. check_available() catches this to report ToolStatus.UNAVAILABLE instead.","triggerScenarios":"Any tool whose dependencies list contains e.g. 'cmd:ffmpeg' or 'binary:node' running on a machine where that executable is missing, not on PATH, or not executable. Common with fresh containers, minimal Docker images, or restricted sandboxes.","commonSituations":"ffmpeg/ffprobe absent in slim Docker images; node/npx missing on a Python-only host; PATH not including a user-local install (~/.local/bin, homebrew sbin) in a service context; running under systemd/cron with a minimal PATH.","solutions":["Install the missing command (the install_instructions in the message name it), e.g. apt-get install -y ffmpeg","If it is installed, ensure it is on PATH for the process: check shutil.which(cmd) in the same environment","For services, set an absolute path by symlinking into /usr/local/bin or extending PATH in the service unit","Call tool.check_available() first and degrade gracefully to ToolStatus.UNAVAILABLE instead of crashing"],"exampleFix":"# before: crash mid-run\nresult = tool.run(inputs)\n\n# after: preflight\nif tool.check_available() is not ToolStatus.AVAILABLE:\n    raise SystemExit(f\"tool unavailable: {tool.install_instructions}\")\nresult = tool.run(inputs)","handlingStrategy":"validation","validationCode":"import shutil\nmissing = [d[4:] for d in tool.dependencies if d.startswith((\"cmd:\", \"binary:\")) and shutil.which(d[4:]) is None]\nif missing:\n    raise SystemExit(f\"install required commands: {missing} ({tool.install_instructions})\")\n# or use the built-in: assert tool.check_available() is ToolStatus.AVAILABLE","typeGuard":"def tool_commands_available(tool) -> bool:\n    import shutil\n    return all(shutil.which(d.split(\":\", 1)[1]) is not None\n               for d in tool.dependencies if d.startswith((\"cmd:\", \"binary:\")))","tryCatchPattern":"from tools.base_tool import DependencyError\ntry:\n    tool.check_dependencies()\nexcept DependencyError as e:\n    raise SystemExit(f\"preflight failed: {e}\") from e","preventionTips":["Run check_available() in preflight, not mid-pipeline","Install external binaries in Docker images explicitly (e.g. apt-get install -y ffmpeg)","Ensure service/cron environments include user-local bin dirs on PATH"],"tags":["dependencies","environment","cli","installation"],"backgroundTag":null,"analyzedSha":"95e1c3d0ab93482159818560f6a8c8e866b9139f","analyzedAt":"2026-08-15T06:31:20.014Z","schemaVersion":2},"datasetVersion":"2026-08-15T17:31:12.345Z"}