Add a test for remote tool use by the agent (#30289)

- Adds a new smoke test for the use of the read_file tool by the agent
in an SSH project
- Fixes the SSH shutdown sequence to use a timer from the app's executor
instead of always using a real timer
- Changes the main executor loop for tests to advance the clock
automatically instead of panicking with `parked with nothing left to
run` when there is a delayed task

Release Notes:

- N/A
This commit is contained in:
Cole Miller 2025-05-08 16:53:04 -04:00 committed by GitHub
parent 660b4cee76
commit 8b764a5477
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
9 changed files with 104 additions and 13 deletions

View file

@ -1130,9 +1130,10 @@ impl Project {
cx.on_release(Self::release),
cx.on_app_quit(|this, cx| {
let shutdown = this.ssh_client.take().and_then(|client| {
client
.read(cx)
.shutdown_processes(Some(proto::ShutdownRemoteServer {}))
client.read(cx).shutdown_processes(
Some(proto::ShutdownRemoteServer {}),
cx.background_executor().clone(),
)
});
cx.background_executor().spawn(async move {
@ -1472,9 +1473,10 @@ impl Project {
fn release(&mut self, cx: &mut App) {
if let Some(client) = self.ssh_client.take() {
let shutdown = client
.read(cx)
.shutdown_processes(Some(proto::ShutdownRemoteServer {}));
let shutdown = client.read(cx).shutdown_processes(
Some(proto::ShutdownRemoteServer {}),
cx.background_executor().clone(),
);
cx.background_spawn(async move {
if let Some(shutdown) = shutdown {