Skip to content

Comments

feat: load provider/model specified inside the recipe config#6884

Merged
zanesq merged 5 commits intoblock:mainfrom
Abhijay007:feat/recipeProvider
Feb 11, 2026
Merged

feat: load provider/model specified inside the recipe config#6884
zanesq merged 5 commits intoblock:mainfrom
Abhijay007:feat/recipeProvider

Conversation

@Abhijay007
Copy link
Collaborator

closes: #6562

PR description

The Recipe details view is likely pulling the provider/model from the global settings state instead of reading it from the recipe's YAML configuration.

Type of Change

  • Feature

AI Assistance

  • This PR was created or reviewed with AI assistance

Testing

Tested in the desktop UI with recipes and different cases

Screenshots/Demos (for UX changes)

Before:

After:

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 the Recipe details page in the Goose Desktop UI was displaying the globally-selected provider and model instead of the provider and model specified in the recipe's YAML configuration. The fix adds recipe-aware logic to the ModelsBottomBar component to prioritize displaying recipe-specific provider/model settings when available, falling back to global settings when not specified in the recipe.

Changes:

  • Modified ModelsBottomBar component to accept a recipe prop and display recipe-specific provider/model when available
  • Updated ChatInput to pass the recipe prop to ModelsBottomBar

Reviewed changes

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

File Description
ui/desktop/src/components/settings/models/bottom_bar/ModelsBottomBar.tsx Added recipe prop and logic to extract and display provider/model from recipe settings, with fallback to global settings
ui/desktop/src/components/ChatInput.tsx Pass recipe prop to ModelsBottomBar component

@zanesq
Copy link
Collaborator

zanesq commented Feb 3, 2026

@Abhijay007 these copilot comments look legit can you take a look? Also maybe this should be rebased/pointed at Abhijay007:feat/editModelGUI since they should probably merge to main at the same time?

Signed-off-by: Abhijay007 <Abhijay007j@gmail.com>
Signed-off-by: Abhijay007 <Abhijay007j@gmail.com>
@zanesq
Copy link
Collaborator

zanesq commented Feb 5, 2026

I tested this and I don't think its actually using the selected model once the recipe is loaded, it shows it at the bottom as selected but its still querying the global model in the chat.

@zanesq
Copy link
Collaborator

zanesq commented Feb 5, 2026

@Abhijay007 I realized that provider/model is already specified in the session there's just something missing, goose says:

Now I see the issue clearly. Looking at restore_provider_from_session:

pub async fn restore_provider_from_session(&self, session: &Session) -> Result<()> {
    let config = Config::global();

    let provider_name = session
        .provider_name
        .clone()
        .or_else(|| config.get_goose_provider().ok())  // Falls back to global config
        .ok_or_else(|| anyhow!("Could not configure agent: missing provider"))?;

    let model_config = match session.model_config.clone() {
        Some(saved_config) => saved_config,
        None => {
            // Falls back to global config
            let model_name = config
                .get_goose_model()
                .map_err(|_| anyhow!("Could not configure agent: missing model"))?;
            crate::model::ModelConfig::new(&model_name)
                .map_err(|e| anyhow!("Could not configure agent: invalid model {}", e))?
        }
    };
    // ...
}

The problem is that when a session is created with a recipe, the recipe's settings.goose_provider and settings.goose_model are never saved to the session's provider_name and model_config fields.

Looking at start_agent:

  1. Session is created
  2. Extensions are resolved from recipe and saved to session
  3. Recipe is saved to session
  4. But provider/model from recipe settings are NOT saved to session

Then when resume_agent calls restore_provider_from_session:

  • session.provider_name is None (never set)
  • session.model_config is None (never set)
  • So it falls back to global config, ignoring the recipe's settings

The Fix

In start_agent, after saving the recipe to the session, we need to also save the provider/model from the recipe settings:

// In start_agent, after saving the recipe:
if let Some(ref recipe) = original_recipe {
    if let Some(ref settings) = recipe.settings {
        // Save recipe's provider/model to session so restore_provider_from_session uses them
        let mut update = manager.update(&session.id);
        
        if let Some(ref provider) = settings.goose_provider {
            update = update.provider_name(provider);
        }
        
        if let Some(ref model) = settings.goose_model {
            if let Ok(model_config) = ModelConfig::new(model) {
                update = update.model_config(model_config);
            }
        }
        
        update.apply().await.map_err(|err| {
            error!("Failed to update session with recipe provider/model: {}", err);
            ErrorResponse {
                message: format!("Failed to update session with recipe provider/model: {}", err),
                status: StatusCode::INTERNAL_SERVER_ERROR,
            }
        })?;
    }
}

This way, when restore_provider_from_session is called, it will find the recipe's provider/model in the session and use them instead of falling back to global config.

Copilot AI review requested due to automatic review settings February 9, 2026 20:37
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.

Copilot encountered an error and was unable to review this pull request. You can try again by re-requesting a review.

@zanesq
Copy link
Collaborator

zanesq commented Feb 9, 2026

@Abhijay007 I found the issue and pushed a fix, test it out and lmk what you think when you get a chance.

agent.rs - restore_provider_from_session now checks recipe.settings as a fallback between session-level overrides and global config, so the agent actually uses the recipe's model.

ModelsBottomBar.tsx - Tracks userChangedModel flag. When false, displays recipe model/provider. When true (after user submits a new model), displays the user's choice. Cancel doesn't flip the flag.

SwitchModelModal.tsx - New initialModel prop so the modal pre-selects the recipe's model when opened during a recipe session.

* 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)
  ...
@zanesq
Copy link
Collaborator

zanesq commented Feb 11, 2026

Just pushed a better fix for the model/provider loading and bottom bar display syncing

@zanesq zanesq requested a review from DOsinga February 11, 2026 19:51
@Abhijay007
Copy link
Collaborator Author

Just pushed a better fix for the model/provider loading and bottom bar display syncing

checking it now

@Abhijay007
Copy link
Collaborator Author

Tested LGTM

@zanesq zanesq merged commit cfa2778 into block:main Feb 11, 2026
19 checks passed
zanesq added a commit that referenced this pull request Feb 11, 2026
Signed-off-by: Abhijay007 <Abhijay007j@gmail.com>
Co-authored-by: Zane Staggs <zane@squareup.com>
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)
  ...
blackgirlbytes added a commit that referenced this pull request Feb 18, 2026
…sions

Add documentation for the Desktop GUI features that allow users to edit
recipe model, provider, and extensions settings directly from the UI
(PR #6804) and clarify the automatic UI updates when recipes specify
provider/model settings (PR #6884).

Changes:
- Update RecipeFields.js component to include model/provider and extensions
- Add 'Advanced Options' section in session-recipes.md explaining:
  - Model and Provider selection dropdowns
  - Extensions toggle interface with search
- Enhance recipe-reference.md Settings note to mention Desktop UI updates

Closes documentation for PR #6804 and PR #6884
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

2 participants