agent_ui: Show base name for duplicate file mentions in the Agent Panel (#59845)

# Objective

- Fixes #59654

When the same file was added as a mention more than once in the Agent
Panel,
the label would expand to the full absolute path instead of staying at
the
base filename.

Before

<img width="734" height="438" alt="Screenshot 2026-06-24 at 11 19 30 AM"
src="https://github.com/user-attachments/assets/94450eef-088a-49aa-97d3-80d6dd06925b"
/>

## Solution

The algorithm in `compute_disambiguation_details` treats two
entries with the same URI as a "collision" and tries to resolve it by
adding
more parent path components. Since the paths are identical it can never
succeed and keeps escalating to the full path.

Fix by deduplicating URIs via a `HashSet` before passing them to
`compute_disambiguation_details`, so identical mentions share a single
entry
and are never flagged as collisions.

## Testing

Reproduced by opening the Agent Panel, adding the same file as a mention
twice, and observing the label. Before: label showed the full absolute
path.
After: label stays at the base filename.

Tested on macOS.

After

<img width="638" height="215" alt="Screenshot 2026-06-24 at 11 20 09 AM"
src="https://github.com/user-attachments/assets/5acac2bd-d5a3-41c4-827c-84ccdc3a064d"
/>


## Self-Review Checklist:

- [x] I've reviewed my own diff for quality, security, and reliability

---

Release Notes:

- Fixed duplicate file mentions in the Agent Panel showing the full
absolute
  path instead of the base filename.

---------

Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-authored-by: Danilo Leal <daniloleal09@gmail.com>
6e085b2fdcYash Patodkar committed on 6/25/2026, 12:26:56 PM· committed by GitHubparentced0d85
1 file changedLine totals unavailable