Clarify resume hints for renamed threads (#23234)

Addresses #23181

## Why
Renamed threads can share names, so hints that suggest resuming directly
by name are ambiguous. Issue #23181 asks for the picker hint to include
the thread name and thread ID in parens so users can disambiguate
safely.

## What
- Adds a shared resume hint formatter for named threads: run `codex
resume`, then select `<name> (<thread-id>)`.
- Uses that hint for /rename confirmations, TUI session summaries, and
CLI/TUI exit messages.
- Keeps direct `codex resume <thread-id>` guidance for unnamed threads.

## Verification
Manually verified that message after `/rename` and after `/exit` include
session ID in parens.

---------

Co-authored-by: Felipe Coury <felipe.coury@openai.com>
This commit is contained in:
Eric Traut
2026-05-18 11:32:02 -07:00
committed by GitHub
co-authored by Felipe Coury
parent 0d344aca9b
commit 4ac3ea20a2
12 changed files with 88 additions and 38 deletions
@@ -0,0 +1,5 @@
---
source: tui/src/chatwidget/tests/app_server.rs
expression: rendered
---
• Thread renamed to review-fix. To resume this thread run codex resume, then select review-fix (123e4567-e89b-12d3-a456-426614174000)
@@ -861,7 +861,8 @@ async fn live_app_server_invalid_thread_name_update_is_ignored() {
#[tokio::test]
async fn live_app_server_thread_name_update_shows_resume_hint() {
let (mut chat, mut rx, _op_rx) = make_chatwidget_manual(/*model_override*/ None).await;
let thread_id = ThreadId::new();
let thread_id =
ThreadId::from_string("123e4567-e89b-12d3-a456-426614174000").expect("thread id");
chat.thread_id = Some(thread_id);
chat.handle_server_notification(
@@ -878,8 +879,7 @@ async fn live_app_server_thread_name_update_shows_resume_hint() {
let cells = drain_insert_history(&mut rx);
assert_eq!(cells.len(), 1);
let rendered = lines_to_single_string(&cells[0]);
assert!(rendered.contains("Thread renamed to review-fix"));
assert!(rendered.contains("codex resume review-fix"));
assert_chatwidget_snapshot!("thread_name_update_resume_hint", rendered);
}
#[tokio::test]