Skip to content

Commit 230dbf0

Browse files
committed
Fixed unresponsive user response button
1 parent 4526d64 commit 230dbf0

File tree

1 file changed

+3
-6
lines changed

1 file changed

+3
-6
lines changed

src/webui/components/browser_use_agent_tab.py

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -632,11 +632,8 @@ def done_callback_wrapper(history: AgentHistoryList):
632632
last_chat_len = len(webui_manager.bu_chat_history)
633633
yield update_dict
634634
# Wait until response is submitted or task finishes
635-
while (
636-
webui_manager.bu_response_event is not None
637-
and not agent_task.done()
638-
):
639-
await asyncio.sleep(0.2)
635+
await webui_manager.bu_response_event.wait()
636+
640637
# Restore UI after response submitted or if task ended unexpectedly
641638
if not agent_task.done():
642639
yield {
@@ -1071,7 +1068,7 @@ async def clear_wrapper() -> AsyncGenerator[Dict[Component, Any], None]:
10711068

10721069
# --- Connect Event Handlers using the Wrappers --
10731070
run_button.click(
1074-
fn=submit_wrapper, inputs=all_managed_components, outputs=run_tab_outputs
1071+
fn=submit_wrapper, inputs=all_managed_components, outputs=run_tab_outputs, trigger_mode="multiple"
10751072
)
10761073
user_input.submit(
10771074
fn=submit_wrapper, inputs=all_managed_components, outputs=run_tab_outputs

0 commit comments

Comments
 (0)