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

+2
View File
@@ -15,6 +15,8 @@ mod backend_banner_recovery_tests;
mod backend_banner_startup_tests;
#[path = "tests/background_exit_tests.rs"]
mod background_exit_tests;
#[path = "tests/background_task_defaults_tests.rs"]
mod background_task_defaults_tests;
#[path = "tests/buffered_replay.rs"]
mod buffered_replay;
#[path = "tests/connector_policy.rs"]