From fa8943fe7e81ad2316de13ce7da24d5a28318f2d Mon Sep 17 00:00:00 2001 From: Eric Traut Date: Sun, 19 Apr 2026 22:38:48 -0700 Subject: [PATCH] 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. --- codex-rs/cli/src/main.rs | 8 ++++---- codex-rs/tui/src/app.rs | 11 +++++------ codex-rs/tui/src/main.rs | 5 +++-- 3 files changed, 12 insertions(+), 12 deletions(-) diff --git a/codex-rs/cli/src/main.rs b/codex-rs/cli/src/main.rs index ddee32929..e8f95d648 100644 --- a/codex-rs/cli/src/main.rs +++ b/codex-rs/cli/src/main.rs @@ -476,7 +476,6 @@ fn format_exit_messages(exit_info: AppExitInfo, color_enabled: bool) -> Vec Vec, ) -> Option { let usage_line = (!token_usage.is_zero()).then(|| FinalOutput::from(token_usage).to_string()); - let (thread_id, thread_name) = resumable_thread(thread_id, thread_name, rollout_path) - .map(|thread| (Some(thread.thread_id), thread.thread_name)) - .unwrap_or((None, None)); + let thread_id = + resumable_thread(thread_id, thread_name, rollout_path).map(|thread| thread.thread_id); let resume_command = - crate::legacy_core::util::resume_command(thread_name.as_deref(), thread_id); + crate::legacy_core::util::resume_command(/*thread_name*/ None, thread_id); if usage_line.is_none() && resume_command.is_none() { return None; @@ -12326,7 +12325,7 @@ guardian_approval = true } #[tokio::test] - async fn session_summary_prefers_name_over_id() { + async fn session_summary_uses_id_even_when_thread_has_name() { let usage = TokenUsage { input_tokens: 10, output_tokens: 2, @@ -12347,7 +12346,7 @@ guardian_approval = true .expect("summary"); assert_eq!( summary.resume_command, - Some("codex resume my-session".to_string()) + Some("codex resume 123e4567-e89b-12d3-a456-426614174000".to_string()) ); } } diff --git a/codex-rs/tui/src/main.rs b/codex-rs/tui/src/main.rs index 48ef3e4cd..386aa2180 100644 --- a/codex-rs/tui/src/main.rs +++ b/codex-rs/tui/src/main.rs @@ -13,7 +13,6 @@ fn format_exit_messages(exit_info: AppExitInfo, color_enabled: bool) -> Vec Vec