Clarify resume guidance in exit summaries (#41938)

## What changed

- Show the exact `codex resume <thread-id>` command on its own indented line.
- When a thread has a name, also explain that users can run `codex resume` and select the named thread from the picker.
- Apply command highlighting to both resume options when color is enabled.

## Testing

- Cover unnamed, empty-name, named, colored, and embedded-session exit summaries.

GitOrigin-RevId: d97c04db8a34376c6d9ea839b515b04a384b85d1
This commit is contained in:
Benjamin Carlsson authored and copyberry committed 2026-09-01 00:02:38 +00:00
1 parent 115ffaf8bf
commit 0e03f88a30
5 files changed
+82 -40

No files matched your search

@@ -52,7 +52,7 @@ async fn remote_disconnect_exit_summary_does_not_require_a_local_rollout_or_prin
#[tokio::test]
async fn embedded_exit_keeps_the_session_summary() {
let (mut app, _, _) = make_test_app_with_channels().await;
prepare_local_daemon_thread(&mut app).unwrap();
let thread_id = prepare_local_daemon_thread(&mut app).unwrap();
app.app_server_target = AppServerTarget::Embedded;
let mut exit_info = app.exit_info(ExitReason::UserRequested);
exit_info.token_usage = TokenUsage {
@@ -60,14 +60,19 @@ async fn embedded_exit_keeps_the_session_summary() {
total_tokens: 2,
..Default::default()
};
exit_info.resume_hint = Some("codex resume THREAD_ID".to_string());
assert_eq!(
exit_info.format_exit_messages(/*color_enabled*/ false),
vec![
"Token usage: total=2 input=0 output=2",
"To continue this session, run codex resume THREAD_ID",
]
);
exit_info.resume_hint = Some(ResumableThread {
thread_id,
thread_name: None,
});
let output = exit_info
.format_exit_messages(/*color_enabled*/ false)
.join("\n")
.replace(&thread_id.to_string(), "THREAD_ID");
assert_snapshot!(output, @"
Token usage: total=2 input=0 output=2
To continue this session, run:
codex resume THREAD_ID
");
}
fn prepare_local_daemon_thread(app: &mut App) -> Result<ThreadId> {