Keep TUI prompt history tied to local settings (#42791)

## Why

Prompt history is client-owned state, but app-server thread lifecycle responses derived its metadata from the active server configuration. When server and local settings differ, the TUI can advertise metadata for the wrong history log.

## What changed

- Pass `LocalSettings` through thread start, resume, and fork response handling.
- Build message-history metadata from the local Codex home and history preferences while continuing to use the thread configuration for server-owned session fields.

## Testing

- Cover local history metadata across embedded and remote start, resume, and fork flows with deliberately different server settings.
- Verify single-entry and batched history lookups return entries from the local prompt history.

GitOrigin-RevId: 8b47230a4e9f2d342b8d79fd575d474c9062b05e
This commit is contained in:
Eric Traut authored and copyberry committed 2026-09-04 15:58:02 +00:00
1 parent b3f5e45cc1
commit a07158c784
11 files changed
+211 -38

No files matched your search

+8 -1
View File
@@ -22,6 +22,7 @@ async fn resolve_runtime_model_provider_base_url(provider: &ModelProviderInfo) -
fn spawn_startup_thread_start(
app_server: &AppServerSession,
local_settings: crate::local_settings::LocalSettings,
config: Config,
app_event_tx: AppEventSender,
) {
@@ -32,6 +33,7 @@ fn spawn_startup_thread_start(
tokio::spawn(async move {
let result = crate::app_server_session::start_thread_with_request_handle(
request_handle,
&local_settings,
config,
thread_params_mode,
remote_cwd_override,
@@ -288,7 +290,12 @@ impl App {
| SessionSelection::Exit
| SessionSelection::AgentsOverview => {
if !start_in_agents_overview {
spawn_startup_thread_start(&app_server, config.clone(), app_event_tx.clone());
spawn_startup_thread_start(
&app_server,
local_settings.clone(),
config.clone(),
app_event_tx.clone(),
);
}
// Count a startup tooltip once the initial chat widget can render it.
let startup_tooltip_override = if start_in_agents_overview {