feat(playwright): adopt per-thread sessions for shared Chrome automation

This commit is contained in:
2026-03-05 18:33:36 +08:00
parent aec5bcbfab
commit 8f9fc6d7f7
15 changed files with 180 additions and 78 deletions
+3 -3
View File
@@ -18,10 +18,10 @@ description: "Execute XiaoHongShu (小红书) image-note publishing workflow in
## Shared Session Policy
- Reuse a single Playwright CLI session across all web-automation skills:
- `export PLAYWRIGHT_SHARED_SESSION=codex-shared`
- Use per-thread Playwright CLI sessions across all web-automation skills:
- Auto session policy: `tools/pw` derives one Playwright session per `CODEX_THREAD_ID` (fallback: `PLAYWRIGHT_SESSION_OWNER` or explicit `--session`).
- Use `/Users/xd/java/xhs/tools/pw` as the only Playwright CLI entrypoint.
- Do not pass `--session` directly in skill-specific commands.
- Prefer the default auto session; pass `--session <name>` only when explicit isolation is required.
## 1) Enter Creator Publish Page
@@ -1,4 +1,4 @@
interface:
display_name: "XHS Publish Note"
short_description: "Publish XHS image notes with manifest image linkage, hard gates, and publish modes"
default_prompt: "Use $xiaohongshu-publish-note with PLAYWRIGHT_SHARED_SESSION=codex-shared and run all browser steps via /Users/xd/java/xhs/tools/pw; publish XiaoHongShu image notes by preferring user image paths, otherwise generate via $gemini-image-web and use manifest target paths, enforce hard gates (images>=1, topics>=5, no location), and run in safe_mode by default unless live_mode is explicitly requested."
default_prompt: "Use $xiaohongshu-publish-note with auto per-thread Playwright session via /Users/xd/java/xhs/tools/pw and run all browser steps via /Users/xd/java/xhs/tools/pw; publish XiaoHongShu image notes by preferring user image paths, otherwise generate via $gemini-image-web and use manifest target paths, enforce hard gates (images>=1, topics>=5, no location), and run in safe_mode by default unless live_mode is explicitly requested."