Return to the agent command center after archiving on shared servers (#44337)

## Why

`/archive` exits the TUI even when connected to a local daemon or remote app server, interrupting access to other tasks.

## What changed

- Keep the TUI running after a successful archive on local daemon and remote connections, and reopen the agent command center.
- Shut down side conversations before archiving, then clear the archived thread's local state, transcript, and unsent draft.
- Preserve exit-on-archive behavior for the embedded app server and remove the exit promise from `/archive` help and confirmation text.

## Testing

Add coverage for local daemon and remote connections, including side-thread cleanup, archive requests, cleared session state, and the resulting command center snapshot. Retain coverage for embedded archive success and failure.

GitOrigin-RevId: 36c61ec76a13a3fc1b5d6725e3b8f42a97fe6793
This commit is contained in:
Eric Traut authored and copyberry committed 2026-09-09 23:50:28 +00:00
1 parent 0df6366a87
commit d390f0a09c
8 files changed
+227 -82

No files matched your search

@@ -188,8 +188,7 @@ impl ChatWidget {
self.bottom_pane.show_selection_view(SelectionViewParams {
title: Some("Archive this session?".to_string()),
subtitle: Some(
"Are you sure? This will archive the current session and exit Codex"
.to_string(),
"Are you sure? This will archive the current session".to_string(),
),
footer_hint: Some(standard_popup_hint_line()),
items: vec![
@@ -200,7 +199,7 @@ impl ChatWidget {
..Default::default()
},
SelectionItem {
name: "Yes, archive and exit".to_string(),
name: "Yes, archive".to_string(),
description: Some("Archive this session now".to_string()),
actions: vec![Box::new(|tx| {
tx.send(AppEvent::ArchiveCurrentThread);
@@ -3,9 +3,9 @@ source: tui/src/chatwidget/tests/slash_commands.rs
expression: popup
---
Archive this session?
Are you sure? This will archive the current session and exit Codex
Are you sure? This will archive the current session
› 1. No, don't archive Return to the current session
2. Yes, archive and exit Archive this session now
› 1. No, don't archive Return to the current session
2. Yes, archive Archive this session now
Press enter to confirm or esc to go back