langchain-ai/deepagents · error · ValueError

`interpreter_ptc` list entries cannot include 'all'; use 'al

Error message

`interpreter_ptc` list entries cannot include 'all'; use 'all' as a standalone value or list explicit tool names (optionally with the 'safe' preset).

What it means

Inside an interpreter_ptc list, the sentinel 'all' is not allowed as an entry; 'all' must be the standalone scalar value (or combined via the 'safe' preset note in the message). This keeps the allow-list semantics unambiguous — a list means explicit tool names only.

Source

Thrown at libs/code/deepagents_code/config.py:2460

    if isinstance(raw, list):
        if not raw:
            return False
        names: list[str] = []
        for entry in raw:
            if not isinstance(entry, str) or not entry.strip():
                msg = (
                    "`interpreter_ptc` list entries must be non-empty strings; "
                    f"got {entry!r}."
                )
                raise ValueError(msg)
            cleaned = entry.strip()
            if cleaned.lower() == INTERPRETER_PTC_ALL_SENTINEL:
                msg = (
                    "`interpreter_ptc` list entries cannot include 'all'; use "
                    "'all' as a standalone value or list explicit tool names "
                    "(optionally with the 'safe' preset)."
                )
                raise ValueError(msg)
            names.append(cleaned)
        return names
    msg = (
        f"`interpreter_ptc` must be False, 'safe', 'all', or a list of tool "
        f"names; got {type(raw).__name__}."
    )
    raise ValueError(msg)


@dataclass(frozen=True)
class _ProviderRetryConfig:
    """Validated retry settings for one provider."""

    max_retries: int | None = None
    param: str | None = None


@dataclass(frozen=True)

View on GitHub (pinned to a1af029e6e)

Solutions

  1. Use interpreter_ptc = "all" as a standalone value instead of a list containing 'all'.
  2. Drop the 'all' entry and list only explicit tool names, optionally prefixing with 'safe' as the message suggests.
  3. If you want 'safe' plus specific tools, pass ["safe", "tool_a"] without 'all'.

Example fix

// before
interpreter_ptc = ["all"]
// after
interpreter_ptc = "all"  # or ["safe", "bash"]
Defensive patterns

Strategy: validation

Validate before calling

if isinstance(raw, list) and any(t.strip().lower() == "all" for t in raw if isinstance(t, str)):
    raise ValueError("'all' must be standalone, not a list entry")

Type guard

def is_explicit_tool_list(v: object) -> bool:
    return (isinstance(v, list) and all(isinstance(t, str) and t.strip()
            and t.strip().lower() != "all" for t in v))

Try / catch

try:
    ptc = _parse_interpreter_ptc(raw)
except ValueError as e:
    sys.exit(f"invalid interpreter_ptc: {e}")

Prevention

When it happens

Trigger: Passing interpreter_ptc = ["all"] or ["safe", "all", "bash"] — any list element equal to 'all' case-insensitively after trimming.

Common situations: Users assuming lists behave like the allow-list merge logic ('safe' plus extras) and appending 'all', or scripting config generation that adds 'all' as a fallback entry.

Understand the failure class

Background: Invalid enum value errors: "Unknown type", "Invalid scope", "must be one of" — when a string is not on the library's allowed list — this error's family across 23 libraries.

Related errors


AI-assisted analysis of langchain-ai/deepagents@a1af029e6e (2026-08-29). Data as JSON: /api/errors/500625451da23d30. Report an issue: GitHub.