# perform_uninstall_extra

> **Function** in `deepagents_code`

📖 [View in docs](https://reference.langchain.com/python/deepagents-code/update_check/perform_uninstall_extra)

Remove `extra` by rebuilding the current uv-managed tool environment.

The install lock covers both receipt inspection and uv execution, so a
concurrent upgrade, install, or removal cannot rebuild from a receipt this
call is midway through replacing. It fail-opens when the lock file is unusable
(see `update_install_lock`), so exclusion is best-effort.

## Signature

```python
perform_uninstall_extra(
    extra: str,
    *,
    progress: UpgradeProgressCallback | None = None,
    log_path: Path | None = None,
) -> ExtraRemovalOutcome
```

## Parameters

| Name | Type | Required | Description |
|------|------|----------|-------------|
| `extra` | `str` | Yes | Extra name to remove. Must satisfy `is_valid_extra_name`; invalid names are rejected without invoking uv. This mirrors the install performer's defense in depth — the name reaches a shell command, and the validation must not be refactored away. |
| `progress` | `UpgradeProgressCallback \| None` | No | Optional callback invoked for each output line. (default: `None`) |
| `log_path` | `Path \| None` | No | Optional path to persist command output. (default: `None`) |

## Returns

`ExtraRemovalOutcome`

The removal outcome. `manual_recovery_command` is generated from the
installed version and receipt while the install lock is held.
`manual_recovery_safe` is `False` when the failure was lock
contention, and `interrupted` is `True` when cancellation stopped a
rebuild after command generation.

---

[View source on GitHub](https://github.com/langchain-ai/deepagents/blob/2069079e09546060f5b52b2cd4f0e3c813e820f3/libs/code/deepagents_code/update_check.py#L4118)