Fall back to summary history for read-only conversations (#45980)

## Why

History paging failures can prevent the TUI from opening a conversation that is already open elsewhere, even when its prompts and final replies are available through turn summaries.

## What changed

- When paginated read-only history loading fails, request the latest 100 turns from `thread/turns/list` with `itemsView: summary` and display them in chronological order.
- Clear history pagination state and show a notice that intermediate messages and tool activity are unavailable. Surface the notice during startup, session selection, and command center selection.
- Show a concise retry message when the command center cannot load the conversation, preserving the current conversation.

## Testing

Extend read-only history tests to cover summary recovery, the 100-turn limit and ordering, the user notice, and preservation of the current conversation when both history loading methods fail.

GitOrigin-RevId: c9f06ad58ed5573ce0b4578f429558bfd475830f
This commit is contained in:
Eric Traut authored and copyberry committed 2026-09-16 16:46:10 +00:00
1 parent 5761102868
commit d7104e268b
6 files changed
+239 -42

No files matched your search

+9 -1
View File
@@ -378,6 +378,7 @@ impl App {
let mut start_in_agents_overview =
matches!(&session_selection, SessionSelection::AgentsOverview);
let mut read_only_thread = false;
let mut history_notice = None;
let (mut chat_widget, initial_started_thread) = match session_selection {
SessionSelection::StartFresh
| SessionSelection::Exit
@@ -493,7 +494,10 @@ impl App {
)
.await
{
Ok(result) => result,
Ok(result) => result.map(|(thread, notice)| {
history_notice = notice;
thread
}),
Err(err) => return shutdown_on_startup_error(app_server, err).await,
}
}
@@ -851,6 +855,10 @@ See the Codex keymap documentation for supported actions and examples."
if read_only_thread {
app.ensure_thread_channel(thread_id).mark_external_writer();
app.chat_widget.show_external_writer_thread();
if let Some(notice) = history_notice {
app.chat_widget
.add_info_message(notice.to_string(), /*hint*/ None);
}
}
if !read_only_thread
&& should_prompt_for_paused_goal_after_startup_resume