agent_ui: Fix agent notifications showing old title after rename (#64907)
## Summary
Renaming a thread whose agent can't set titles (external ACP agents such
as Claude Code) only stores the new name as a `title_override` in
`ThreadMetadataStore`, while the root `AcpThread` keeps the
agent-provided title. The sidebar and the panel's title editor already
prefer the override, but the agent notification read
`AcpThread::title()` directly, so after a rename it kept showing the
thread's original title.
This makes the notification prefer the title override, matching the
precedence already used by the `TitleUpdated` handler. The same title is
passed along when the notification's "View" button loads the thread.
- Extract `ConversationView::title_override` and reuse it in the
`TitleUpdated` handler and `show_notification`
- Add `StubAgentConnection::with_supports_set_title` so tests can model
agents without `set_title` support
## Testing
- Added
`test_notification_uses_renamed_title_when_agent_cannot_set_title`: it
fails without the fix (the notification shows the agent's title) and
passes with it
- `cargo test -p agent_ui notification` and `./script/clippy -p agent_ui
-p acp_thread` pass
- Manually tested on macOS with Claude Code in a dev build: create a
thread, rename it, send another prompt with Zed in the background; the
notification now shows the new title and "View" opens the thread
### Manual test
#### Before:
creating thread and run prompt:
<img width="1341" height="771" alt="image"
src="https://github.com/user-attachments/assets/76a42b32-b238-403d-91eb-4cdd38908fcf"
/>
notification working!
<img width="474" height="93" alt="image"
src="https://github.com/user-attachments/assets/3e7e4572-2abe-47fd-9044-ff69f82cb54d"
/>
rename and run prompt:
<img width="1456" height="830" alt="image"
src="https://github.com/user-attachments/assets/dbafe4b8-cbd0-4691-a34e-295123991774"
/>
notification with incorrect name and view button not working!
<img width="463" height="89" alt="image"
src="https://github.com/user-attachments/assets/360fd555-22a6-462f-b761-92c67e5acdd8"
/>
#### After
creating thread and run prompt:
<img width="1240" height="833" alt="image"
src="https://github.com/user-attachments/assets/09e530da-4de6-4ca3-b76d-26898bde6c12"
/>
notification working!
<img width="466" height="94" alt="image"
src="https://github.com/user-attachments/assets/5b998271-2ab7-4cec-8b0b-6c93a31e48b4"
/>
rename and run prompt:
<img width="1242" height="828" alt="image"
src="https://github.com/user-attachments/assets/dcbd88f3-ce92-4ce6-acd0-640941c7d12f"
/>
notification with correct name and view button working!
<img width="472" height="88" alt="image"
src="https://github.com/user-attachments/assets/3860768f-cc2b-4028-9e7f-3236001e24a3"
/>
## Self-review
- [x] I've reviewed my diff for quality, security, reliability, and
performance.
- [x] UI changes follow the
[checklist](https://zed.dev/docs/development/ui-checklist).
- [x] Tests cover the new or changed behavior.
Release Notes:
- Fixed agent notifications showing a thread's original title after the
thread was renamed
---------
Co-authored-by: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Co-authored-by: Christopher Biscardi <chris@christopherbiscardi.com>
414428c592Fabrício Lima committed on 9/30/2026, 5:03:06 AM· committed by GitHubparentafecd6d