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 -1
View File
@@ -785,7 +785,7 @@ See the Codex keymap documentation for supported actions and examples."
pending_realtime_transcript_replay: HashMap::new(),
realtime_replay_order: VecDeque::new(),
temporary_structured_requests: HashMap::new(),
pending_thread_titles: HashSet::new(),
pending_thread_titles: HashMap::new(),
thread_event_listener_tasks: HashMap::new(),
agent_navigation: AgentNavigationState::default(),
agents_overview: Default::default(),