{"record":{"id":"c9e6da12abebb3a4","repo":"crewAIInc/crewAI","slug":"action-list-requires-path","errorCode":null,"errorMessage":"action='list' requires 'path'","messagePattern":"action='list' requires 'path'","errorType":"validation","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"lib/crewai-tools/src/crewai_tools/tools/daytona_sandbox_tool/daytona_file_tool.py","lineNumber":269,"sourceCode":"        group: str | None = None,\n    ) -> Any:\n        sandbox, should_delete = self._acquire_sandbox()\n        try:\n            if action == \"read\":\n                if path is None:\n                    raise ValueError(\"action='read' requires 'path'\")\n                return self._read(sandbox, path, binary=binary)\n            if action == \"write\":\n                if path is None:\n                    raise ValueError(\"action='write' requires 'path'\")\n                return self._write(sandbox, path, content or \"\", binary=binary)\n            if action == \"append\":\n                if path is None:\n                    raise ValueError(\"action='append' requires 'path'\")\n                return self._append(sandbox, path, content or \"\", binary=binary)\n            if action == \"list\":\n                if path is None:\n                    raise ValueError(\"action='list' requires 'path'\")\n                return self._list(sandbox, path)\n            if action == \"delete\":\n                if path is None:\n                    raise ValueError(\"action='delete' requires 'path'\")\n                sandbox.fs.delete_file(path, recursive=recursive)\n                return {\"status\": \"deleted\", \"path\": path}\n            if action == \"mkdir\":\n                if path is None:\n                    raise ValueError(\"action='mkdir' requires 'path'\")\n                mkdir_mode = mode or \"0755\"\n                sandbox.fs.create_folder(path, mkdir_mode)\n                return {\"status\": \"created\", \"path\": path, \"mode\": mkdir_mode}\n            if action == \"info\":\n                if path is None:\n                    raise ValueError(\"action='info' requires 'path'\")\n                return self._info(sandbox, path)\n            if action == \"exists\":\n                if path is None:","sourceCodeStart":251,"sourceCodeEnd":287,"githubUrl":"https://github.com/crewAIInc/crewAI/blob/754d7323beb2fd042e33444a115ea2d5a47193f0/lib/crewai-tools/src/crewai_tools/tools/daytona_sandbox_tool/daytona_file_tool.py#L251-L287","documentation":"DaytonaFileTool._run's defensive check for action='list': a None path raises ValueError before self._list(sandbox, path) is called. The Pydantic schema normally rejects a missing path earlier, so this fires mainly on direct _run invocations. Note that listing requires an explicit directory path — there is no implicit root default.","triggerScenarios":"Calling tool._run(action='list', path=None) directly; assuming the tool defaults to the sandbox workspace root when path is omitted; test harness bypassing schema validation.","commonSituations":"Developers expecting a default directory listing; direct private-method calls in tests; argument dicts missing the path key.","solutions":["Pass the directory explicitly: tool.run(action='list', path='/workspace').","Do not rely on a default root — always provide the directory to list.","If calling _run directly, ensure path is set before invocation."],"exampleFix":"# before\ntool._run(action=\"list\")  # ValueError\n\n# after\ntool.run(action=\"list\", path=\"/workspace\")","handlingStrategy":"validation","validationCode":"def validated_list_call(tool, path: str | None) -> Any:\n    directory = path or \"/workspace\"  # explicit default; the tool has none\n    return tool.run(action=\"list\", path=directory)","typeGuard":null,"tryCatchPattern":"try:\n    entries = tool.run(action=\"list\", path=p)\nexcept ValueError as e:\n    if \"requires 'path'\" in str(e):\n        entries = tool.run(action=\"list\", path=\"/workspace\")\n    else:\n        raise","preventionTips":["The list action has no implicit root — always pass the directory.","Wrap list calls with an explicit default directory in your helper layer.","Go through run() so the schema validator reports missing fields clearly."],"tags":["daytona","filesystem","validation","internal-api"],"backgroundTag":null,"analyzedSha":"754d7323beb2fd042e33444a115ea2d5a47193f0","analyzedAt":"2026-08-15T04:06:56.746Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}