Skip to content

Restore old system prompt behavior around subagents#7576

Merged
jamadeo merged 4 commits intomainfrom
jack-and-alex/soften-system-prompt-summon
Feb 27, 2026
Merged

Restore old system prompt behavior around subagents#7576
jamadeo merged 4 commits intomainfrom
jack-and-alex/soften-system-prompt-summon

Conversation

@jamadeo
Copy link
Copy Markdown
Collaborator

@jamadeo jamadeo commented Feb 27, 2026

Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 5cdb7617c3

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

Comment on lines +502 to +505
let skills: Vec<&Source> = sources
.iter()
.filter(|s| s.kind == SourceKind::Skill || s.kind == SourceKind::BuiltinSkill)
.collect();
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Sort discovered skills before composing summon instructions

The new instruction builder takes sources as-is and immediately formats skill bullets, but those sources come from read_dir traversal whose entry order is not guaranteed; with multiple skills, the summon instruction text can reorder between runs. Because this text is embedded in the system prompt, that introduces avoidable prompt nondeterminism and cache misses. Please sort the selected skills (for example by name) before appending them to instructions.

Useful? React with 👍 / 👎.

Comment on lines +514 to +515
} else {
None
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Preserve baseline summon guidance when session context is absent

This branch drops summon instructions entirely when no session object is present, so the extension contributes no usage guidance to the system prompt. That can happen on runtime enable flows that call ExtensionManager::add_extension without a session id (for example from platform_extensions/ext_manager.rs), which means enabling summon in-session can silently produce an empty summon instructions section. Keeping a default summon instruction string and only appending dynamic skill text when a session exists avoids that regression.

Useful? React with 👍 / 👎.

Copy link
Copy Markdown
Collaborator

@DOsinga DOsinga left a comment

Choose a reason for hiding this comment

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

I think we could add a test to verify that we actually find the skills, but that can be done later.



You have these skills at your disposal, when it is clear they can help you solve a problem or you are asked to use them:
• goose-doc-guide - Reference goose documentation to create, configure, or explain goose-specific features like recipes, extensions, sessions, and providers. You MUST fetch relevant goose docs before answering. You MUST NOT rely on training data or assumptions for any goose-specific fields, values, names, syntax, or commands.
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

not for now, but maybe where this is generated we can throw in some skills so they actually show up here. hmm, actually, actually, should we even show this if there are no skills?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

this goose-doc-guide is a skill that currently always appears, because it's built into the binary

Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: e432b708d4

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

Comment on lines +510 to +512
instructions.push_str("\n\nYou have these skills at your disposal, when it is clear they can help you solve a problem or you are asked to use them:");
for skill in &skills {
instructions.push_str(&format!("\n• {} - {}", skill.name, skill.description));
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Keep repo skill metadata out of system-level instructions

This constructor now builds InitializeResult.instructions by interpolating skill.description values from discovered SKILL.md files, which includes session working-directory skill folders, so a malicious repository can inject arbitrary prompt text at system-instruction priority as soon as summon is enabled. That is a behavior regression from the previous static summon guidance and can silently steer model behavior before any explicit load/delegate call; treat filesystem skill metadata as untrusted and avoid embedding it directly in system instructions.

Useful? React with 👍 / 👎.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

This is a good point, but I think in general we trust the working directory in goose. WDYT @DOsinga @alexhancock ?

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

I think this is how skills are supposed to work - you install an evil skill and your agent becomes evil. YOLO all the way

if !skills.is_empty() {
instructions.push_str("\n\nYou have these skills at your disposal, when it is clear they can help you solve a problem or you are asked to use them:");
for skill in &skills {
instructions.push_str(&format!("\n• {} - {}", skill.name, skill.description));
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Should we put a limit on the max number of skills in the description? The skill monorepos can have dozens or hundreds

@jamadeo jamadeo merged commit c8a7189 into main Feb 27, 2026
17 of 21 checks passed
@jamadeo jamadeo deleted the jack-and-alex/soften-system-prompt-summon branch February 27, 2026 20:42
tlongwell-block added a commit that referenced this pull request Feb 27, 2026
…m-extension-pr

* origin/main:
  Restore old system prompt behavior around subagents (#7576)
tlongwell-block added a commit that referenced this pull request Feb 27, 2026
PlatformExtensionContext gained a session field from #7576.
Add session: None to the test helper. Update snapshot.
tlongwell-block added a commit that referenced this pull request Feb 27, 2026
PlatformExtensionContext gained a session field from #7576.
Add session: None to the test helper. Update snapshot.
craigwalkeruk pushed a commit to craigwalkeruk/custom-goose that referenced this pull request Mar 5, 2026
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.

3 participants