Skip to content

Commit 2a03d7f

Browse files
committed
fix: yields provider when agent settings change
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 #589 Signed-off-by: knowlet <[email protected]>
1 parent 82dee36 commit 2a03d7f

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/webui/webui_manager.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
from typing import Optional, Dict, List
88
import uuid
99
import asyncio
10+
import time
1011

1112
from gradio.components import Component
1213
from browser_use.browser.browser import Browser
@@ -108,6 +109,9 @@ def load_config(self, config_path: str):
108109
update_components[comp] = comp.__class__(value=comp_val, type="messages")
109110
else:
110111
update_components[comp] = comp.__class__(value=comp_val)
112+
if comp_id == "agent_settings.planner_llm_provider":
113+
yield update_components # yield provider, let callback run
114+
time.sleep(0.1) # wait for Gradio UI callback
111115

112116
config_status = self.id_to_component["load_save_config.config_status"]
113117
update_components.update(

0 commit comments

Comments
 (0)