diff --git a/crates/goose-cli/src/session/builder.rs b/crates/goose-cli/src/session/builder.rs index edda60e3e109..7f5e8170ef8a 100644 --- a/crates/goose-cli/src/session/builder.rs +++ b/crates/goose-cli/src/session/builder.rs @@ -549,15 +549,10 @@ async fn configure_session_prompts( tracing::warn!("Failed to save extension state: {}", e); } - session - .agent - .extend_system_prompt(super::prompt::get_cli_prompt()) - .await; - if let Some(ref additional_prompt) = session_config.additional_system_prompt { session .agent - .extend_system_prompt(additional_prompt.clone()) + .extend_system_prompt("additional".to_string(), additional_prompt.clone()) .await; } diff --git a/crates/goose-cli/src/session/mod.rs b/crates/goose-cli/src/session/mod.rs index b758a8334467..ae016998760d 100644 --- a/crates/goose-cli/src/session/mod.rs +++ b/crates/goose-cli/src/session/mod.rs @@ -5,7 +5,6 @@ mod elicitation; mod export; mod input; mod output; -mod prompt; mod task_execution_display; mod thinking; diff --git a/crates/goose-cli/src/session/prompt.rs b/crates/goose-cli/src/session/prompt.rs deleted file mode 100644 index 695b28aadf81..000000000000 --- a/crates/goose-cli/src/session/prompt.rs +++ /dev/null @@ -1,17 +0,0 @@ -/// Returns a system prompt extension that explains CLI-specific functionality -pub fn get_cli_prompt() -> String { - let newline_key = super::input::get_newline_key().to_ascii_uppercase(); - format!( - "You are being accessed through a command-line interface. The following slash commands are available -- you can let the user know about them if they need help: - -- /exit or /quit - Exit the session -- /t - Toggle between Light/Dark/Ansi themes -- /? or /help - Display help message - -Additional keyboard shortcuts: -- Ctrl+C - Interrupt the current interaction (resets to before the interrupted request) -- Ctrl+{newline_key} - Add a newline -- Up/Down arrows - Navigate command history" - ) -} diff --git a/crates/goose-server/src/routes/agent.rs b/crates/goose-server/src/routes/agent.rs index e36bfd6c3525..6ef557d43599 100644 --- a/crates/goose-server/src/routes/agent.rs +++ b/crates/goose-server/src/routes/agent.rs @@ -18,7 +18,6 @@ use goose::agents::ExtensionConfig; use goose::config::resolve_extensions_for_new_session; use goose::config::{Config, GooseMode}; use goose::model::ModelConfig; -use goose::prompt_template::render_template; use goose::providers::create; use goose::recipe::Recipe; use goose::recipe_deeplink; @@ -32,7 +31,7 @@ use goose::{ use rmcp::model::{CallToolRequestParams, Content}; use serde::{Deserialize, Serialize}; use serde_json::Value; -use std::collections::{HashMap, HashSet}; +use std::collections::HashSet; use std::path::PathBuf; use std::sync::Arc; use tokio_util::sync::CancellationToken; @@ -420,10 +419,6 @@ async fn update_from_session( message: format!("Failed to get session: {}", err), status: StatusCode::INTERNAL_SERVER_ERROR, })?; - let context: HashMap<&str, Value> = HashMap::new(); - let desktop_prompt = - render_template("desktop_prompt.md", &context).expect("Prompt should render"); - let mut update_prompt = desktop_prompt; if let Some(recipe) = session.recipe { match build_recipe_with_parameter_values( &recipe, @@ -433,11 +428,13 @@ async fn update_from_session( { Ok(Some(recipe)) => { if let Some(prompt) = apply_recipe_to_agent(&agent, &recipe, true).await { - update_prompt = prompt; + agent + .extend_system_prompt("recipe".to_string(), prompt) + .await; } } Ok(None) => { - // Recipe has missing parameters - use default prompt + // Recipe has missing parameters } Err(e) => { return Err(ErrorResponse { @@ -447,7 +444,6 @@ async fn update_from_session( } } } - agent.extend_system_prompt(update_prompt).await; Ok(StatusCode::OK) } @@ -707,11 +703,6 @@ async fn restart_agent_internal( status: StatusCode::INTERNAL_SERVER_ERROR, })?; - let context: HashMap<&str, Value> = HashMap::new(); - let desktop_prompt = - render_template("desktop_prompt.md", &context).expect("Prompt should render"); - let mut update_prompt = desktop_prompt; - if let Some(ref recipe) = session.recipe { match build_recipe_with_parameter_values( recipe, @@ -721,11 +712,13 @@ async fn restart_agent_internal( { Ok(Some(recipe)) => { if let Some(prompt) = apply_recipe_to_agent(&agent, &recipe, true).await { - update_prompt = prompt; + agent + .extend_system_prompt("recipe".to_string(), prompt) + .await; } } Ok(None) => { - // Recipe has missing parameters - use default prompt + // Recipe has missing parameters } Err(e) => { return Err(ErrorResponse { @@ -735,7 +728,6 @@ async fn restart_agent_internal( } } } - agent.extend_system_prompt(update_prompt).await; Ok(extension_results) } diff --git a/crates/goose-server/src/routes/recipe_utils.rs b/crates/goose-server/src/routes/recipe_utils.rs index 46c8c3d5f605..382bb408cf06 100644 --- a/crates/goose-server/src/routes/recipe_utils.rs +++ b/crates/goose-server/src/routes/recipe_utils.rs @@ -10,13 +10,11 @@ use crate::state::AppState; use anyhow::Result; use axum::http::StatusCode; use goose::agents::Agent; -use goose::prompt_template::render_template; use goose::recipe::build_recipe::{build_recipe_from_template, RecipeError}; use goose::recipe::local_recipes::{get_recipe_library_dir, list_local_recipes}; use goose::recipe::validate_recipe::validate_recipe_template_from_content; use goose::recipe::Recipe; use serde::Serialize; -use serde_json::Value; use tracing::error; use utoipa::ToSchema; @@ -170,9 +168,5 @@ pub async fn apply_recipe_to_agent( ) .await; - recipe.instructions.as_ref().map(|instructions| { - let mut context: HashMap<&str, Value> = HashMap::new(); - context.insert("recipe_instructions", Value::String(instructions.clone())); - render_template("desktop_recipe_instruction.md", &context).expect("Prompt should render") - }) + recipe.instructions.as_ref().cloned() } diff --git a/crates/goose-server/src/routes/session.rs b/crates/goose-server/src/routes/session.rs index 63579841a962..e4ff70ae3dd6 100644 --- a/crates/goose-server/src/routes/session.rs +++ b/crates/goose-server/src/routes/session.rs @@ -247,7 +247,9 @@ async fn update_session_user_recipe_values( status, })?; if let Some(prompt) = apply_recipe_to_agent(&agent, &recipe, false).await { - agent.extend_system_prompt(prompt).await; + agent + .extend_system_prompt("recipe".to_string(), prompt) + .await; } Ok(Json(UpdateSessionUserRecipeValuesResponse { recipe })) } diff --git a/crates/goose/src/agents/agent.rs b/crates/goose/src/agents/agent.rs index c5ab84898f88..068bd27c2575 100644 --- a/crates/goose/src/agents/agent.rs +++ b/crates/goose/src/agents/agent.rs @@ -449,7 +449,8 @@ impl Agent { let created_final_output_tool = FinalOutputTool::new(response); let final_output_system_prompt = created_final_output_tool.system_prompt(); *final_output_tool = Some(created_final_output_tool); - self.extend_system_prompt(final_output_system_prompt).await; + self.extend_system_prompt("final_output".to_string(), final_output_system_prompt) + .await; } pub async fn add_sub_recipes(&self, sub_recipes_to_add: Vec) { @@ -1614,9 +1615,9 @@ impl Agent { })) } - pub async fn extend_system_prompt(&self, instruction: String) { + pub async fn extend_system_prompt(&self, key: String, instruction: String) { let mut prompt_manager = self.prompt_manager.lock().await; - prompt_manager.add_system_prompt_extra(instruction); + prompt_manager.add_system_prompt_extra(key, instruction); } pub async fn update_provider( diff --git a/crates/goose/src/agents/prompt_manager.rs b/crates/goose/src/agents/prompt_manager.rs index 2d8bdad3e42f..27c00cc6fc29 100644 --- a/crates/goose/src/agents/prompt_manager.rs +++ b/crates/goose/src/agents/prompt_manager.rs @@ -1,6 +1,7 @@ #[cfg(test)] use chrono::DateTime; use chrono::Utc; +use indexmap::IndexMap; use serde::Serialize; use serde_json::Value; use std::collections::HashMap; @@ -19,7 +20,7 @@ const MAX_TOOLS: usize = 50; pub struct PromptManager { system_prompt_override: Option, - system_prompt_extras: Vec, + system_prompt_extras: IndexMap, current_date_timestamp: String, } @@ -173,24 +174,25 @@ impl<'a> SystemPromptBuilder<'a, PromptManager> { // Add hints if provided if let Some(hints) = self.hints { - system_prompt_extras.push(hints); + system_prompt_extras.insert("hints".to_string(), hints); } if goose_mode == GooseMode::Chat { - system_prompt_extras.push( + system_prompt_extras.insert( + "chat_mode".to_string(), "Right now you are in the chat only mode, no access to any tool use and system." .to_string(), ); } - let sanitized_system_prompt_extras: Vec = system_prompt_extras - .into_iter() - .map(|extra| sanitize_unicode_tags(&extra)) - .collect(); - - if sanitized_system_prompt_extras.is_empty() { + if system_prompt_extras.is_empty() { base_prompt } else { + let sanitized_system_prompt_extras: Vec = system_prompt_extras + .into_values() + .map(|extra| sanitize_unicode_tags(&extra)) + .collect(); + format!( "{}\n\n# Additional Instructions:\n\n{}", base_prompt, @@ -204,7 +206,7 @@ impl PromptManager { pub fn new() -> Self { PromptManager { system_prompt_override: None, - system_prompt_extras: Vec::new(), + system_prompt_extras: IndexMap::new(), // Use the fixed current date time so that prompt cache can be used. // Filtering to an hour to balance user time accuracy and multi session prompt cache hits. current_date_timestamp: Utc::now().format("%Y-%m-%d %H:00").to_string(), @@ -215,14 +217,15 @@ impl PromptManager { pub fn with_timestamp(dt: DateTime) -> Self { PromptManager { system_prompt_override: None, - system_prompt_extras: Vec::new(), + system_prompt_extras: IndexMap::new(), current_date_timestamp: dt.format("%Y-%m-%d %H:%M:%S").to_string(), } } - /// Add an additional instruction to the system prompt - pub fn add_system_prompt_extra(&mut self, instruction: String) { - self.system_prompt_extras.push(instruction); + /// Add an additional instruction to the system prompt with a key + /// Using the same key will replace the previous instruction + pub fn add_system_prompt_extra(&mut self, key: String, instruction: String) { + self.system_prompt_extras.insert(key, instruction); } /// Override the system prompt with custom text @@ -275,7 +278,7 @@ mod tests { fn test_build_system_prompt_sanitizes_extras() { let mut manager = PromptManager::new(); let malicious_extra = "Extra instruction\u{E0041}\u{E0042}\u{E0043}hidden"; - manager.add_system_prompt_extra(malicious_extra.to_string()); + manager.add_system_prompt_extra("test".to_string(), malicious_extra.to_string()); let result = manager.builder().build(); @@ -289,9 +292,14 @@ mod tests { #[test] fn test_build_system_prompt_sanitizes_multiple_extras() { let mut manager = PromptManager::new(); - manager.add_system_prompt_extra("First\u{E0041}instruction".to_string()); - manager.add_system_prompt_extra("Second\u{E0042}instruction".to_string()); - manager.add_system_prompt_extra("Third\u{E0043}instruction".to_string()); + manager + .add_system_prompt_extra("test1".to_string(), "First\u{E0041}instruction".to_string()); + manager.add_system_prompt_extra( + "test2".to_string(), + "Second\u{E0042}instruction".to_string(), + ); + manager + .add_system_prompt_extra("test3".to_string(), "Third\u{E0043}instruction".to_string()); let result = manager.builder().build(); @@ -307,7 +315,7 @@ mod tests { fn test_build_system_prompt_preserves_legitimate_unicode_in_extras() { let mut manager = PromptManager::new(); let legitimate_unicode = "Instruction with δΈ–η•Œ and 🌍 emojis"; - manager.add_system_prompt_extra(legitimate_unicode.to_string()); + manager.add_system_prompt_extra("test".to_string(), legitimate_unicode.to_string()); let result = manager.builder().build(); diff --git a/crates/goose/src/agents/snapshots/goose__agents__prompt_manager__tests__basic.snap b/crates/goose/src/agents/snapshots/goose__agents__prompt_manager__tests__basic.snap index 5afeffcddf08..fe4961423432 100644 --- a/crates/goose/src/agents/snapshots/goose__agents__prompt_manager__tests__basic.snap +++ b/crates/goose/src/agents/snapshots/goose__agents__prompt_manager__tests__basic.snap @@ -5,35 +5,14 @@ expression: system_prompt You are a general-purpose AI agent called goose, created by Block, the parent company of Square, CashApp, and Tidal. goose is being developed as an open-source software project. -goose uses LLM providers with tool calling capability. You can be used with different language models (gpt-4o, -claude-sonnet-4, o1, llama-3.2, deepseek-r1, etc). -These models have varying knowledge cut-off dates depending on when they were trained, but typically it's between 5-10 -months prior to the current date. - # Extensions -Extensions allow other applications to provide context to goose. Extensions connect goose to different data sources and -tools. -You are capable of dynamically plugging into new extensions and learning how to use them. You solve higher level -problems using the tools in these extensions, and can interact with multiple at once. - -If the Extension Manager extension is enabled, you can use the search_available_extensions tool to discover additional -extensions that can help with your task. To enable or disable extensions, use the manage_extensions tool with the -extension_name. You should only enable extensions found from the search_available_extensions tool. -If Extension Manager is not available, you can only work with currently enabled extensions and cannot dynamically load -new ones. +Extensions provide additional tools and context from different data sources and applications. +You can dynamically enable or disable extensions as needed to help complete tasks. No extensions are defined. You should let the user know that they should add extensions. # Response Guidelines -- Use Markdown formatting for all responses. -- Follow best practices for Markdown, including: - - Using headers for organization. - - Bullet points for lists. - - Links formatted correctly, either as linked text (e.g., [this is linked text](https://example.com)) or automatic - links using angle brackets (e.g., ). -- For code examples, use fenced code blocks by placing triple backticks (` ``` `) before and after the code. Include the - language identifier after the opening backticks (e.g., ` ```python `) to enable syntax highlighting. -- Ensure clarity, conciseness, and proper formatting to enhance readability and usability. +Use Markdown formatting for all responses. 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 8f02d1cf7af1..c659703082ed 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 @@ -5,23 +5,10 @@ expression: system_prompt You are a general-purpose AI agent called goose, created by Block, the parent company of Square, CashApp, and Tidal. goose is being developed as an open-source software project. -goose uses LLM providers with tool calling capability. You can be used with different language models (gpt-4o, -claude-sonnet-4, o1, llama-3.2, deepseek-r1, etc). -These models have varying knowledge cut-off dates depending on when they were trained, but typically it's between 5-10 -months prior to the current date. - # Extensions -Extensions allow other applications to provide context to goose. Extensions connect goose to different data sources and -tools. -You are capable of dynamically plugging into new extensions and learning how to use them. You solve higher level -problems using the tools in these extensions, and can interact with multiple at once. - -If the Extension Manager extension is enabled, you can use the search_available_extensions tool to discover additional -extensions that can help with your task. To enable or disable extensions, use the manage_extensions tool with the -extension_name. You should only enable extensions found from the search_available_extensions tool. -If Extension Manager is not available, you can only work with currently enabled extensions and cannot dynamically load -new ones. +Extensions provide additional tools and context from different data sources and applications. +You can dynamically enable or disable extensions as needed to help complete tasks. Because you dynamically load extensions, your conversation history may refer to interactions with extensions that are not currently active. The currently @@ -31,20 +18,11 @@ in your tool specification. ## test -test supports resources, you can use extensionmanager__read_resource, -and extensionmanager__list_resources on this extension. +test supports resources. ### Instructions how to use this extension # Response Guidelines -- Use Markdown formatting for all responses. -- Follow best practices for Markdown, including: - - Using headers for organization. - - Bullet points for lists. - - Links formatted correctly, either as linked text (e.g., [this is linked text](https://example.com)) or automatic - links using angle brackets (e.g., ). -- For code examples, use fenced code blocks by placing triple backticks (` ``` `) before and after the code. Include the - language identifier after the opening backticks (e.g., ` ```python `) to enable syntax highlighting. -- Ensure clarity, conciseness, and proper formatting to enhance readability and usability. +Use Markdown formatting for all responses. 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 719a84871da8..81d2202689af 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 @@ -5,23 +5,10 @@ expression: system_prompt You are a general-purpose AI agent called goose, created by Block, the parent company of Square, CashApp, and Tidal. goose is being developed as an open-source software project. -goose uses LLM providers with tool calling capability. You can be used with different language models (gpt-4o, -claude-sonnet-4, o1, llama-3.2, deepseek-r1, etc). -These models have varying knowledge cut-off dates depending on when they were trained, but typically it's between 5-10 -months prior to the current date. - # Extensions -Extensions allow other applications to provide context to goose. Extensions connect goose to different data sources and -tools. -You are capable of dynamically plugging into new extensions and learning how to use them. You solve higher level -problems using the tools in these extensions, and can interact with multiple at once. - -If the Extension Manager extension is enabled, you can use the search_available_extensions tool to discover additional -extensions that can help with your task. To enable or disable extensions, use the manage_extensions tool with the -extension_name. You should only enable extensions found from the search_available_extensions tool. -If Extension Manager is not available, you can only work with currently enabled extensions and cannot dynamically load -new ones. +Extensions provide additional tools and context from different data sources and applications. +You can dynamically enable or disable extensions as needed to help complete tasks. Because you dynamically load extensions, your conversation history may refer to interactions with extensions that are not currently active. The currently @@ -31,8 +18,7 @@ in your tool specification. ## extension_A -extension_A supports resources, you can use extensionmanager__read_resource, -and extensionmanager__list_resources on this extension. +extension_A supports resources. ### Instructions ## extension_B @@ -42,23 +28,9 @@ and extensionmanager__list_resources on this extension. # Suggestion -The user currently has enabled 6 extensions with a total of 51 tools. -Since this exceeds the recommended limits (5 extensions or 50 tools), -you should ask the user if they would like to disable some extensions for this session. - -Use the search_available_extensions tool to find extensions available to disable. -You should only disable extensions found from the search_available_extensions tool. -List all the extensions available to disable in the response. -Explain that minimizing extensions helps with the recall of the correct tools to use. +The user has 6 extensions with 51 tools enabled, exceeding recommended limits (5 extensions or 50 tools). +Consider asking if they'd like to disable some extensions to improve tool selection accuracy. # Response Guidelines -- Use Markdown formatting for all responses. -- Follow best practices for Markdown, including: - - Using headers for organization. - - Bullet points for lists. - - Links formatted correctly, either as linked text (e.g., [this is linked text](https://example.com)) or automatic - links using angle brackets (e.g., ). -- For code examples, use fenced code blocks by placing triple backticks (` ``` `) before and after the code. Include the - language identifier after the opening backticks (e.g., ` ```python `) to enable syntax highlighting. -- Ensure clarity, conciseness, and proper formatting to enhance readability and usability. +Use Markdown formatting for all responses. diff --git a/crates/goose/src/prompt_template.rs b/crates/goose/src/prompt_template.rs index 1231f4c6da56..1685799c6594 100644 --- a/crates/goose/src/prompt_template.rs +++ b/crates/goose/src/prompt_template.rs @@ -35,14 +35,6 @@ static TEMPLATE_REGISTRY: &[(&str, &str)] = &[ "permission_judge.md", "Prompt for analyzing tool operations for read-only detection", ), - ( - "desktop_prompt.md", - "Additional context provided when using the desktop application", - ), - ( - "desktop_recipe_instruction.md", - "Prompt template for recipe instructions in desktop mode", - ), ( "plan.md", "Prompt used when goose creates step-by-step plans. CLI only", diff --git a/crates/goose/src/prompts/desktop_prompt.md b/crates/goose/src/prompts/desktop_prompt.md deleted file mode 100644 index 6ce8f16a8439..000000000000 --- a/crates/goose/src/prompts/desktop_prompt.md +++ /dev/null @@ -1,13 +0,0 @@ -You are being accessed through the Goose Desktop application. - -The user is interacting with you through a graphical user interface with the following features: -- A chat interface where messages are displayed in a conversation format -- Support for markdown formatting in your responses -- Support for code blocks with syntax highlighting -- Tool use messages are included in the chat but outputs may need to be expanded - -The user can add extensions for you through the "Extensions" page, which is available from the sidebar on the left. This page links to -the registry. - -Some extensions are builtin, such as Developer and Memory, while -3rd party extensions can be browsed at https://block.github.io/goose/extensions/. diff --git a/crates/goose/src/prompts/desktop_recipe_instruction.md b/crates/goose/src/prompts/desktop_recipe_instruction.md deleted file mode 100644 index 445ffa4678fc..000000000000 --- a/crates/goose/src/prompts/desktop_recipe_instruction.md +++ /dev/null @@ -1,15 +0,0 @@ -You are a helpful agent. -You are being accessed through the Goose Desktop application, pre configured with instructions as requested by a human. - -The user is interacting with you through a graphical user interface with the following features: -- A chat interface where messages are displayed in a conversation format -- Support for markdown formatting in your responses -- Support for code blocks with syntax highlighting -- Tool use messages are included in the chat but outputs may need to be expanded - -It is VERY IMPORTANT that you take note of the provided instructions, also check if a style of output is requested and always do your best to adhere to it. -You can also validate your output after you have generated it to ensure it meets the requirements of the user. -There may be (but not always) some tools mentioned in the instructions which you can check are available to this instance of goose (and try to help the user if they are not or find alternatives). - -IMPORTANT instructions for you to operate as agent: -{{recipe_instructions}} \ No newline at end of file diff --git a/crates/goose/src/prompts/system.md b/crates/goose/src/prompts/system.md index c282d75497ac..9c5d75fda7ef 100644 --- a/crates/goose/src/prompts/system.md +++ b/crates/goose/src/prompts/system.md @@ -1,24 +1,11 @@ You are a general-purpose AI agent called goose, created by Block, the parent company of Square, CashApp, and Tidal. goose is being developed as an open-source software project. - -goose uses LLM providers with tool calling capability. You can be used with different language models (gpt-4o, -claude-sonnet-4, o1, llama-3.2, deepseek-r1, etc). -These models have varying knowledge cut-off dates depending on when they were trained, but typically it's between 5-10 -months prior to the current date. {% if not code_execution_mode %} # Extensions -Extensions allow other applications to provide context to goose. Extensions connect goose to different data sources and -tools. -You are capable of dynamically plugging into new extensions and learning how to use them. You solve higher level -problems using the tools in these extensions, and can interact with multiple at once. - -If the Extension Manager extension is enabled, you can use the search_available_extensions tool to discover additional -extensions that can help with your task. To enable or disable extensions, use the manage_extensions tool with the -extension_name. You should only enable extensions found from the search_available_extensions tool. -If Extension Manager is not available, you can only work with currently enabled extensions and cannot dynamically load -new ones. +Extensions provide additional tools and context from different data sources and applications. +You can dynamically enable or disable extensions as needed to help complete tasks. {% if (extensions is defined) and extensions %} Because you dynamically load extensions, your conversation history may refer @@ -31,8 +18,7 @@ in your tool specification. ## {{extension.name}} {% if extension.has_resources %} -{{extension.name}} supports resources, you can use extensionmanager__read_resource, -and extensionmanager__list_resources on this extension. +{{extension.name}} supports resources. {% endif %} {% if extension.instructions %}### Instructions {{extension.instructions}}{% endif %} @@ -47,25 +33,11 @@ No extensions are defined. You should let the user know that they should add ext {% with (extension_count, tool_count) = extension_tool_limits %} # Suggestion -The user currently has enabled {{extension_count}} extensions with a total of {{tool_count}} tools. -Since this exceeds the recommended limits ({{max_extensions}} extensions or {{max_tools}} tools), -you should ask the user if they would like to disable some extensions for this session. - -Use the search_available_extensions tool to find extensions available to disable. -You should only disable extensions found from the search_available_extensions tool. -List all the extensions available to disable in the response. -Explain that minimizing extensions helps with the recall of the correct tools to use. +The user has {{extension_count}} extensions with {{tool_count}} tools enabled, exceeding recommended limits ({{max_extensions}} extensions or {{max_tools}} tools). +Consider asking if they'd like to disable some extensions to improve tool selection accuracy. {% endwith %} {% endif %} # Response Guidelines -- Use Markdown formatting for all responses. -- Follow best practices for Markdown, including: - - Using headers for organization. - - Bullet points for lists. - - Links formatted correctly, either as linked text (e.g., [this is linked text](https://example.com)) or automatic - links using angle brackets (e.g., ). -- For code examples, use fenced code blocks by placing triple backticks (` ``` `) before and after the code. Include the - language identifier after the opening backticks (e.g., ` ```python `) to enable syntax highlighting. -- Ensure clarity, conciseness, and proper formatting to enhance readability and usability. +Use Markdown formatting for all responses. diff --git a/documentation/docs/guides/prompt-templates.md b/documentation/docs/guides/prompt-templates.md index 596b5b299d85..0f2ad86ccfd1 100644 --- a/documentation/docs/guides/prompt-templates.md +++ b/documentation/docs/guides/prompt-templates.md @@ -94,8 +94,6 @@ The following default templates can be customized. | [apps_create.md](https://github.com/block/goose/blob/main/crates/goose/src/prompts/apps_create.md) | Prompt for generating new standalone apps (in development) | Desktop only | | [apps_iterate.md](https://github.com/block/goose/blob/main/crates/goose/src/prompts/apps_iterate.md) | Prompt for updating existing standalone apps (in development) | Desktop only | | [compaction.md](https://github.com/block/goose/blob/main/crates/goose/src/prompts/compaction.md) | Prompt for summarizing conversation history when context limits are reached | Desktop and CLI | -| [desktop_prompt.md](https://github.com/block/goose/blob/main/crates/goose/src/prompts/desktop_prompt.md) | Context about the user interface and available features | Desktop only | -| [desktop_recipe_instruction.md](https://github.com/block/goose/blob/main/crates/goose/src/prompts/desktop_recipe_instruction.md) | Instructions for executing recipes | Desktop only | | [permission_judge.md](https://github.com/block/goose/blob/main/crates/goose/src/prompts/permission_judge.md) | Prompt for analyzing tool operations for read-only detection | Desktop and CLI | | [plan.md](https://github.com/block/goose/blob/main/crates/goose/src/prompts/plan.md) | Instructions for creating detailed, actionable plans with clarifying questions | CLI only | | [recipe.md](https://github.com/block/goose/blob/main/crates/goose/src/prompts/recipe.md) | Prompt for generating recipe files from conversations | Desktop and CLI |