Skip to content

Commit 3be9f2a

Browse files
author
maebahesioru
committed
fix: stop sequence timeout and Google Search toggle reliability
- stop sequence press timeout: 3s -> 5s - Google Search toggle: use force click to bypass overlay issues
1 parent 3f758cb commit 3be9f2a

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

src/browser/page_controller.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -388,7 +388,7 @@ async def _adjust_google_search(self, request_params: Dict[str, Any], check_clie
388388
return
389389
action = '打開' if should_enable_search else '關閉'
390390
self.logger.info(f'[{self.req_id}] 🌍 (嘗試 {attempt}/{max_retries}) 正在{action} Google Search...')
391-
await click_element(self.page, toggle_locator, 'Google Search Toggle', self.req_id)
391+
await toggle_locator.click(force=True, timeout=3000)
392392
await self._check_disconnect(check_client_disconnected, f'Google Search 開關 - 點擊{action}後')
393393
await asyncio.sleep(1.0)
394394
new_state = await toggle_locator.get_attribute('aria-checked')
@@ -703,8 +703,8 @@ async def _adjust_stop_sequences(self, stop_sequences, page_params_cache: dict,
703703
if normalized_requested_stops:
704704
await expect_async(stop_input_locator).to_be_visible(timeout=5000)
705705
for seq in normalized_requested_stops:
706-
await stop_input_locator.fill(seq, timeout=3000)
707-
await stop_input_locator.press('Enter', timeout=3000)
706+
await stop_input_locator.fill(seq, timeout=5000)
707+
await stop_input_locator.press('Enter', timeout=5000)
708708
await asyncio.sleep(DELAY_AFTER_FILL)
709709
page_params_cache['stop_sequences'] = normalized_requested_stops
710710
self.logger.info(f'[{self.req_id}] 停止序列已成功设置。缓存已更新。')

0 commit comments

Comments
 (0)