Skip to content

fix: subrecipe relative path with summon#7295

Merged
michaelneale merged 3 commits intomainfrom
lifei/fix-subrecipe-relative-path
Feb 18, 2026
Merged

fix: subrecipe relative path with summon#7295
michaelneale merged 3 commits intomainfrom
lifei/fix-subrecipe-relative-path

Conversation

@lifeizhou-ap
Copy link
Collaborator

@lifeizhou-ap lifeizhou-ap commented Feb 18, 2026

Summary

This is only fix patch to get the release out quickly.

Bug: for subrecipe path ./sub_recipe_file.yam, it should use the path relative to parent recipe, but actually it tries the path relative to current working dir.

Root Cause:
For Desktop, we store original path for session recipe and resolved to the absolution path in agent. However, with summon it uses the recipe data in session without the main recipe path.

Fix:
Resolve the subrecipe path earlier. You can see it has applied at 2 places. Ideally it should resolve when load_file_path_by_id. However, recently in this PR #7096 it passes the recipe to the server end and the load_file_path_by_id is no longer used. So have to also apply the same logic in get_all_recipes_manifests now. When we switch back to use recipe_id, we can only apply the logic to load_file_path_by_id

Type of Change

  • Feature
  • Bug fix
  • Refactor / Code quality
  • Performance improvement
  • Documentation
  • Tests
  • Security fix
  • Build / Release
  • Other (specify below)

AI Assistance

  • This PR was created or reviewed with AI assistance

Testing

Related Issues

Relates to #ISSUE_ID
Discussion: LINK (if any)

Screenshots/Demos (for UX changes)

Before:

After:

Copilot AI review requested due to automatic review settings February 18, 2026 05:41
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 an issue where sub-recipe paths remain relative when recipes are loaded through the goose-server routes, making them unusable by the summon extension. The fix exposes resolve_sub_recipe_path as a public function and adds path resolution logic to both recipe loading functions in the server routes.

Changes:

  • Made resolve_sub_recipe_path public in the recipe build module
  • Added sub-recipe path resolution in get_all_recipes_manifests for recipe manifests
  • Added sub-recipe path resolution in load_recipe_by_id for individual recipe loading

Reviewed changes

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

File Description
crates/goose/src/recipe/build_recipe/mod.rs Changed resolve_sub_recipe_path function visibility from private to public to allow use in server routes
crates/goose-server/src/routes/recipe_utils.rs Added sub-recipe path resolution logic in two functions (get_all_recipes_manifests and load_recipe_by_id) to convert relative paths to absolute paths

Comment on lines +54 to +62
if let Some(recipe_dir) = file_path.parent() {
if let Some(ref mut sub_recipes) = recipe.sub_recipes {
for sr in sub_recipes.iter_mut() {
if let Ok(resolved) = resolve_sub_recipe_path(&sr.path, recipe_dir) {
sr.path = resolved;
}
}
}
}
Copy link

Copilot AI Feb 18, 2026

Choose a reason for hiding this comment

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

This path resolution logic is duplicated in load_recipe_by_id (lines 144-152). Consider extracting it into a helper function to avoid duplication and ensure consistent behavior across both functions.

Copilot uses AI. Check for mistakes.
Comment on lines +57 to +59
if let Ok(resolved) = resolve_sub_recipe_path(&sr.path, recipe_dir) {
sr.path = resolved;
}
Copy link

Copilot AI Feb 18, 2026

Choose a reason for hiding this comment

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

Silent error handling: when resolve_sub_recipe_path fails, the error is silently ignored. This could hide issues like missing sub-recipe files. Consider logging a warning when path resolution fails so issues are visible during debugging.

Copilot uses AI. Check for mistakes.
Copy link
Collaborator

Choose a reason for hiding this comment

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

probably ok in this case

Comment on lines +147 to +148
if let Ok(resolved) = resolve_sub_recipe_path(&sr.path, recipe_dir) {
sr.path = resolved;
Copy link

Copilot AI Feb 18, 2026

Choose a reason for hiding this comment

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

Silent error handling: when resolve_sub_recipe_path fails, the error is silently ignored. This could hide issues like missing sub-recipe files. Consider logging a warning when path resolution fails so issues are visible during debugging.

Suggested change
if let Ok(resolved) = resolve_sub_recipe_path(&sr.path, recipe_dir) {
sr.path = resolved;
match resolve_sub_recipe_path(&sr.path, recipe_dir) {
Ok(resolved) => {
sr.path = resolved;
}
Err(err) => {
eprintln!(
"Warning: failed to resolve sub-recipe path '{}' relative to '{}': {err}",
sr.path.display(),
recipe_dir.display()
);
}

Copilot uses AI. Check for mistakes.
Copy link
Collaborator

@michaelneale michaelneale left a comment

Choose a reason for hiding this comment

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

yeah seems reasonable to unblock - will need to fmt it (and a bit of deep nesting going on which may cause clippy grief)

@michaelneale michaelneale added this pull request to the merge queue Feb 18, 2026
Merged via the queue into main with commit cc51ec0 Feb 18, 2026
20 checks passed
@michaelneale michaelneale deleted the lifei/fix-subrecipe-relative-path branch February 18, 2026 06:11
jh-block added a commit that referenced this pull request Feb 18, 2026
* origin/main: (49 commits)
  chore: show important keys for provider configuration (#7265)
  fix: subrecipe relative path with summon (#7295)
  fix extension selector not displaying the correct enabled extensions (#7290)
  Use the working dir from the session (#7285)
  Fix: Minor logging uplift for debugging of prompt injection mitigation (#7195)
  feat(otel): make otel logging level configurable (#7271)
  docs: add documentation for Top Of Mind extension (#7283)
  Document gemini 3 thinking levels (#7282)
  docs: stream subagent tool calls (#7280)
  Docs: delete custom provider in desktop (#7279)
  Everything is streaming (#7247)
  openai: responses models and hardens event streaming handling (#6831)
  docs: disable ai session naming (#7194)
  Added cmd to validate bundled extensions json (#7217)
  working_dir usage more clear in add_extension (#6958)
  Use Canonical Models to set context window sizes (#6723)
  Set up direnv and update flake inputs (#6526)
  fix: restore subagent tool call notifications after summon refactor (#7243)
  fix(ui): preserve server config values on partial provider config save (#7248)
  fix(claude-code): allow goose to run inside a Claude Code session (#7232)
  ...
aharvard added a commit that referenced this pull request Feb 18, 2026
* origin/main:
  feat: add GOOSE_SUBAGENT_MODEL and GOOSE_SUBAGENT_PROVIDER config options (#7277)
  fix(openai): support "reasoning" field alias in streaming deltas (#7294)
  fix(ui): revert app-driven iframe width and send containerDimensions per ext-apps spec (#7300)
  New OpenAI event (#7301)
  ci: add fork guards to scheduled workflows (#7292)
  fix: allow ollama input limit override (#7281)
  chore: show important keys for provider configuration (#7265)
  fix: subrecipe relative path with summon (#7295)
  fix extension selector not displaying the correct enabled extensions (#7290)
  Use the working dir from the session (#7285)
  Fix: Minor logging uplift for debugging of prompt injection mitigation (#7195)
  feat(otel): make otel logging level configurable (#7271)
  docs: add documentation for Top Of Mind extension (#7283)
  Document gemini 3 thinking levels (#7282)
  docs: stream subagent tool calls (#7280)
  Docs: delete custom provider in desktop (#7279)

# Conflicts:
#	ui/desktop/src/components/McpApps/McpAppRenderer.tsx
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.

2 participants

Comments