Merge pull request #672 from ngocanhnt269/ngocanhnt269/fix_user_response_button

Fix: "Response" Button Unresponsiveness in Run Agent Tab
This commit is contained in:
warmshao
2025-08-09 13:42:18 +08:00
committed by GitHub

View File

@@ -632,11 +632,8 @@ async def run_agent_task(
last_chat_len = len(webui_manager.bu_chat_history) last_chat_len = len(webui_manager.bu_chat_history)
yield update_dict yield update_dict
# Wait until response is submitted or task finishes # Wait until response is submitted or task finishes
while ( await webui_manager.bu_response_event.wait()
webui_manager.bu_response_event is not None
and not agent_task.done()
):
await asyncio.sleep(0.2)
# Restore UI after response submitted or if task ended unexpectedly # Restore UI after response submitted or if task ended unexpectedly
if not agent_task.done(): if not agent_task.done():
yield { yield {
@@ -1071,7 +1068,7 @@ def create_browser_use_agent_tab(webui_manager: WebuiManager):
# --- Connect Event Handlers using the Wrappers -- # --- Connect Event Handlers using the Wrappers --
run_button.click( run_button.click(
fn=submit_wrapper, inputs=all_managed_components, outputs=run_tab_outputs fn=submit_wrapper, inputs=all_managed_components, outputs=run_tab_outputs, trigger_mode="multiple"
) )
user_input.submit( user_input.submit(
fn=submit_wrapper, inputs=all_managed_components, outputs=run_tab_outputs fn=submit_wrapper, inputs=all_managed_components, outputs=run_tab_outputs