Display reconnect commands on a separate line (#48350)

## What changed

Print `To reconnect, run:` followed by the indented resume command on its own line in disconnect exit summaries. Update CLI expectations and TUI snapshots for the new layout, and adjust the remote reconnect test to parse the command from its new line.

GitOrigin-RevId: 46f05084482063cf4f196b3b49471f331bc91384
This commit is contained in:
Eric Traut
2026-09-26 04:09:02 +00:00
committed by copyberry
parent c9e2520707
commit 09a3d2108f
6 changed files with 11 additions and 6 deletions
+2 -1
View File
@@ -3724,7 +3724,8 @@ mod tests {
exit_info.format_exit_messages(/*color_enabled*/ false),
vec![
"Disconnected from this task. Any running work continues.",
"Reconnect: codex --remote wss://example.com:443/ --remote-auth-token-env CODEX_REMOTE_TOKEN resume 123e4567-e89b-12d3-a456-426614174000",
"To reconnect, run:",
" codex --remote wss://example.com:443/ --remote-auth-token-env CODEX_REMOTE_TOKEN resume 123e4567-e89b-12d3-a456-426614174000",
"Stop the current turn: run codex --remote wss://example.com:443/ --remote-auth-token-env CODEX_REMOTE_TOKEN agents, select this task, and press ctrl + x.",
"Token usage so far: total=2 input=0 output=2",
]
+2 -1
View File
@@ -104,8 +104,9 @@ impl AppExitInfo {
lines.push(message.to_string());
let mut resume_command = disconnect.command.clone();
resume_command.extend(["resume".to_string(), thread_id.to_string()]);
lines.push("To reconnect, run:".to_string());
lines.push(format!(
"Reconnect: {}",
" {}",
color_command(escape_command(&resume_command)),
));
if !turn_interrupted {
@@ -225,7 +225,7 @@ async fn remote_disconnect_exit_summary_does_not_require_a_local_rollout_or_prin
));
let exit_info = app.exit_info(ExitReason::Fatal("connection lost".to_string()));
let lines = exit_info.format_exit_messages(/*color_enabled*/ false);
let command = shlex::split(lines[1].strip_prefix("Reconnect: ").unwrap()).unwrap();
let command = shlex::split(&lines[2]).unwrap();
assert_eq!(
crate::resolve_remote_addr(&command[2]).unwrap(),
crate::RemoteAppServerEndpoint::WebSocket {
@@ -3,6 +3,7 @@ source: tui/src/app/tests/background_exit_tests.rs
expression: output
---
Disconnected from this task. Any running work continues.
Reconnect: codex resume THREAD_ID
To reconnect, run:
codex resume THREAD_ID
Stop the current turn: run codex agents, select this task, and press f10.
Token usage so far: total=12 input=10 output=2
@@ -3,4 +3,5 @@ source: tui/src/app/tests/background_exit_tests.rs
expression: output
---
Disconnected from this task. The current turn was stopped.
Reconnect: codex resume THREAD_ID
To reconnect, run:
codex resume THREAD_ID
@@ -3,5 +3,6 @@ source: tui/src/app/tests/background_exit_tests.rs
expression: "lines.join(\"\\n\")"
---
Disconnected from this task. Work may still be running.
Reconnect: codex --remote wss://example.com:443/ resume 123e4567-e89b-12d3-a456-426614174000
To reconnect, run:
codex --remote wss://example.com:443/ resume 123e4567-e89b-12d3-a456-426614174000
Stop the current turn: run codex --remote wss://example.com:443/ agents, select this task, and press x.