{"record":{"id":"72ddd4dd22e4f0d4","repo":"langchain-ai/deepagents","slug":"uv-tool-receipt-contains-a-requirement-without-a-p","errorCode":null,"errorMessage":"uv tool receipt contains a requirement without a package name","messagePattern":"uv tool receipt contains a requirement without a package name","errorType":"exception","errorClass":"ToolRequirementIntrospectionError","httpStatus":null,"severity":"error","filePath":"libs/code/deepagents_code/update_check.py","lineNumber":2971,"sourceCode":"\n    Raises:\n        ToolRequirementIntrospectionError: If `[tool].requirements` is missing or\n            contains an entry that is not a table with a package name.\n    \"\"\"\n    tool = data.get(\"tool\")\n    requirements = tool.get(\"requirements\") if isinstance(tool, dict) else None\n    if not isinstance(requirements, list):\n        msg = \"uv tool receipt is missing `[tool].requirements`\"\n        raise ToolRequirementIntrospectionError(msg)\n\n    for entry in requirements:\n        if not isinstance(entry, dict):\n            msg = \"uv tool receipt contains a non-table requirement entry\"\n            raise ToolRequirementIntrospectionError(msg)\n        name = entry.get(\"name\")\n        if not isinstance(name, str) or not name:\n            msg = \"uv tool receipt contains a requirement without a package name\"\n            raise ToolRequirementIntrospectionError(msg)\n        yield name, entry\n\n\ndef _uv_tool_python(\n    tool_root: Path | None = None,\n    *,\n    data: dict[str, Any] | None = None,\n) -> str | None:\n    \"\"\"Return the Python interpreter recorded in the uv tool receipt.\n\n    Args:\n        tool_root: Optional uv tool environment root. Defaults to `sys.prefix`.\n        data: Optional pre-parsed receipt contents. Supplied by callers that\n            read several receipt fields at once so the file is parsed once\n            rather than per field.\n\n    Returns:\n        The recorded `[tool].python` value, or `None` when the receipt does not","sourceCodeStart":2953,"sourceCodeEnd":2989,"githubUrl":"https://github.com/langchain-ai/deepagents/blob/a1af029e6e73cb17c36bff823d227747b28e91e1/libs/code/deepagents_code/update_check.py#L2953-L2989","documentation":"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.","triggerScenarios":"_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.","commonSituations":"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.","solutions":["Restore the `name` key on the offending [[tool.requirements]] entry (e.g. `name = \"deepagents-code\"`).","Regenerate the receipt via `uv tool install deepagents-code --force`.","Check for typos in the entry keys against a fresh receipt."],"exampleFix":"// before\n [[tool.requirements]]\n package = \"deepagents-code\"\n// after\n [[tool.requirements]]\n name = \"deepagents-code\"","handlingStrategy":"validation","validationCode":"import tomllib\n\ndef every_requirement_has_name(data: dict) -> bool:\n    reqs = (data.get('tool') or {}).get('requirements', [])\n    return all(isinstance(r, dict) and isinstance(r.get('name'), str) and r['name'] for r in reqs)","typeGuard":"def has_name(entry: dict) -> bool:\n    name = entry.get('name')\n    return isinstance(name, str) and bool(name)","tryCatchPattern":"try:\n    cmd = _uv_tool_install_command()\nexcept ToolRequirementIntrospectionError:\n    subprocess.run(['uv', 'tool', 'install', 'deepagents-code', '--force'], check=True)\n    cmd = _uv_tool_install_command()","preventionTips":["Keep `name = \"...\"` on every [[tool.requirements]] entry if editing manually.","Avoid renames/typo keys like `package` when touching receipts.","Prefer `uv tool install --force` over manual receipt surgery.","Validate receipt keys after any external tooling writes it."],"tags":["uv","receipt-schema","validation"],"backgroundTag":"schema-validation-failed","analyzedSha":"a1af029e6e73cb17c36bff823d227747b28e91e1","analyzedAt":"2026-08-29T11:43:24.718Z","schemaVersion":2},"datasetVersion":"2026-08-29T12:17:43.993Z"}