From 70003c2e22ec21beaed52570bba879b12949d0f1 Mon Sep 17 00:00:00 2001 From: Dale Lakes <6843636+spitfire55@users.noreply.github.com> Date: Wed, 25 Mar 2026 09:20:01 -0400 Subject: [PATCH] fix: clarify that sandbox functions are only callable via execute_typescript (#8096) Signed-off-by: Dale Lakes <6843636+spitfire55@users.noreply.github.com> Co-authored-by: Claude Opus 4.6 (1M context) --- .../platform_extensions/code_execution.rs | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/crates/goose/src/agents/platform_extensions/code_execution.rs b/crates/goose/src/agents/platform_extensions/code_execution.rs index 26012035..6fc50fcb 100644 --- a/crates/goose/src/agents/platform_extensions/code_execution.rs +++ b/crates/goose/src/agents/platform_extensions/code_execution.rs @@ -478,15 +478,21 @@ impl McpClientTrait for CodeExecutionClient { let disclosure_style_moim = match self.disclosure { ToolDisclosure::Catalog => { - let available_fns: Vec<_> = code_mode - .list_functions() - .functions + let functions = code_mode.list_functions().functions; + let sandbox_only: Vec<_> = functions .iter() + .filter(|f| !crate::agents::extension_manager::is_first_class_extension(&f.namespace)) .map(|f| format!("{}.{}", &f.namespace, &f.name)) .collect(); - format!("Available functions: {} - - Use the list_functions & get_function_details tools to see tool signatures and input/output types before calling execute_typescript.", available_fns.join(", ")) + let mut msg = String::new(); + if !sandbox_only.is_empty() { + msg.push_str(&format!( + "Additional functions available ONLY via execute_typescript (do NOT call these as direct tool calls): {}", + sandbox_only.join(", ") + )); + } + msg.push_str("\n\n Use the list_functions & get_function_details tools to see tool signatures and input/output types before calling execute_typescript."); + msg } ToolDisclosure::Filesystem => { let available_filepaths: Vec<_> = code_mode