langchain-ai/deepagents · error · ToolRequirementIntrospectionError
uv tool receipt requirement {name!r} uses source fields that
Error message
uv tool receipt requirement {name!r} uses source fields that cannot be preserved automatically: {fields} What it means
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.
Source
Thrown at libs/code/deepagents_code/update_check.py:3048
if data is None:
data = _uv_tool_receipt_data(tool_root)
main = canonicalize_name(distribution_name)
for name, entry in _iter_uv_tool_requirements(data):
if canonicalize_name(name) != main:
continue
unsupported_keys = sorted(
str(key)
for key in entry
if not isinstance(key, str) or key not in {"name", "extras", "specifier"}
)
if unsupported_keys:
fields = ", ".join(unsupported_keys)
msg = (
f"uv tool receipt requirement {name!r} uses source fields "
f"that cannot be preserved automatically: {fields}"
)
raise ToolRequirementIntrospectionError(msg)
extras = entry.get("extras", [])
if not isinstance(extras, list) or any(
not isinstance(extra, str) or not is_valid_extra_name(extra)
for extra in extras
):
msg = "uv tool receipt contains invalid extras on the tool requirement"
raise ToolRequirementIntrospectionError(msg)
normalized = {canonicalize_name(extra) for extra in extras}
if len(normalized) != len(extras):
msg = "uv tool receipt contains duplicate canonical extra names"
raise ToolRequirementIntrospectionError(msg)
return normalized
msg = f"uv tool receipt does not contain a {distribution_name!r} requirement"
raise ToolRequirementIntrospectionError(msg)
def _uv_tool_with_packages(View on GitHub (pinned to a1af029e6e)
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.
Example fix
// before: receipt entry from a path install [[tool.requirements]] name = "deepagents-code" path = "/home/me/src/deepagents" editable = true // after: registry install the library can reconstruct [[tool.requirements]] name = "deepagents-code"
Defensive patterns
Strategy: try-catch
Validate before calling
import tomllib
UNSUPPORTED_SOURCE_FIELDS = {'path', 'git', 'url', 'editable', 'subdirectory', 'tag', 'branch', 'rev'}
def has_unsupported_source(data: dict, dist: str = 'deepagents-code') -> bool:
for entry in (data.get('tool') or {}).get('requirements', []):
if isinstance(entry, dict) and entry.get('name') == dist:
return bool(UNSUPPORTED_SOURCE_FIELDS & entry.keys())
return False Try / catch
try:
cmd = _uv_tool_install_command()
except ToolRequirementIntrospectionError:
# dev/path/git install: reconstruct manually with --from
cmd = ['uv', 'tool', 'install', '--force', '--from', source, 'deepagents-code'] Prevention
- 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.
When it happens
Trigger: _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.
Common situations: 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.
Related errors
- uv tool receipt is missing `[tool].requirements`
- uv tool receipt contains a non-table requirement entry
- uv tool receipt contains a requirement without a package nam
- uv tool receipt is missing `[tool]`
- uv tool receipt contains an invalid `[tool].python` value
AI-assisted analysis of langchain-ai/deepagents@a1af029e6e (2026-08-29).
Data as JSON: /api/errors/2e3350e0c4e6e6d1.
Report an issue: GitHub.