Use the working dir from the session (#7285)

This commit is contained in:
Zane
2026-02-17 18:10:52 -08:00
committed by GitHub
parent e32720fcfb
commit 7eb4e442a7
6 changed files with 28 additions and 13 deletions
+6 -6
View File
@@ -791,17 +791,17 @@ impl ExtensionManager {
}
/// Get extensions info for building the system prompt
pub async fn get_extensions_info(&self) -> Vec<ExtensionInfo> {
pub async fn get_extensions_info(&self, working_dir: &std::path::Path) -> Vec<ExtensionInfo> {
let working_dir_str = working_dir.to_string_lossy();
self.extensions
.lock()
.await
.iter()
.map(|(name, ext)| {
ExtensionInfo::new(
name,
ext.get_instructions().unwrap_or_default().as_str(),
ext.supports_resources(),
)
let instructions = ext.get_instructions().unwrap_or_default();
let instructions =
instructions.replace(goose_mcp::WORKING_DIR_PLACEHOLDER, &working_dir_str);
ExtensionInfo::new(name, &instructions, ext.supports_resources())
})
.collect()
}