langchain-ai/deepagents · error · ToolRequirementIntrospectionError

uv tool receipt contains a requirement without a package nam

Error message

uv tool receipt contains a requirement without a package name

What it means

A requirements entry in the uv receipt is a table but has no usable `name` field — either the key is absent or it is not a non-empty string. Each entry must identify the package it pins, so the library cannot proceed without it.

Source

Thrown at libs/code/deepagents_code/update_check.py:2971

    Raises:
        ToolRequirementIntrospectionError: If `[tool].requirements` is missing or
            contains an entry that is not a table with a package name.
    """
    tool = data.get("tool")
    requirements = tool.get("requirements") if isinstance(tool, dict) else None
    if not isinstance(requirements, list):
        msg = "uv tool receipt is missing `[tool].requirements`"
        raise ToolRequirementIntrospectionError(msg)

    for entry in requirements:
        if not isinstance(entry, dict):
            msg = "uv tool receipt contains a non-table requirement entry"
            raise ToolRequirementIntrospectionError(msg)
        name = entry.get("name")
        if not isinstance(name, str) or not name:
            msg = "uv tool receipt contains a requirement without a package name"
            raise ToolRequirementIntrospectionError(msg)
        yield name, entry


def _uv_tool_python(
    tool_root: Path | None = None,
    *,
    data: dict[str, Any] | None = None,
) -> str | None:
    """Return the Python interpreter recorded in the uv tool receipt.

    Args:
        tool_root: Optional uv tool environment root. Defaults to `sys.prefix`.
        data: Optional pre-parsed receipt contents. Supplied by callers that
            read several receipt fields at once so the file is parsed once
            rather than per field.

    Returns:
        The recorded `[tool].python` value, or `None` when the receipt does not

View on GitHub (pinned to a1af029e6e)

Solutions

  1. Restore the `name` key on the offending [[tool.requirements]] entry (e.g. `name = "deepagents-code"`).
  2. Regenerate the receipt via `uv tool install deepagents-code --force`.
  3. Check for typos in the entry keys against a fresh receipt.

Example fix

// before
 [[tool.requirements]]
 package = "deepagents-code"
// after
 [[tool.requirements]]
 name = "deepagents-code"
Defensive patterns

Strategy: validation

Validate before calling

import tomllib

def every_requirement_has_name(data: dict) -> bool:
    reqs = (data.get('tool') or {}).get('requirements', [])
    return all(isinstance(r, dict) and isinstance(r.get('name'), str) and r['name'] for r in reqs)

Type guard

def has_name(entry: dict) -> bool:
    name = entry.get('name')
    return isinstance(name, str) and bool(name)

Try / catch

try:
    cmd = _uv_tool_install_command()
except ToolRequirementIntrospectionError:
    subprocess.run(['uv', 'tool', 'install', 'deepagents-code', '--force'], check=True)
    cmd = _uv_tool_install_command()

Prevention

When it happens

Trigger: _iter_uv_tool_requirements yields (name, entry) pairs and raises when entry.get("name") is missing, empty, or not a str — surfaced through _uv_tool_selected_extras or _uv_tool_with_packages.

Common situations: Receipt hand-edited and the name key dropped or misspelled (e.g. `package = ...` instead of `name = ...`); a different receipt schema where the key is renamed; corruption during copy/transfer.

Understand the failure class

Background: Schema validation failed / invalid input schema: payload rejected because its shape doesn't match the expected schema — this error's family across 28 libraries.

Related errors


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