Skip to content

Commit 748d253

Browse files
committed
fix CHROME_PERSISTENT_SESSION error
1 parent a123e94 commit 748d253

File tree

5 files changed

+6
-4
lines changed

5 files changed

+6
-4
lines changed

Dockerfile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,7 @@ RUN pip install --no-cache-dir -r requirements.txt
6161
ENV PLAYWRIGHT_BROWSERS_PATH=/ms-playwright
6262
RUN playwright install --with-deps chromium
6363
RUN playwright install-deps
64+
RUN apt-get install -y google-chrome-stable
6465

6566
# Copy the application code
6667
COPY . .

src/browser/custom_browser.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
# @FileName: browser.py
66

77
import asyncio
8+
import pdb
89

910
from playwright.async_api import Browser as PlaywrightBrowser
1011
from playwright.async_api import (

src/utils/default_config_settings.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ def default_config():
1717
"llm_temperature": 1.0,
1818
"llm_base_url": "",
1919
"llm_api_key": "",
20-
"use_own_browser": False,
20+
"use_own_browser": os.getenv("CHROME_PERSISTENT_SESSION", False),
2121
"keep_browser_open": False,
2222
"headless": False,
2323
"disable_security": True,

supervisord.conf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ startsecs=3
5858
depends_on=x11vnc
5959

6060
[program:persistent_browser]
61-
command=bash -c 'if [ "%(ENV_CHROME_PERSISTENT_SESSION)s" = "true" ]; then mkdir -p /app/data/chrome_data && sleep 8 && google-chrome --user-data-dir=/app/data/chrome_data --window-position=0,0 --window-size=%(ENV_RESOLUTION_WIDTH)s,%(ENV_RESOLUTION_HEIGHT)s --start-maximized --no-sandbox --disable-dev-shm-usage --disable-gpu --disable-software-rasterizer --disable-setuid-sandbox --no-first-run --no-default-browser-check --no-experiments --ignore-certificate-errors --remote-debugging-port=9222 --remote-debugging-address=0.0.0.0 "data:text/html,<html><body style=\"background: \#f0f0f0; margin: 0; display: flex; justify-content: center; align-items: center; height: 100vh; font-family: Arial;\"><h1>Browser Ready for AI Interaction</h1></body></html>"; else echo "Persistent browser disabled"; fi'
61+
command=bash -c 'mkdir -p /app/data/chrome_data && sleep 8 && google-chrome --user-data-dir=/app/data/chrome_data --window-position=0,0 --window-size=%(ENV_RESOLUTION_WIDTH)s,%(ENV_RESOLUTION_HEIGHT)s --start-maximized --no-sandbox --disable-dev-shm-usage --disable-gpu --disable-software-rasterizer --disable-setuid-sandbox --no-first-run --no-default-browser-check --no-experiments --ignore-certificate-errors --remote-debugging-port=9222 --remote-debugging-address=0.0.0.0 "data:text/html,<html><body style=\"background: \#f0f0f0; margin: 0; display: flex; justify-content: center; align-items: center; height: 100vh; font-family: Arial;\"><h1>Browser Ready for AI Interaction</h1></body></html>"'
6262
autorestart=%(ENV_CHROME_PERSISTENT_SESSION)s
6363
stdout_logfile=/dev/stdout
6464
stdout_logfile_maxbytes=0

tests/test_llm_api.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -127,5 +127,5 @@ def test_ollama_model():
127127
# test_openai_model()
128128
# test_gemini_model()
129129
# test_azure_openai_model()
130-
# test_deepseek_model()
131-
test_ollama_model()
130+
test_deepseek_model()
131+
# test_ollama_model()

0 commit comments

Comments
 (0)