context_server: Interpret context server command paths relative to the extension's work dir (#27201)

Marshall Bowers , Max Brunsfeld , and Thomas Mickley-Doyle created

This PR fixes an issues where the commands returned from context server
extensions were being used as-is instead of interpreting them relative
to the extension's work dir.

Release Notes:

- Fixed an issue with context server paths not being interpreted
relative to the extension's work dir.

---------

Co-authored-by: Max Brunsfeld <maxbrunsfeld@gmail.com>
Co-authored-by: Thomas Mickley-Doyle <tmickleydoyle@gmail.com>

Change summary

crates/context_server/src/extension_context_server.rs | 6 +++++-
crates/extension_host/src/extension_host.rs           | 5 ++++-
2 files changed, 9 insertions(+), 2 deletions(-)

Detailed changes

crates/context_server/src/extension_context_server.rs 🔗

@@ -51,9 +51,13 @@ impl ExtensionContextServerProxy for ContextServerFactoryRegistryProxy {
                                     })
                                 })?;
 
-                                let command = extension
+                                let mut command = extension
                                     .context_server_command(id.clone(), extension_project)
                                     .await?;
+                                command.command = extension
+                                    .path_from_extension(command.command.as_ref())
+                                    .to_string_lossy()
+                                    .to_string();
 
                                 log::info!("loaded command for context server {id}: {command:?}");
 

crates/extension_host/src/extension_host.rs 🔗

@@ -906,7 +906,10 @@ impl ExtensionStore {
                         .await
                 }
             })
-            .await?;
+            .await
+            .inspect_err(|error| {
+                util::log_err(error);
+            })?;
 
             let output_path = &extensions_dir.join(extension_id.as_ref());
             if let Some(metadata) = fs.metadata(output_path).await? {