Suggest conversation-based thread titles in /rename (#40495)

## What changed

- Generate a title suggestion from the latest substantive user and assistant messages when the TUI `/rename` prompt opens.
- Prefill the prompt with the result while keeping it editable and preserving any text the user enters before generation finishes.
- Bound and escape the conversation context, omit commentary and IDE context, and correlate responses with the active thread and prompt so stale suggestions are ignored.

## Testing

- Cover conversation selection and prompt construction, generated-title delivery through the embedded app server, loading and prefilled prompt states, stale responses, and preservation of manual edits.

GitOrigin-RevId: 1e7f1d5d4f6503ff9da0548388f610c446c130ca
This commit is contained in:
Felipe Coury authored and copyberry committed 2026-08-24 23:15:04 +00:00
1 parent 0c992c305d
commit 5a51caf04d
13 files changed
+877 -2

No files matched your search

+18
View File
@@ -2472,6 +2472,13 @@ impl App {
}
}
}
AppEvent::SuggestThreadName {
thread_id,
request_id,
} => {
self.suggest_thread_name(app_server, thread_id, request_id)
.await;
}
AppEvent::ThreadTitleStarted {
thread_id,
destination,
@@ -2513,6 +2520,17 @@ impl App {
}
}
}
ThreadTitleDestination::RenameSuggestion { request_id } => {
let suggestion = result
.ok()
.and_then(|response| super::thread_title::parse_thread_title(&response));
self.chat_widget.apply_thread_name_suggestion(
thread_id,
request_id,
suggestion.as_deref(),
);
}
}
}
AppEvent::StopAgentsOverviewThread { thread_id } => {