Skip to content

Fix planner_llm_model_name Not Loaded Correctly When Using "Load Config" #590

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
May 19, 2025

Conversation

knowlet
Copy link
Contributor

@knowlet knowlet commented May 14, 2025

Solution

  • In the WebuiManager.load_config method, retrieve the value of planner_llm_provider before setting the model name.
  • When setting the value for planner_llm_model_name, dynamically update its choices based on the provider, and use gr.Dropdown(value=..., choices=..., allow_custom_value=True) to update the component.
  • All other components remain unchanged.

Impact

  • When using the "Load Config" feature, the planner_llm_model_name dropdown will now correctly display the model name according to the loaded configuration, without requiring manual reselection.
  • This approach can be extended to other dropdowns with similar dependencies if needed.

Testing

  1. In the UI, select different values for planner_llm_provider and planner_llm_model_name, then save the configuration.
  2. Restart the WebUI or switch configuration files, and use "Load Config" to load the saved configuration.
  3. Verify that planner_llm_model_name correctly displays the corresponding model name, and that the provider and model name are properly synchronized.

Screenshot

image

Reference

fix #589


Summary by mrge

Fixed the "Load Config" feature so the planner LLM model name dropdown now shows the correct model based on the selected provider.

  • Bug Fixes
    • The dropdown updates its choices and value automatically when loading a config, matching the saved provider and model name.

@CLAassistant
Copy link

CLAassistant commented May 14, 2025

CLA assistant check
All committers have signed the CLA.

Copy link

@cubic-dev-ai cubic-dev-ai bot left a comment

Choose a reason for hiding this comment

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

mrge reviewed 1 file and found no issues. Review PR in mrge.io.

@vvincent1234
Copy link
Contributor

planner_llm_model_name should set to None because we don't want llm_panner in default

@knowlet
Copy link
Contributor Author

knowlet commented May 17, 2025

Change the default back to "None" and fix it by yielding an update first.
image
image

@vvincent1234
Copy link
Contributor

Thank you. You don't need a async , just use import time and time.sleep(0.2), i will let this pr pass

Yields the provider when the agent settings change in
order to run the callback. Also adds a short sleep to wait for
Gradio UI callback.

Fix Planner LLM Model Name not loaded correctly when Load Config browser-use#589

Signed-off-by: knowlet <[email protected]>
@knowlet
Copy link
Contributor Author

knowlet commented May 18, 2025

You're right, I've changed back to not using async and using time.Sleep.

time.Sleep didn't work the first time I tested it because I forgot to yield update_components. I switched to async while testing other methods and forgot to switch back. Thanks for the reminder!

@warmshao warmshao merged commit 32f6583 into browser-use:main May 19, 2025
1 check passed
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.

Planner LLM Model Name not loaded correctly when Load Config
4 participants