{"record":{"id":"51c908ba3d0ebf80","repo":"langchain-ai/deepagents","slug":"uv-tool-receipt-is-missing-tool-requirements","errorCode":null,"errorMessage":"uv tool receipt is missing `[tool].requirements`","messagePattern":"uv tool receipt is missing `\\[tool\\]\\.requirements`","errorType":"exception","errorClass":"ToolRequirementIntrospectionError","httpStatus":null,"severity":"error","filePath":"libs/code/deepagents_code/update_check.py","lineNumber":2962,"sourceCode":"    in exactly one place. Callers apply their own per-entry key allowlist, which\n    is the only part that legitimately differs between them.\n\n    Args:\n        data: Parsed `uv-receipt.toml` contents.\n\n    Yields:\n        Each requirement's declared `name` and its full table entry, in receipt\n            order.\n\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.","sourceCodeStart":2944,"sourceCodeEnd":2980,"githubUrl":"https://github.com/langchain-ai/deepagents/blob/a1af029e6e73cb17c36bff823d227747b28e91e1/libs/code/deepagents_code/update_check.py#L2944-L2980","documentation":"The uv receipt was loaded, but its structure lacks the expected `[tool]` table with a `requirements` array, so no requirement entries can be iterated. The library treats such a receipt as invalid for introspection and raises ToolRequirementIntrospectionError.","triggerScenarios":"_iter_uv_tool_requirements receives a parsed receipt dict where data[\"tool\"] is missing or not a dict, or data[\"tool\"][\"requirements\"] is missing or not a list — typically called from _uv_tool_selected_extras or _uv_tool_with_packages.","commonSituations":"A receipt produced by a different uv version or format (schema drift); a user replaced the receipt with a minimal or hand-written file lacking [tool].requirements; an unrelated TOML file passed as tool_root's receipt.","solutions":["Regenerate a correct receipt with `uv tool install deepagents-code --force`.","If the receipt is from an older uv, upgrade uv (`uv self update` or reinstall) and reinstall the tool so the receipt matches the expected schema.","Do not hand-edit the receipt's [tool] table; if you must inspect, confirm `tool.requirements` is a list of tables."],"exampleFix":"// before: hand-written receipt missing requirements\n [tool]\n python = \"3.12\"\n// after: expected structure\n [tool]\n python = \"3.12\"\n [[tool.requirements]]\n name = \"deepagents-code\"","handlingStrategy":"validation","validationCode":"import tomllib\nfrom pathlib import Path\n\ndef receipt_has_requirements(receipt: Path) -> bool:\n    data = tomllib.loads(receipt.read_text(encoding='utf-8'))\n    tool = data.get('tool')\n    return isinstance(tool, dict) and isinstance(tool.get('requirements'), list)","typeGuard":"def is_valid_receipt(data: object) -> bool:\n    tool = data.get('tool') if isinstance(data, dict) else None\n    return isinstance(tool, dict) and isinstance(tool.get('requirements'), list)","tryCatchPattern":"try:\n    extras = _uv_tool_selected_extras()\nexcept ToolRequirementIntrospectionError:\n    subprocess.run(['uv', 'tool', 'install', 'deepagents-code', '--force'], check=True)\n    extras = _uv_tool_selected_extras()","preventionTips":["Use `uv tool install --force` to regenerate receipts instead of editing them.","Verify the receipt schema against a fresh install after uv upgrades.","Never point tool_root at a non-uv TOML file.","Pin a known-good uv version if receipt format matters in CI."],"tags":["uv","receipt-schema","validation"],"backgroundTag":"uv-tool-receipt-missing","analyzedSha":"a1af029e6e73cb17c36bff823d227747b28e91e1","analyzedAt":"2026-08-29T11:43:24.718Z","schemaVersion":2},"datasetVersion":"2026-08-29T12:17:43.993Z"}