Conversation
There was a problem hiding this comment.
Pull request overview
The PR reduces system prompt size by ~30% through consolidation and simplification. It removes duplicate desktop-specific prompt templates and streamlines the core system prompt with more concise language.
Changes:
- Simplified
system.mdby condensing verbose instructions into brief statements - Removed
desktop_prompt.mdanddesktop_recipe_instruction.mdfiles and their registry entries - Changed system prompt extras storage from Vec to HashMap to prevent duplicates using keys
Reviewed changes
Copilot reviewed 16 out of 16 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
documentation/docs/guides/prompt-templates.md |
Removed documentation for deleted desktop prompt templates |
crates/goose/src/prompts/system.md |
Condensed verbose instructions into concise statements, reducing token usage |
crates/goose/src/prompts/desktop_recipe_instruction.md |
Deleted entire desktop recipe instruction template |
crates/goose/src/prompts/desktop_prompt.md |
Deleted entire desktop-specific prompt template |
crates/goose/src/prompt_template.rs |
Removed registry entries for deleted desktop templates |
crates/goose/src/agents/snapshots/*.snap |
Updated test snapshots to reflect condensed system prompt |
crates/goose/src/agents/prompt_manager.rs |
Changed extras from Vec to HashMap with keys; updated API to accept key parameter |
crates/goose/src/agents/agent.rs |
Updated calls to extend_system_prompt to include key parameter |
crates/goose-server/src/routes/session.rs |
Added "recipe" key when extending system prompt |
crates/goose-server/src/routes/recipe_utils.rs |
Simplified to return raw instructions instead of rendering through template |
crates/goose-server/src/routes/agent.rs |
Removed desktop_prompt rendering and simplified recipe handling logic |
crates/goose-cli/src/session/prompt.rs |
Deleted entire CLI prompt helper module |
crates/goose-cli/src/session/mod.rs |
Removed prompt module import |
crates/goose-cli/src/session/builder.rs |
Removed CLI-specific prompt extension, kept only additional_system_prompt with key |
| | [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 | |
There was a problem hiding this comment.
Corrected spelling of 'elminates' to 'eliminates' in PR description
|
| pub struct PromptManager { | ||
| system_prompt_override: Option<String>, | ||
| system_prompt_extras: Vec<String>, | ||
| system_prompt_extras: HashMap<String, String>, |
There was a problem hiding this comment.
Using HashMap for system_prompt_extras may result in non-deterministic ordering when joining the values. Consider using a BTreeMap or IndexMap instead to ensure consistent ordering across runs, which is important for prompt caching as mentioned in the code comments.
alexhancock
left a comment
There was a problem hiding this comment.
This LGTM and definitely needed! Thoughts on a way to eval on a few models before a merge?
| 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. |
There was a problem hiding this comment.
The system prompt now says extensions can be dynamically enabled/disabled unconditionally, but in practice that only works when the Extension Manager tools are available/enabled; consider rewording to make this conditional to avoid misleading the agent in configurations where extension management is disabled.
| You can dynamically enable or disable extensions as needed to help complete tasks. | |
| When extension management tools are available, you can dynamically enable or disable extensions as needed to help complete tasks; otherwise, work with the currently enabled extensions. |
| {% 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. |
There was a problem hiding this comment.
The reduced "supports resources" line no longer indicates how resources are accessed (previously via Extension Manager list_resources/read_resource), which makes the statement hard to act on; consider adding a brief pointer to the relevant tool(s) so models can actually retrieve those resources.
| {{extension.name}} supports resources. | |
| {{extension.name}} supports resources that you can access via its tools in your tool specification (for example, tools for listing and reading resources). |
* origin/main: (107 commits) feat: Allow overriding default bat themes using environment variables (#7140) Make the system prompt smaller (#6991) Pre release script (#7145) Spelling (#7137) feat(mcp): upgrade rmcp to 0.15.0 and advertise MCP Apps UI extension capability (#6927) fix: ensure assistant messages with tool_calls include content field (#7076) fix(canonical): handle gcp_vertex_ai model mapping correctly (#6836) Group dependencies in root Cargo.toml (#6948) refactor: updated elevenLabs API module and `remove button` UX (#6781) fix: we were missing content from langfuse traces (#7135) docs: update username in authors.yml (#7132) fix extension selector syncing issues (#7133) fix(acp): per-session Agent for model isolation and load_session restore (#7115) fix(claude-code): defensive coding improvements for model switching (#7131) feat(claude-code): dynamic model listing and mid-session model switching (#7120) Inline worklet source (#7128) [docs] One shot prompting is dead - Blog Post (#7113) fix: correct spelling of Debbie O'Brien's name in authors.yml (#7127) docs: GCP Vertex AI org policy filtering & update OnboardingProviderSetup component (#7125) feat: replace subagent and skills with unified summon extension (#6964) ... # Conflicts: # Cargo.lock # Cargo.toml
* upstream/main: (109 commits) [docs] Skills Marketplace UI Improvements (block#7158) More no-window flags (block#7122) feat: Allow overriding default bat themes using environment variables (block#7140) Make the system prompt smaller (block#6991) Pre release script (block#7145) Spelling (block#7137) feat(mcp): upgrade rmcp to 0.15.0 and advertise MCP Apps UI extension capability (block#6927) fix: ensure assistant messages with tool_calls include content field (block#7076) fix(canonical): handle gcp_vertex_ai model mapping correctly (block#6836) Group dependencies in root Cargo.toml (block#6948) refactor: updated elevenLabs API module and `remove button` UX (block#6781) fix: we were missing content from langfuse traces (block#7135) docs: update username in authors.yml (block#7132) fix extension selector syncing issues (block#7133) fix(acp): per-session Agent for model isolation and load_session restore (block#7115) fix(claude-code): defensive coding improvements for model switching (block#7131) feat(claude-code): dynamic model listing and mid-session model switching (block#7120) Inline worklet source (block#7128) [docs] One shot prompting is dead - Blog Post (block#7113) fix: correct spelling of Debbie O'Brien's name in authors.yml (block#7127) ...
* origin/main: (33 commits) fix: replace panic with proper error handling in get_tokenizer (#7175) Lifei/smoke test for developer (#7174) fix text editor view broken (#7167) docs: White label guide (#6857) Add PATH detection back to developer extension (#7161) docs: pin version in ci/cd (#7168) Desktop: - No Custom Headers field for custom OpenAI-compatible providers (#6681) feat: edit model and extensions of a recipe from GUI (#6804) feat: MCP support for agentic CLI providers (#6972) docs: keyring fallback to secrets.yaml (#7165) feat: load provider/model specified inside the recipe config (#6884) fix ask-ai bot hitting tool call limits (#7162) fix flatpak icon (#7154) [docs] Skills Marketplace UI Improvements (#7158) More no-window flags (#7122) feat: Allow overriding default bat themes using environment variables (#7140) Make the system prompt smaller (#6991) Pre release script (#7145) Spelling (#7137) feat(mcp): upgrade rmcp to 0.15.0 and advertise MCP Apps UI extension capability (#6927) ...
Summary
This makes our system prompt 30% smaller or so. it also elminates adding the same thing twice to it (which we did for the desktop template