# agent_ui: Inherit source agent without draft content \(\#58636\) · gitcafe/zed

[View on GitCafe](https://git.cafe/gitcafe/zed/commit/116e4bc18485223b0751000ca5904be78660cb27)

Repository: [gitcafe/zed](https://git.cafe/gitcafe/zed)

Visibility: public

Requested revision: 116e4bc18485223b0751000ca5904be78660cb27

Requested commit: 116e4bc18485223b0751000ca5904be78660cb27

Commit: 116e4bc18485223b0751000ca5904be78660cb27

Tree: a12b21f7462fedbd71123c45f46c7c66c61a8e9e

Author: Ben Brandt

Committer: GitHub

## Message

```
agent_ui: Inherit source agent without draft content (#58636)

Noticed that when you had an empty draft and created a worktree we
weren't respecting agent selection. It was because of an early ? return
on an option, and should be fixed now.

Self-Review Checklist:

- [x] I've reviewed my own diff for quality, security, and reliability
- [x] Unsafe blocks (if any) have justifying comments
- [x] The content is consistent with the [UI/UX
checklist](https://github.com/zed-industries/zed/blob/main/CONTRIBUTING.md#uiux-checklist)
- [x] Tests cover the new/changed behavior
- [x]  Performance impact has been considered and is acceptable

Release Notes:

- agent: Fix for current agent not being selected when creating a new
git worktree
```

## Parents

- [1eefc3b9e9836fbbb3d8c760a1f5d5e2a6152fd8](https://git.cafe/gitcafe/zed/commit/1eefc3b9e9836fbbb3d8c760a1f5d5e2a6152fd8?format=markdown)

[Source at this commit](https://git.cafe/gitcafe/zed/tree/116e4bc18485223b0751000ca5904be78660cb27?format=markdown)
