{"record":{"id":"5a22d661acbd30f1","repo":"langchain-ai/deepagents","slug":"uv-tool-receipt-not-found-at-receipt-path","errorCode":null,"errorMessage":"uv tool receipt not found at {receipt_path}","messagePattern":"uv tool receipt not found at (.+?)","errorType":"exception","errorClass":"ToolRequirementIntrospectionError","httpStatus":null,"severity":"error","filePath":"libs/code/deepagents_code/update_check.py","lineNumber":2931,"sourceCode":"def _uv_tool_receipt_data(tool_root: Path | None = None) -> dict[str, Any]:\n    \"\"\"Return parsed uv tool receipt data for the current tool environment.\n\n    Args:\n        tool_root: Optional uv tool environment root. Defaults to `sys.prefix`.\n\n    Returns:\n        Parsed TOML data from `uv-receipt.toml`.\n\n    Raises:\n        ToolRequirementIntrospectionError: If the receipt cannot be read or\n            parsed.\n    \"\"\"\n    receipt_path = _uv_tool_receipt_path(tool_root)\n    try:\n        return tomllib.loads(receipt_path.read_text(encoding=\"utf-8\"))\n    except FileNotFoundError as exc:\n        msg = f\"uv tool receipt not found at {receipt_path}\"\n        raise ToolRequirementIntrospectionError(msg) from exc\n    except (OSError, tomllib.TOMLDecodeError) as exc:\n        msg = f\"Could not read uv tool receipt at {receipt_path}: {exc}\"\n        raise ToolRequirementIntrospectionError(msg) from exc\n\n\ndef _iter_uv_tool_requirements(\n    data: dict[str, Any],\n) -> Iterator[tuple[str, dict[str, Any]]]:\n    \"\"\"Yield validated `(name, entry)` pairs from a uv tool receipt.\n\n    Shared by the selected-extras and `--with`-package readers so the receipt's\n    `[tool].requirements` shape is validated — and its failure messages worded —\n    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","sourceCodeStart":2913,"sourceCodeEnd":2949,"githubUrl":"https://github.com/langchain-ai/deepagents/blob/a1af029e6e73cb17c36bff823d227747b28e91e1/libs/code/deepagents_code/update_check.py#L2913-L2949","documentation":"deepagents-code is normally installed as a uv tool, and its update/dependency code reconstructs the install by reading the uv receipt file (uv-receipt.toml) under the tool root. This error means that receipt file does not exist at the expected path, so the library cannot introspect the tool's requirements. It wraps FileNotFoundError in ToolRequirementIntrospectionError.","triggerScenarios":"Calling any of _uv_tool_python, _uv_tool_selected_extras, _uv_tool_with_packages, or _uv_tool_install_command (directly or via dependency-refresh / extras-management helpers) when _uv_tool_receipt_path(tool_root) points to a non-existent uv-receipt.toml.","commonSituations":"The package was installed with pip/venv instead of `uv tool install`; the UV_TOOL_DIR was moved, cleaned, or points elsewhere; the tool directory was partially deleted; a broken `uv tool upgrade` left no receipt behind.","solutions":["Reinstall the tool with uv: `uv tool install deepagents-code --force` to regenerate the receipt.","Verify the receipt exists at `$(uv tool dir)/deepagents-code/uv-receipt.toml` and that UV_TOOL_DIR matches the tool_root being inspected.","If you are not running as a uv tool, skip the uv-specific introspection path or pass the correct tool_root explicitly."],"exampleFix":"// before: inspecting a tool installed outside uv\n cmd = _uv_tool_install_command(tool_root=Path('/some/pip/venv'))\n// after: reinstall under uv or guard first\n if not (Path(os.environ.get('UV_TOOL_DIR', '~/.local/share/uv/tools')).expanduser() / 'deepagents-code' / 'uv-receipt.toml').exists():\n     raise RuntimeError('deepagents-code is not installed as a uv tool; run: uv tool install deepagents-code')\n cmd = _uv_tool_install_command()","handlingStrategy":"try-catch","validationCode":"import tomllib\nfrom pathlib import Path\n\ndef receipt_exists(tool_root: Path) -> bool:\n    p = tool_root / 'uv-receipt.toml' if tool_root else None\n    return bool(p and p.is_file())","typeGuard":"def has_receipt(data: object) -> bool:\n    return isinstance(data, dict) and isinstance(data.get('tool'), dict)","tryCatchPattern":"try:\n    cmd = _uv_tool_install_command(tool_root=tool_root)\nexcept ToolRequirementIntrospectionError:\n    # not installed as a uv tool (or receipt missing): fall back\n    cmd = ['uv', 'tool', 'install', 'deepagents-code']","preventionTips":["Install the package with `uv tool install deepagents-code`, not pip, before using uv-specific helpers.","Keep UV_TOOL_DIR stable; do not move or prune the uv tools directory.","Check for uv-receipt.toml before running dependency-refresh or extras commands.","Regenerate the receipt with `uv tool install --force` after any manual manipulation of the tool dir."],"tags":["uv","filesystem","installation","receipt-missing"],"backgroundTag":"uv-tool-receipt-missing","analyzedSha":"a1af029e6e73cb17c36bff823d227747b28e91e1","analyzedAt":"2026-08-29T11:43:24.718Z","schemaVersion":2},"datasetVersion":"2026-08-29T12:17:43.993Z"}