From ccb8479242dab57d4e1ffdac342bf678f23a527e Mon Sep 17 00:00:00 2001 From: hz4th_coder Date: Sun, 5 Jul 2026 00:12:48 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=20agent-browser=20socket=20?= =?UTF-8?q?=E7=9B=AE=E5=BD=95=E6=9D=83=E9=99=90=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 自动创建 /tmp/agent-browser-sockets 目录 - 设置 AGENT_BROWSER_SOCKET_DIR 环境变量 - 解决 Permission denied 错误 --- app.py | 4 ++++ templates/index.html | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/app.py b/app.py index b84107d..00bc584 100644 --- a/app.py +++ b/app.py @@ -44,6 +44,10 @@ CORS(app) CAPTURE_DIR = Path(tempfile.gettempdir()) / "web_captures" CAPTURE_DIR.mkdir(exist_ok=True) +# agent-browser socket 目录 +os.environ.setdefault("AGENT_BROWSER_SOCKET_DIR", "/tmp/agent-browser-sockets") +Path(os.environ["AGENT_BROWSER_SOCKET_DIR"]).mkdir(exist_ok=True, parents=True) + class AgentBrowserSession: """agent-browser 会话管理器""" diff --git a/templates/index.html b/templates/index.html index 607fd14..de67b77 100644 --- a/templates/index.html +++ b/templates/index.html @@ -405,7 +405,7 @@ submitBtn.disabled = true; try { - const response = await fetch('http://localhost:16025/api/capture', { + const response = await fetch('/api/capture', { method: 'POST', headers: { 'Content-Type': 'application/json'