Skip to content

Make the system prompt smaller#6991

Merged
DOsinga merged 5 commits intomainfrom
optimize-system-prompt
Feb 11, 2026
Merged

Make the system prompt smaller#6991
DOsinga merged 5 commits intomainfrom
optimize-system-prompt

Conversation

@DOsinga
Copy link
Collaborator

@DOsinga DOsinga commented Feb 5, 2026

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

@DOsinga DOsinga marked this pull request as ready for review February 5, 2026 18:45
@DOsinga DOsinga requested a review from a team as a code owner February 5, 2026 18:45
Copilot AI review requested due to automatic review settings February 5, 2026 18:45
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.md by condensing verbose instructions into brief statements
  • Removed desktop_prompt.md and desktop_recipe_instruction.md files 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

Comment on lines 94 to 97
| [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 |
Copy link

Copilot AI Feb 5, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Corrected spelling of 'elminates' to 'eliminates' in PR description

Copilot uses AI. Check for mistakes.
@github-actions
Copy link
Contributor

github-actions bot commented Feb 5, 2026

PR Preview Action v1.8.1
Preview removed because the pull request was closed.
2026-02-11 16:03 UTC

Copilot AI review requested due to automatic review settings February 5, 2026 20:03
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 16 out of 16 changed files in this pull request and generated 1 comment.

pub struct PromptManager {
system_prompt_override: Option<String>,
system_prompt_extras: Vec<String>,
system_prompt_extras: HashMap<String, String>,
Copy link

Copilot AI Feb 5, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copilot uses AI. Check for mistakes.
Copy link
Collaborator

@alexhancock alexhancock left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This LGTM and definitely needed! Thoughts on a way to eval on a few models before a merge?

Copilot AI review requested due to automatic review settings February 9, 2026 12:03
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 16 out of 16 changed files in this pull request and generated 2 comments.

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.
Copy link

Copilot AI Feb 9, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Suggested change
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.

Copilot uses AI. Check for mistakes.
{% 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.
Copy link

Copilot AI Feb 9, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Suggested change
{{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).

Copilot uses AI. Check for mistakes.
@alexhancock alexhancock self-requested a review February 9, 2026 12:13
@DOsinga DOsinga added this pull request to the merge queue Feb 11, 2026
Merged via the queue into main with commit 12a346f Feb 11, 2026
28 checks passed
@DOsinga DOsinga deleted the optimize-system-prompt branch February 11, 2026 15:59
tlongwell-block added a commit that referenced this pull request Feb 11, 2026
* 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
zanesq added a commit to Abhijay007/goose that referenced this pull request Feb 11, 2026
* 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)
  ...
jh-block added a commit that referenced this pull request Feb 12, 2026
* 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)
  ...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants

Comments