{"record":{"id":"7bc507802206ba46","repo":"langchain-ai/deepagents","slug":"extra-extra-r-is-a-base-dependency-and-cannot-be","errorCode":null,"errorMessage":"Extra {extra!r} is a base dependency and cannot be removed.","messagePattern":"Extra (.+?) is a base dependency and cannot be removed\\.","errorType":"exception","errorClass":"ProtectedExtraError","httpStatus":null,"severity":"error","filePath":"libs/code/deepagents_code/update_check.py","lineNumber":3792,"sourceCode":"        CompositeExtraConflictError: If a selected composite supplies `extra`.\n        ExtraNotInstalledError: If `extra` is not selected in this install.\n\n    Propagates `ToolRequirementIntrospectionError` if the uv tool receipt cannot\n    be read, or does not safely describe the selected extras, the interpreter, or\n    the `--with` packages.\n    \"\"\"\n    if not is_valid_extra_name(extra):\n        msg = (\n            f\"Invalid extra name {extra!r}: must match PEP 508 \"\n            f\"({_EXTRA_NAME_RE.pattern})\"\n        )\n        raise ValueError(msg)\n    from deepagents_code.extras_info import BASE_DEPENDENCY_EXTRAS\n\n    selected_extra = canonicalize_name(extra)\n    if selected_extra in BASE_DEPENDENCY_EXTRAS:\n        msg = f\"Extra {extra!r} is a base dependency and cannot be removed.\"\n        raise ProtectedExtraError(msg)\n\n    extras = _uv_tool_selected_extras(distribution_name=distribution_name)\n    conflict = _composite_extra_conflict_message(extra, selected=extras)\n    if conflict is not None:\n        raise CompositeExtraConflictError(conflict)\n    if selected_extra not in extras:\n        listed = \", \".join(sorted(extras)) or \"(none)\"\n        msg = f\"Extra {extra!r} is not installed. Selected extras: {listed}\"\n        raise ExtraNotInstalledError(msg)\n    return _uv_tool_install_command(\n        version=version,\n        include_prereleases=_resolve_include_prereleases(\n            None, installed=_parse_version(version)\n        ),\n        distribution_name=distribution_name,\n        extras_to_remove=(selected_extra,),\n        reinstall=True,\n    )","sourceCodeStart":3774,"sourceCodeEnd":3810,"githubUrl":"https://github.com/langchain-ai/deepagents/blob/a1af029e6e73cb17c36bff823d227747b28e91e1/libs/code/deepagents_code/update_check.py#L3774-L3810","documentation":"Raised when the requested extra is one of the BASE_DEPENDENCY_EXTRAS shipped with the tool by default. Base extras are integral to the distribution and cannot be removed independently. The check compares the canonicalized name against the protected set before consulting installed extras.","triggerScenarios":"Calling the remove-extra API (update_check.py) with an extra whose canonical name is in BASE_DEPENDENCY_EXTRAS, e.g. attempting to remove a core bundled extra by any casing/normalization variant.","commonSituations":"Trying to slim down the installation by removing what looks like an optional extra but is actually a base dependency; scripting bulk removal of all extras including base ones.","solutions":["Remove only genuinely optional extras; check BASE_DEPENDENCY_EXTRAS (deepagents_code.extras_info) to see which names are protected.","If the goal is a minimal install, reinstall the tool without extras rather than removing base ones.","If you really need different base dependencies, use a different distribution or install method instead of the tool-extras flow."],"exampleFix":"// before\nremove_extra('core')  # base dependency\n// after\nremove_extra('search-tools')  # optional extra","handlingStrategy":"validation","validationCode":"from deepagents_code.extras_info import BASE_DEPENDENCY_EXTRAS\nfrom packaging.utils import canonicalize_name\nif canonicalize_name(name) in BASE_DEPENDENCY_EXTRAS:\n    raise ValueError(f'{name} is a base dependency and cannot be removed')","typeGuard":null,"tryCatchPattern":"try:\n    remove_extra(name)\nexcept ProtectedExtraError as e:\n    logger.warning('skipping protected extra: %s', e)","preventionTips":["Consult BASE_DEPENDENCY_EXTRAS before removing any extra","Filter base extras out of bulk-removal scripts","Prefer reinstalling without extras over trying to remove base ones"],"tags":["extras","validation","protected-dependency"],"backgroundTag":"protected-extra-removal","analyzedSha":"a1af029e6e73cb17c36bff823d227747b28e91e1","analyzedAt":"2026-08-29T11:43:24.718Z","schemaVersion":2},"datasetVersion":"2026-08-29T12:17:43.993Z"}