chore: sync ffmpeg RpaVideoSession, remove Playwright recording
All checks were successful
技能自动化发布 / release (push) Successful in 5s

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
2026-06-02 14:07:02 +08:00
parent 38343d22ca
commit f52536bdcc
4 changed files with 200 additions and 73 deletions

View File

@@ -1,5 +1,4 @@
# vendored from jiangchang-platform-kit; do not edit here, edit the kit.
"""统一 persistent context 启动封装。"""
"""统一 persistent context 启动封装(仅浏览器自动化,不负责录屏)。"""
from __future__ import annotations
@@ -25,12 +24,11 @@ async def launch_persistent_browser(
executable_path: str | None = None,
headless: bool | None = None,
extra_args: list[str] | None = None,
record_video_dir: str | None = None,
) -> "BrowserContext":
"""用 stealth 参数启动 persistent context + 注入 STEALTH_INIT_SCRIPT。
headless=None 时读 OPENCLAW_BROWSER_HEADLESS。
record_video_dir 非空则开录屏
录屏由 RpaVideoSessionffmpeg负责本函数不向 Playwright 传递任何录屏参数
"""
if headless is None:
v = (os.environ.get("OPENCLAW_BROWSER_HEADLESS") or "0").strip().lower()
@@ -53,8 +51,6 @@ async def launch_persistent_browser(
)
if ignore is not None:
launch_kwargs["ignore_default_args"] = ignore
if record_video_dir:
launch_kwargs["record_video_dir"] = record_video_dir
context = await playwright.chromium.launch_persistent_context(**launch_kwargs)
if stealth_enabled():