agent_ui: Fix worktree naming regression when using existing branches (#53669)

When creating a new git worktree from an existing branch (e.g. `main`),
the worktree directory was incorrectly named after the branch instead of
getting a random adjective-noun name. Additionally, if a directory with
that name already existed, the rollback logic could destructively delete
the pre-existing worktree.

Changes:
- Generate a random adjective-noun name for worktree directories when no
explicit name is provided
- Collect existing worktree directory names to avoid collisions
- Check generated paths against known worktree paths before creating
- Reduce random name retry count from 100 to 10
- Add regression test

Release Notes:

- Fixed a regression where creating a git worktree from an existing
branch would name the worktree directory after the branch (instead of
generating a random name)
1c1f2d6f4cRichard Feldman committed on 4/13/2026, 8:12:36 PM· committed by GitHubparentd0c8109
2 files changedLine totals unavailable