This commit is contained in:
nafer committed 2026-03-06 00:10:12 +03:00
1 parent 8c68bd8962
commit 54723d7f2d
2 files changed
+16 -14

No files matched your search

Binary file not shown.
+16 -14
View File
@@ -80,24 +80,26 @@ async def run_browser_task(task_id: str, task: str, max_steps: int, model: str):
import subprocess import subprocess
import glob import glob
# Ищем chromium в типичных местах (включая ms-playwright) # Точный путь из контейнера
chromium_search_paths = [ CHROME_PATH = "/root/.cache/ms-playwright/chromium-1208/chrome-linux64/chrome"
"/ms-playwright/chromium-*/chrome-linux/chrome",
"/root/.cache/ms-playwright/chromium-*/chrome-linux/chrome",
"/usr/bin/chromium",
"/usr/bin/chromium-browser",
"/usr/bin/google-chrome",
]
# Ищем chrome
chrome_exe = None chrome_exe = None
for pattern in chromium_search_paths: if os.path.exists(CHROME_PATH):
matches = glob.glob(pattern) chrome_exe = CHROME_PATH
if matches: else:
chrome_exe = matches[0] # Берем первый найденный # Fallback - ищем в кэше
break for pattern in [
"/root/.cache/ms-playwright/chromium-*/chrome-linux64/chrome",
"/ms-playwright/*/chrome-linux/chrome",
]:
matches = glob.glob(pattern)
if matches:
chrome_exe = matches[0]
break
if not chrome_exe: if not chrome_exe:
raise RuntimeError(f"Chrome/Chromium not found. Searched: {chromium_search_paths}") raise RuntimeError(f"Chrome not found. Path: {CHROME_PATH}")
# Создаем директорию для профиля # Создаем директорию для профиля
user_data_dir = "/app/browser-data" user_data_dir = "/app/browser-data"