Skip to content

Keep both instructions and prompts when using subrecipes#6096

Closed
katzdave wants to merge 2 commits intomainfrom
dkatz/subagent-instructions-fix
Closed

Keep both instructions and prompts when using subrecipes#6096
katzdave wants to merge 2 commits intomainfrom
dkatz/subagent-instructions-fix

Conversation

@katzdave
Copy link
Collaborator

@katzdave katzdave commented Dec 12, 2025

Fixes #6078

The parameter passing was working fine, but we were only keeping instructions and not prompt which just told it it was a weather specialist and didn't have the actual parameter injection about the location it should look up.

recipe had:

instructions: |
  You are a weather data specialist. Gather current weather information
  including temperature, conditions, and seasonal context.
prompt: |
  Get the current weather for {{ location }}.

Copilot AI review requested due to automatic review settings December 12, 2025 22:15
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

This PR fixes a bug in subrecipe execution where the prompt field was being ignored when both instructions and prompt were present in a recipe. Previously, the code used or() logic that would only keep instructions if both fields existed, causing parameter-injected prompts to be lost.

Key changes:

  • Updated get_agent_messages() to properly handle all combinations of instructions and prompt fields
  • When both fields are present, they are now concatenated with double newlines between them
  • Preserves the original behavior for cases where only one field is present

@katzdave katzdave requested a review from DOsinga December 15, 2025 22:16
@jamadeo
Copy link
Collaborator

jamadeo commented Dec 16, 2025

hmm @tlongwell-block has a related change #6121, maybe that is the way to go?

@tlongwell-block
Copy link
Collaborator

hmm @tlongwell-block has a related change #6121, maybe that is the way to go?

I think #6121 is a bit more comprehensive

@alexhancock
Copy link
Collaborator

@tlongwell-block @katzdave I am looking to merge or close open PRs. Is this one still what we want to do or has #6121 addressed the same thing?

@katzdave
Copy link
Collaborator Author

Oops no worries, agree lets go with #6121

@katzdave katzdave closed this Dec 16, 2025
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.

Contextual Parameter Passing to Sub Recipes is broken

5 participants

Comments