Skip to content

fix: recipe extensions ignored when run from UI and scheduler#6438

Closed
Abhijay007 wants to merge 1 commit intoblock:mainfrom
Abhijay007:fix/recipeUiExtensionArray
Closed

fix: recipe extensions ignored when run from UI and scheduler#6438
Abhijay007 wants to merge 1 commit intoblock:mainfrom
Abhijay007:fix/recipeUiExtensionArray

Conversation

@Abhijay007
Copy link
Collaborator

@Abhijay007 Abhijay007 commented Jan 11, 2026

Closes: #6023

PR Description

This PR fixes a bug where recipe extensions were being ignored when recipes were run from the UI and scheduler. The fix ensures that recipe extensions are properly saved to the session's extension_data so they can be loaded correctly.

Type of Change

  • Bug fix

AI Assistance

  • This PR was created or reviewed with AI assistance

Testing

Screenshots/Demos (for UX changes)

Before:

After:

Signed-off-by: Abhijay007 <Abhijay007j@gmail.com>
Copilot AI review requested due to automatic review settings January 11, 2026 17:46
@Abhijay007 Abhijay007 marked this pull request as draft January 11, 2026 17:46
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 where recipe extensions were being ignored when recipes were run from the UI and scheduler. The fix ensures that recipe extensions are properly saved to the session's extension_data so they can be loaded correctly.

Changes:

  • Added logic to merge recipe extensions with global/override extensions in the agent start flow
  • Added code to save recipe extensions to session extension_data in the scheduler execution flow
  • Imported necessary types for extension handling

Reviewed changes

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

File Description
crates/goose/src/scheduler.rs Added import for extension types and logic to save recipe extensions to session extension_data during scheduled job execution
crates/goose-server/src/routes/agent.rs Modified agent start logic to merge recipe extensions with global/override extensions before saving to session

Comment on lines +766 to +771
// Save recipe to session
SessionManager::update_session(&session.id)
.recipe(Some(recipe.clone()))
.apply()
.await?;

Copy link

Copilot AI Jan 11, 2026

Choose a reason for hiding this comment

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

The recipe is being saved to the session twice - once here and again at lines 837-841. Remove this duplicate update since line 839 already saves the recipe to the session.

Suggested change
// Save recipe to session
SessionManager::update_session(&session.id)
.recipe(Some(recipe.clone()))
.apply()
.await?;

Copilot uses AI. Check for mistakes.
.extension_data(extension_data.clone())
.apply()
.await?;
session.extension_data = extension_data;
Copy link

Copilot AI Jan 11, 2026

Choose a reason for hiding this comment

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

After updating extension_data in the database, you're also updating the local session object with the same data. However, this local mutation doesn't persist since the session object isn't used further in this function - it's only referenced once more to get the id on line 772. Consider removing this line as it serves no purpose.

Suggested change
session.extension_data = extension_data;

Copilot uses AI. Check for mistakes.
@DOsinga DOsinga requested a review from lifeizhou-ap January 12, 2026 17:14
@lifeizhou-ap
Copy link
Collaborator

Hi @Abhijay007,

Thanks for the contribution! This looks good as a short-term fix to unblock the issue.

For recipe extensions, we still have some inconsistencies across CLI, Desktop, and Scheduler. It would be great if we could align on a single resolution across all three.

Current inconsistent behaviour when starting a new session:

  • Desktop: Uses enabled extensions from global config. With your fix, it merges those with extensions defined in the recipe.

  • CLI: Uses recipe extensions; if none are specified, it falls back to enabled extensions from global config.

  • Scheduler: Uses only recipe extensions.

I am thinking we could unify the logic and use the CLI behaviour as the source of truth, implemented in a centralized place. I’ve started a draft PR (still WIP) to explore: #6464. WDYT?

@DOsinga
Copy link
Collaborator

DOsinga commented Jan 13, 2026

thanks @lifeizhou-ap - that makes a lot of sense to me!

@lifeizhou-ap
Copy link
Collaborator

Hi @Abhijay007,

I have merged PR #6464 to main branch, and it fixes issue #6023.

Just wondering whether you would like to close this PR?

@Abhijay007
Copy link
Collaborator Author

Hi @Abhijay007,

I have merged PR #6464 to main branch, and it fixes issue #6023.

Just wondering whether you would like to close this PR?

I will resolve this one asap, I think the one you merged is for cli and this one is for UI ?

@lifeizhou-ap
Copy link
Collaborator

Hi @Abhijay007,
I have merged PR #6464 to main branch, and it fixes issue #6023.
Just wondering whether you would like to close this PR?

I will resolve this one asap, I think the one you merged is for cli and this one is for UI ?

The one I merged is also for Desktop, now CLI, Desktop and Scheduler shared the same logic to load the recipe extensions

@Abhijay007
Copy link
Collaborator Author

Hi @Abhijay007,
I have merged PR #6464 to main branch, and it fixes issue #6023.
Just wondering whether you would like to close this PR?

I will resolve this one asap, I think the one you merged is for cli and this one is for UI ?

The one I merged is also for Desktop, now CLI, Desktop and Scheduler shared the same logic to load the recipe extensions

Oh so we can close this one ig

@Abhijay007
Copy link
Collaborator Author

#6464 fixes issue #6023.

@Abhijay007 Abhijay007 closed this Jan 19, 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.

Recipes in UI are not using extensions field

3 participants