# agent_ui: Use selected agent for new threads \(\#52888\) · gitcafe/zed

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

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

Visibility: public

Requested revision: 02e8914fe0979f95fe0bd779dfc07de9d8027d52

Requested commit: 02e8914fe0979f95fe0bd779dfc07de9d8027d52

Commit: 02e8914fe0979f95fe0bd779dfc07de9d8027d52

Tree: fca954269447e71b67f10ce1a7f3ccde25e21134

Author: Ben Brandt

Committer: GitHub

## Message

```
agent_ui: Use selected agent for new threads (#52888)

Persist the last used agent globally as a fallback for new
workspaces, keep per-workspace selections independent. This should mean
"new thread" should grab whatever agent you are currently looking at,
and won't leak across projects.

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: Prefer the currently used agent per-project when creating a new
thread.

Co-authored-by: Bennet Bo Fenner <bennetbo@gmx.de>
Co-authored-by: MrSubidubi <dev@bahn.sh>
```

## Parents

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

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