agent: Fix issues when editing thread title (#52388)

## Context

Follow up to #52193

We changed this code in #52193, but moving the thread title read outside
of the spawn, causes a loop of title updated events

## Self-Review Checklist

<!-- Check before requesting review: -->
- [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)
- [ ] Tests cover the new/changed behavior
- [x] Performance impact has been considered and is acceptable

Release Notes:

- N/A
b67c162ec4Bennet Bo Fenner committed on 3/25/2026, 8:08:20 AM· committed by GitHubparent3d5ec54
1 file changedLine totals unavailable