Check folder consent before creating or resuming TUI tasks (#44755)

## What changed

- Check directory trust when dispatching tasks from Agent Command Center, resuming sessions, and opening loaded tasks.
- Return connected users to Agent Command Center when they cancel folder consent. Clear launch prompts and images on startup cancellation, and restore the composer draft when task dispatch is canceled.
- Reload local configuration after saving folder trust and review startup hooks before creating a new task.
- Label connected consent screens with “Back to Agent Command Center”; retain quit behavior for embedded sessions.

## Testing

Add a terminal integration test covering unknown and untrusted folders, server-authoritative trust, cancellation and retry, resumed tasks with changed directories, and hook review before task creation. Update consent-screen snapshots.

GitOrigin-RevId: db88d2113fd47bc4c57369cc20ebf3042e6fb7ab
This commit is contained in:
Eric Traut authored and copyberry committed 2026-09-11 07:13:19 +00:00
1 parent b9934480bf
commit 02a8f038b8
20 files changed
+544 -42

No files matched your search

+3 -4
View File
@@ -7629,9 +7629,8 @@ async fn remote_resume_keeps_server_only_cwd_out_of_local_config() -> Result<()>
auth_token: None,
},
};
let mut app_server = Box::pin(crate::start_embedded_app_server_for_picker(&app.config))
.await?
.with_remote_cwd_override(Some(remote_cwd.clone()));
app.harness_overrides.cwd = Some(remote_cwd.clone());
let mut app_server = Box::pin(crate::start_embedded_app_server_for_picker(&app.config)).await?;
app_server
.resume_thread(
&crate::local_settings::LocalSettings::from(&app.config),
@@ -7666,7 +7665,7 @@ async fn remote_resume_keeps_server_only_cwd_out_of_local_config() -> Result<()>
.await?;
assert!(matches!(control, AppRunControl::Continue));
assert_eq!(app_server.remote_cwd_override(), Some(remote_cwd.as_path()));
assert_eq!(app.harness_overrides.cwd, Some(remote_cwd));
assert!(!crate::session_resume::cwds_differ(
app.config.cwd.as_path(),
&local_cwd,