diff --git a/crates/goose/src/agents/extension_manager.rs b/crates/goose/src/agents/extension_manager.rs index e4966aff2154..c67b8fac0803 100644 --- a/crates/goose/src/agents/extension_manager.rs +++ b/crates/goose/src/agents/extension_manager.rs @@ -973,9 +973,14 @@ impl ExtensionManager { // Loop through each extension and try to read the resource, don't raise an error if the resource is not found // TODO: do we want to find if a provided uri is in multiple extensions? // currently it will return the first match and skip any others - - // Collect extension names first to avoid holding the lock during iteration - let extension_names: Vec = self.extensions.lock().await.keys().cloned().collect(); + let extension_names: Vec = self + .extensions + .lock() + .await + .iter() + .filter(|(_name, ext)| ext.supports_resources()) + .map(|(name, _)| name.clone()) + .collect(); for extension_name in extension_names { let read_result = self diff --git a/crates/goose/src/agents/snapshots/goose__agents__prompt_manager__tests__one_extension.snap b/crates/goose/src/agents/snapshots/goose__agents__prompt_manager__tests__one_extension.snap index d7ba6de0dfec..8f02d1cf7af1 100644 --- a/crates/goose/src/agents/snapshots/goose__agents__prompt_manager__tests__one_extension.snap +++ b/crates/goose/src/agents/snapshots/goose__agents__prompt_manager__tests__one_extension.snap @@ -31,8 +31,8 @@ in your tool specification. ## test -test supports resources, you can use platform__read_resource, -and platform__list_resources on this extension. +test supports resources, you can use extensionmanager__read_resource, +and extensionmanager__list_resources on this extension. ### Instructions how to use this extension diff --git a/crates/goose/src/agents/snapshots/goose__agents__prompt_manager__tests__typical_setup.snap b/crates/goose/src/agents/snapshots/goose__agents__prompt_manager__tests__typical_setup.snap index c9848fd9ca20..719a84871da8 100644 --- a/crates/goose/src/agents/snapshots/goose__agents__prompt_manager__tests__typical_setup.snap +++ b/crates/goose/src/agents/snapshots/goose__agents__prompt_manager__tests__typical_setup.snap @@ -31,8 +31,8 @@ in your tool specification. ## extension_A -extension_A supports resources, you can use platform__read_resource, -and platform__list_resources on this extension. +extension_A supports resources, you can use extensionmanager__read_resource, +and extensionmanager__list_resources on this extension. ### Instructions ## extension_B diff --git a/crates/goose/src/prompts/system.md b/crates/goose/src/prompts/system.md index 87093d3997b8..c282d75497ac 100644 --- a/crates/goose/src/prompts/system.md +++ b/crates/goose/src/prompts/system.md @@ -31,8 +31,8 @@ in your tool specification. ## {{extension.name}} {% if extension.has_resources %} -{{extension.name}} supports resources, you can use platform__read_resource, -and platform__list_resources on this extension. +{{extension.name}} supports resources, you can use extensionmanager__read_resource, +and extensionmanager__list_resources on this extension. {% endif %} {% if extension.instructions %}### Instructions {{extension.instructions}}{% endif %}