# detect_shadowed_dcode

> **Function** in `deepagents_code`

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

Return the shadowing dcode entry point on the user's PATH, if any.

After a successful `uv tool upgrade`, the upgraded binary only takes effect
on the next launch if the user's `PATH` resolves to uv's tool bin dir for
`dcode` (and `deepagents-code`). A pre-uv install earlier on `PATH` will
silently win and report the old version, which looks like "the upgrade
didn't work" to the user.

This compares each supported console script against uv's tool bin dir. A
mismatch means a different binary will run next launch for that entry point.

Caveat: a `dcode` symlink that lives in some unrelated bin dir but
points *into* the upgraded tool venv (e.g. a manually-created
convenience symlink) is reported as shadowing even though the next
launch would actually run the upgraded entry point. Comparing
directories rather than resolved targets is intentional — see the
inline note below for why — and this edge is rare enough that we
accept a benign false positive over a class of false negatives.

## Signature

```python
detect_shadowed_dcode() -> ShadowedDcode | None
```

## Returns

`ShadowedDcode | None`

A `ShadowedDcode` describing the conflict, or `None` when there is no
shadowing binary (the common case) or when detection is not
applicable (non-uv install, uv bin dir unknown, no supported entry
point on `PATH` at all).

---

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