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 TrautandFelipe Coury authored and GitHub committed 2026-05-18 11:32:02 -07:00
1 parent 0d344aca9b
commit 4ac3ea20a2
12 files changed
+88 -38

No files matched your search

+1 -1
View File
@@ -152,7 +152,7 @@ impl App {
if let Some(usage_line) = summary.usage_line {
lines.push(usage_line.into());
}
if let Some(command) = summary.resume_command {
if let Some(command) = summary.resume_hint {
let spans = vec![
"To continue this session, run ".into(),
command.cyan(),
+2 -2
View File
@@ -473,7 +473,7 @@ impl App {
if let Some(usage_line) = summary.usage_line {
lines.push(usage_line.into());
}
if let Some(command) = summary.resume_command {
if let Some(command) = summary.resume_hint {
let spans = vec!["To continue this session, run ".into(), command.cyan()];
lines.push(spans.into());
}
@@ -701,7 +701,7 @@ impl App {
if let Some(usage_line) = summary.usage_line {
lines.push(usage_line.into());
}
if let Some(command) = summary.resume_command {
if let Some(command) = summary.resume_hint {
let spans =
vec!["To continue this session, run ".into(), command.cyan()];
lines.push(spans.into());
@@ -57,13 +57,13 @@ async fn session_summary_includes_resume_hint_for_persisted_rollout() {
Some("Token usage: total=12 input=10 output=2".to_string())
);
assert_eq!(
summary.resume_command,
summary.resume_hint,
Some("codex resume 123e4567-e89b-12d3-a456-426614174000".to_string())
);
}
#[tokio::test]
async fn session_summary_uses_id_even_when_thread_has_name() {
async fn session_summary_names_picker_item_when_thread_has_name() {
let usage = TokenUsage {
input_tokens: 10,
output_tokens: 2,
@@ -83,7 +83,10 @@ async fn session_summary_uses_id_even_when_thread_has_name() {
)
.expect("summary");
assert_eq!(
summary.resume_command,
Some("codex resume 123e4567-e89b-12d3-a456-426614174000".to_string())
summary.resume_hint,
Some(
"codex resume, then select my-session (123e4567-e89b-12d3-a456-426614174000)"
.to_string()
)
);
}