{"record":{"id":"f201305d94a6c0e5","repo":"langchain-ai/deepagents","slug":"uv-tool-receipt-contains-invalid-extras-on-the-too","errorCode":null,"errorMessage":"uv tool receipt contains invalid extras on the tool requirement","messagePattern":"uv tool receipt contains invalid extras on the tool requirement","errorType":"exception","errorClass":"ToolRequirementIntrospectionError","httpStatus":null,"severity":"error","filePath":"libs/code/deepagents_code/update_check.py","lineNumber":3055,"sourceCode":"        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(\n    *,\n    distribution_name: str = \"deepagents-code\",\n    tool_root: Path | None = None,\n    data: dict[str, Any] | None = None,\n) -> tuple[str, ...]:\n    \"\"\"Return package names recorded as uv tool `--with` requirements.\n","sourceCodeStart":3037,"sourceCodeEnd":3073,"githubUrl":"https://github.com/langchain-ai/deepagents/blob/a1af029e6e73cb17c36bff823d227747b28e91e1/libs/code/deepagents_code/update_check.py#L3037-L3073","documentation":"The `extras` field on the deepagents-code requirement entry must be a list of valid extra names (per is_valid_extra_name). A non-list value, a non-string element, or a syntactically invalid extra name fails validation and raises ToolRequirementIntrospectionError.","triggerScenarios":"_uv_tool_selected_extras reads entry.get(\"extras\", []) and raises when it is not a list, contains non-strings, or contains strings failing is_valid_extra_name; reached via _uv_tool_install_command, dependency_refresh_dry_run_command, removable_extras, or uninstall_extra_command.","commonSituations":"Receipt hand-edited with a comma-joined string (`extras = \"a,b\"`) instead of an array; typo'd extra names with invalid characters; a receipt written by other tooling with a different extras representation.","solutions":["Fix the receipt so extras is an array of valid identifier strings, e.g. `extras = [\"all\"]`.","Regenerate the receipt via `uv tool install deepagents-code --extra <name> --force`.","Check valid extra names against the deepagents-code package metadata before editing."],"exampleFix":"// before\n [[tool.requirements]]\n name = \"deepagents-code\"\n extras = \"all\"\n// after\n [[tool.requirements]]\n name = \"deepagents-code\"\n extras = [\"all\"]","handlingStrategy":"validation","validationCode":"import tomllib\n\ndef extras_valid(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            extras = entry.get('extras', [])\n            return isinstance(extras, list) and all(isinstance(e, str) and e.isidentifier() for e in extras)\n    return True","typeGuard":"def is_valid_extras(value: object) -> bool:\n    return isinstance(value, list) and all(isinstance(e, str) and bool(e) for e in value)","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":["Write extras as a TOML array of strings, never a single comma-joined string.","Verify extra names against the package's published extras before editing.","Use `uv tool install --extra <name>` to add extras so uv writes valid entries.","Skip extras surgery on receipts written by third-party tooling; reinstall instead."],"tags":["uv","extras","validation"],"backgroundTag":"schema-validation-failed","analyzedSha":"a1af029e6e73cb17c36bff823d227747b28e91e1","analyzedAt":"2026-08-29T11:43:24.718Z","schemaVersion":2},"datasetVersion":"2026-08-29T12:17:43.993Z"}