Use server defaults when starting TUI background tasks (#43261)

## Why

Background tasks launched from the agents overview could use client model settings instead of the server defaults for the destination directory.

## What changed

- Read `config/read` for the task's destination before starting the thread, preserving explicit launch settings and applying managed new-thread defaults.
- Use the server's model provider for embedded sessions when no model or provider override is set. When the server clears the model and fast mode is enabled, resolve the fallback model from the server catalog.
- Restore the prompt and show an error if settings cannot be loaded. Keep the existing fallback for older servers that do not support `config/read`.

## Testing

Add request-level tests for local and remote destinations, model and provider selection, explicit and managed defaults, fast-mode fallback, and prompt recovery after a configuration read failure.

GitOrigin-RevId: 50c84fba964463303442dd849e1280bcd5b4f467
This commit is contained in:
Eric Traut authored and copyberry committed 2026-09-06 18:23:55 +00:00
1 parent 4aec23384e
commit 7bab4526f9
5 files changed
+456 -19

No files matched your search

@@ -99,7 +99,7 @@ async fn same_thread_retry_keeps_subscription_and_restores_draft() -> Result<()>
}
#[derive(Clone, Copy, Debug, Eq, PartialEq)]
enum HistoryCapabilities {
pub(super) enum HistoryCapabilities {
Current,
LegacyOnly,
LegacyOnlyUnsupportedVariant,
@@ -158,7 +158,7 @@ pub(super) async fn start_recording_remote_app_server(
}
/// Proxies a real app server while optionally rejecting modern pagination like an older server.
async fn start_recording_app_server_with_history(
pub(super) async fn start_recording_app_server_with_history(
config: &Config,
history_capabilities: HistoryCapabilities,
mut blocked_thread_list: Option<(ThreadId, oneshot::Sender<()>, oneshot::Receiver<()>)>,