Add session resume to the agent command center (#42419)

## What changed

- Add a configurable `agents.resume` action, bound to `Ctrl+O` by default, that opens the session resume picker from the agent command center.
- Preserve command-center state when the picker is cancelled, and preserve per-thread composer and queued-input state when switching sessions.
- Keep resume failures within the command-center flow and wrap footer shortcuts on narrow terminals.

## Testing

- Add coverage for picker cancellation, active-session selection, resume failures, per-thread input restoration, custom keybindings, and narrow footer layout.

GitOrigin-RevId: 59159f838a0c642200cd164e3af45b0971d29bf8
This commit is contained in:
Eric Traut authored and copyberry committed 2026-09-03 02:18:43 +00:00
1 parent b27a6321fa
commit 1d741742c5
25 files changed
+712 -170

No files matched your search

+1 -55
View File
@@ -238,61 +238,7 @@ impl App {
.await;
}
AppEvent::OpenResumePicker => {
let picker_app_server = match crate::start_app_server_for_picker(
&self.config,
&self.app_server_target,
self.state_db.clone(),
self.environment_manager.clone(),
)
.await
{
Ok(app_server) => app_server,
Err(err) => {
self.chat_widget.add_error_message(format!(
"Failed to start TUI session picker: {err}"
));
self.chat_widget.maybe_send_next_queued_input();
return Ok(AppRunControl::Continue);
}
};
match crate::resume_picker::run_resume_picker_from_existing_session_with_app_server(
tui,
&self.config,
&self.local_settings,
/*show_all*/ false,
/*include_non_interactive*/ false,
picker_app_server,
app_server.request_handle(),
self.primary_thread_id
.or(self.current_displayed_thread_id()),
)
.await?
{
SessionSelection::Resume(target_session) => {
match self
.resume_target_session(tui, app_server, target_session)
.await?
{
AppRunControl::Continue => {}
AppRunControl::Exit(reason) => {
return Ok(AppRunControl::Exit(reason));
}
}
}
SessionSelection::Exit
| SessionSelection::StartFresh
| SessionSelection::AgentsOverview => {
self.refresh_in_memory_config_from_disk_best_effort(
"closing the session picker",
)
.await;
}
SessionSelection::Fork(_) => {}
}
self.chat_widget.maybe_send_next_queued_input();
// Leaving alt-screen may blank the inline viewport; force a redraw either way.
tui.frame_requester().schedule_frame();
return self.open_resume_picker(tui, app_server).await;
}
AppEvent::OpenExternalAgentConfigMigration => {
match crate::external_agent_config_migration::flow::handle_external_agent_config_migration_prompt(