Cancel pending thread title generation after manual renames (#45108)

## Why

Saving a manual thread name leaves pending title generation running and its progress indicator visible until the request finishes.

## What changed

- Cancel pending title requests after a successful manual rename, including renames from the agents overview, and clear the progress indicator immediately.
- Interrupt canceled title-generation turns and unsubscribe their temporary threads. Ignore late start and completion events so canceled requests cannot affect newer requests.
- Cancel pending title requests when resetting connection state.
- Show only a spinner when generating a title without an existing name, removing the `renaming...` placeholder.

## Testing

Add regression tests for manual and overview renames that verify turn interruption, cleanup, and preservation of the saved name. Cover late events after cancellation and update footer and terminal-title snapshots for the spinner-only display.

GitOrigin-RevId: f9490ea7be9968ea6c35d80bfbac06fee57d0135
This commit is contained in:
Felipe Coury authored and copyberry committed 2026-09-12 20:22:47 +00:00
1 parent b04a2c2645
commit b4c864dd64
17 files changed
+311 -54

No files matched your search

+1
View File
@@ -908,6 +908,7 @@ impl App {
let name = name.to_string();
app_server.thread_set_name(thread_id, name.clone()).await?;
self.chat_widget.expect_manual_thread_name(thread_id, name);
self.cancel_thread_title_generation(thread_id);
Ok(true)
}
AppCommand::Review { target } => {