{"record":{"id":"2e3350e0c4e6e6d1","repo":"langchain-ai/deepagents","slug":"uv-tool-receipt-requirement-name-r-uses-source-f","errorCode":null,"errorMessage":"uv tool receipt requirement {name!r} uses source fields that cannot be preserved automatically: {fields}","messagePattern":"uv tool receipt requirement (.+?) uses source fields that cannot be preserved automatically: (.+?)","errorType":"exception","errorClass":"ToolRequirementIntrospectionError","httpStatus":null,"severity":"error","filePath":"libs/code/deepagents_code/update_check.py","lineNumber":3048,"sourceCode":"    if data is None:\n        data = _uv_tool_receipt_data(tool_root)\n\n    main = canonicalize_name(distribution_name)\n    for name, entry in _iter_uv_tool_requirements(data):\n        if canonicalize_name(name) != main:\n            continue\n        unsupported_keys = sorted(\n            str(key)\n            for key in entry\n            if not isinstance(key, str) or key not in {\"name\", \"extras\", \"specifier\"}\n        )\n        if unsupported_keys:\n            fields = \", \".join(unsupported_keys)\n            msg = (\n                f\"uv tool receipt requirement {name!r} uses source fields \"\n                f\"that cannot be preserved automatically: {fields}\"\n            )\n            raise ToolRequirementIntrospectionError(msg)\n        extras = entry.get(\"extras\", [])\n        if not isinstance(extras, list) or any(\n            not isinstance(extra, str) or not is_valid_extra_name(extra)\n            for extra in extras\n        ):\n            msg = \"uv tool receipt contains invalid extras on the tool requirement\"\n            raise ToolRequirementIntrospectionError(msg)\n        normalized = {canonicalize_name(extra) for extra in extras}\n        if len(normalized) != len(extras):\n            msg = \"uv tool receipt contains duplicate canonical extra names\"\n            raise ToolRequirementIntrospectionError(msg)\n        return normalized\n\n    msg = f\"uv tool receipt does not contain a {distribution_name!r} requirement\"\n    raise ToolRequirementIntrospectionError(msg)\n\n\ndef _uv_tool_with_packages(","sourceCodeStart":3030,"sourceCodeEnd":3066,"githubUrl":"https://github.com/langchain-ai/deepagents/blob/a1af029e6e73cb17c36bff823d227747b28e91e1/libs/code/deepagents_code/update_check.py#L3030-L3066","documentation":"The deepagents-code requirement entry in the receipt uses source fields (unsupported keys such as path, git, url, editable) that the library cannot round-trip when rebuilding the `uv tool install` command. Because reconstructed installs would silently lose the custom source, the library refuses and raises ToolRequirementIntrospectionError listing the offending fields.","triggerScenarios":"_uv_tool_selected_extras (called by _uv_tool_install_command, dependency_refresh_dry_run_command, removable_extras, or uninstall_extra_command) inspects the deepagents-code requirement entry and finds unsupported source keys present.","commonSituations":"deepagents-code installed from a local path or git URL (`uv tool install --from`/`--editable`/git) so the receipt records non-registry source fields; a CI caches such an install and later tries dependency refresh or extras management.","solutions":["Reinstall from the registry: `uv tool install deepagents-code --force` so the receipt has no source fields.","If a custom source is required, manage extras/updates manually with an explicit `uv tool install --from <source> deepagents-code ...` command instead of the library's introspection helpers.","Identify the listed unsupported fields in the receipt entry and decide whether to keep them out of automated refresh flows."],"exampleFix":"// before: receipt entry from a path install\n [[tool.requirements]]\n name = \"deepagents-code\"\n path = \"/home/me/src/deepagents\"\n editable = true\n// after: registry install the library can reconstruct\n [[tool.requirements]]\n name = \"deepagents-code\"","handlingStrategy":"try-catch","validationCode":"import tomllib\n\nUNSUPPORTED_SOURCE_FIELDS = {'path', 'git', 'url', 'editable', 'subdirectory', 'tag', 'branch', 'rev'}\n\ndef has_unsupported_source(data: dict, dist: str = 'deepagents-code') -> bool:\n    for entry in (data.get('tool') or {}).get('requirements', []):\n        if isinstance(entry, dict) and entry.get('name') == dist:\n            return bool(UNSUPPORTED_SOURCE_FIELDS & entry.keys())\n    return False","typeGuard":null,"tryCatchPattern":"try:\n    cmd = _uv_tool_install_command()\nexcept ToolRequirementIntrospectionError:\n    # dev/path/git install: reconstruct manually with --from\n    cmd = ['uv', 'tool', 'install', '--force', '--from', source, 'deepagents-code']","preventionTips":["Install deepagents-code from the registry when you intend to manage extras/updates programmatically.","Avoid `--editable`/path/git installs in CI where automatic dependency refresh runs.","Keep a record of the original install command if a custom source is required.","Inspect the receipt entry keys before calling refresh/removal helpers."],"tags":["uv","receipt-schema","unsupported-source"],"backgroundTag":"unsupported-install-source","analyzedSha":"a1af029e6e73cb17c36bff823d227747b28e91e1","analyzedAt":"2026-08-29T11:43:24.718Z","schemaVersion":2},"datasetVersion":"2026-08-29T12:17:43.993Z"}