# agent: Reset panel thread picker after git worktree creation \(\#53372\) · gitcafe/zed

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

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

Visibility: public

Requested revision: 8b65a991577f049283da9548b41f571c3a924307

Requested commit: 8b65a991577f049283da9548b41f571c3a924307

Commit: 8b65a991577f049283da9548b41f571c3a924307

Tree: 1af7b950e1168f6649bf652aaa622382ad127e5f

Author: Anthony Eid

Committer: GitHub

## Message

```
agent: Reset panel thread picker after git worktree creation (#53372)

After a user creates successfully creates a new git worktree we reset
the agent thread picker state to avoid accidentally creating a new
worktree for a thread.

This also fixes some bugs where a past agent thread picker state was
invalid because it became out of sync after a new worktree was created,
or when a mutating git operation occurred.

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:

- N/A or Added/Fixed/Improved ...
```

## Parents

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

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