{"record":{"id":"23e2de55d02949bf","repo":"langchain-ai/deepagents","slug":"interpreter-ptc-list-entries-cannot-include-all","errorCode":null,"errorMessage":"interpreter_ptc list entries cannot include 'all'; use 'all' as a standalone value or list explicit tool names (optionally with the 'safe' preset).","messagePattern":"interpreter_ptc list entries cannot include 'all'; use 'all' as a standalone value or list explicit tool names \\(optionally with the 'safe' preset\\)\\.","errorType":"validation","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"libs/code/deepagents_code/agent.py","lineNumber":1051,"sourceCode":"                    write_included,\n                )\n            return included\n        msg = (\n            f\"Invalid interpreter_ptc string {ptc!r}; expected 'safe', 'all', \"\n            \"or a list of tool names.\"\n        )\n        raise ValueError(msg)\n\n    if isinstance(ptc, list):\n        from deepagents_code.config import INTERPRETER_PTC_SAFE_PRESET\n\n        if any(name.strip().lower() == \"all\" for name in ptc):\n            msg = (\n                \"interpreter_ptc list entries cannot include 'all'; use 'all' \"\n                \"as a standalone value or list explicit tool names (optionally \"\n                \"with the 'safe' preset).\"\n            )\n            raise ValueError(msg)\n\n        resolved: list[str] = []\n        seen: set[str] = set()\n\n        def _add(name: str) -> None:\n            if name not in seen:\n                seen.add(name)\n                resolved.append(name)\n\n        for name in ptc:\n            if name.strip().lower() == \"safe\":\n                for member in sorted(INTERPRETER_PTC_SAFE_PRESET):\n                    _add(member)\n                continue\n            _add(name)\n\n        # Explicit names are passed through unvalidated: the middleware resolves\n        # them against the live runtime registry (which includes the SDK","sourceCodeStart":1033,"sourceCodeEnd":1069,"githubUrl":"https://github.com/langchain-ai/deepagents/blob/a1af029e6e73cb17c36bff823d227747b28e91e1/libs/code/deepagents_code/agent.py#L1033-L1069","documentation":"When interpreter_ptc is a list, the library rejects any entry that spells 'all'. 'all' is a standalone sentinel for the whole string form only; embedding it in a list is ambiguous (list entries are otherwise literal tool names, plus the optional 'safe' preset), so it fails fast instead of guessing.","triggerScenarios":"create_cli_agent(interpreter_ptc=[\"all\"]) or interpreter_ptc=[\"safe\", \"all\"] or [\"execute\", \"ALL\"] — any list element whose strip().lower() == 'all' raises this ValueError.","commonSituations":"Users mixing the sentinel vocabulary, e.g. writing [\"safe\", \"all\"] intending 'everything plus the preset'; migrating a config that used the string 'all' into list form without realizing 'all' cannot be combined.","solutions":["If you want everything, use the standalone string: interpreter_ptc=\"all\" (plus interpreter_ptc_acknowledge_unsafe=True or auto_approve=True).","If you want the preset plus extras, use \"safe\" inside the list: [\"safe\", \"execute\"].","Otherwise list only explicit tool names and drop the 'all' entry."],"exampleFix":"// before\ncreate_cli_agent(interpreter_ptc=[\"safe\", \"all\"])\n// after\ncreate_cli_agent(interpreter_ptc=\"all\", interpreter_ptc_acknowledge_unsafe=True)\n// or preset + explicit extras\ncreate_cli_agent(interpreter_ptc=[\"safe\", \"execute\"])","handlingStrategy":"validation","validationCode":"if isinstance(ptc, list) and any(str(n).strip().lower() == \"all\" for n in ptc):\n    raise ValueError(\"use interpreter_ptc='all' as a standalone string, not inside a list\")","typeGuard":"def is_ptc_tool_list(v: object) -> TypeGuard[list[str]]:\n    return (\n        isinstance(v, list)\n        and all(isinstance(n, str) and n.strip().lower() != \"all\" for n in v)\n    )","tryCatchPattern":"try:\n    agent = create_cli_agent(interpreter_ptc=ptc)\nexcept ValueError as exc:\n    if \"cannot include 'all'\" in str(exc):\n        agent = create_cli_agent(interpreter_ptc=\"all\", interpreter_ptc_acknowledge_unsafe=True)\n    else:\n        raise","preventionTips":["Remember: 'all' is string-form only; 'safe' is the only preset combinable inside a list.","Validate config-driven lists at load time, before agent construction.","Prefer [\"safe\", ...extras] over [\"all\"] when you need preset plus extras without full exposure."],"tags":["python","configuration","valueerror","validation"],"backgroundTag":"invalid-enum-value","analyzedSha":"a1af029e6e73cb17c36bff823d227747b28e91e1","analyzedAt":"2026-08-29T11:43:24.718Z","schemaVersion":2},"datasetVersion":"2026-08-29T12:17:43.993Z"}