Use thread IDs in TUI resume hints (#18440)

## Summary

Fixes #18313.

Recent TUI resume breadcrumbs could print a thread title instead of the
stable thread UUID. For sessions whose title was auto-derived from the
first prompt, that made the suggested codex resume command look like it
should resume a long prompt rather than the session ID.

This updates the TUI and CLI post-exit resume hints, plus the in-session
summary shown when switching/forking threads, to always use the stable
thread ID for these recovery breadcrumbs. Explicit name-based resume
support remains available elsewhere.
This commit is contained in:
Eric Traut
2026-04-19 22:38:48 -07:00
committed by GitHub
Unverified
parent 80aecc22cd
commit fa8943fe7e
3 changed files with 12 additions and 12 deletions
+4 -4
View File
@@ -476,7 +476,6 @@ fn format_exit_messages(exit_info: AppExitInfo, color_enabled: bool) -> Vec<Stri
let AppExitInfo {
token_usage,
thread_id: conversation_id,
thread_name,
..
} = exit_info;
@@ -489,7 +488,7 @@ fn format_exit_messages(exit_info: AppExitInfo, color_enabled: bool) -> Vec<Stri
}
if let Some(resume_cmd) =
codex_core::util::resume_command(thread_name.as_deref(), conversation_id)
codex_core::util::resume_command(/*thread_name*/ None, conversation_id)
{
let command = if color_enabled {
resume_cmd.cyan().to_string()
@@ -1812,7 +1811,7 @@ mod tests {
}
#[test]
fn format_exit_messages_prefers_thread_name() {
fn format_exit_messages_uses_id_even_when_thread_has_name() {
let exit_info = sample_exit_info(
Some("123e4567-e89b-12d3-a456-426614174000"),
Some("my-thread"),
@@ -1822,7 +1821,8 @@ mod tests {
lines,
vec![
"Token usage: total=2 input=0 output=2".to_string(),
"To continue this session, run codex resume my-thread".to_string(),
"To continue this session, run codex resume 123e4567-e89b-12d3-a456-426614174000"
.to_string(),
]
);
}