Preserve TUI sessions while starting replacement threads (#42671)

## Why

Starting a replacement thread can fail while reading configuration or calling
`thread/start`. The active thread and any composed input should remain available
when that happens. Remote app servers also need new threads to use their own
effective defaults instead of stale client-side model settings.

## What changed

- Read effective server configuration before starting a replacement thread,
  while preserving explicit model and reasoning-effort launch settings.
- Keep the current thread, configuration, subscriptions, and composer input
  intact until `thread/start` succeeds.
- Fall back to local defaults when an older server does not support
  `config/read`.

## Testing

Added coverage for server and managed defaults, explicit launch overrides,
remote working directories, older servers, and failures during configuration
reads or thread startup.

GitOrigin-RevId: 507a918ea2bf79c9f0adbb189bc611ecf57b757a
This commit is contained in:
Eric Traut authored and copyberry committed 2026-09-04 04:45:44 +00:00
1 parent ea2046f36d
commit b995d06050
5 files changed
+396 -16

No files matched your search

+1
View File
@@ -226,6 +226,7 @@ mod input;
mod loaded_threads;
mod misalignment_policy;
mod model_defaults;
mod new_session;
mod pending_interactive_replay;
mod permission_shortcuts;
mod pets;