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
+17
View File
@@ -0,0 +1,17 @@
# AGENTS.md
## XiaoHongShu / Playwright Hard Rules
These rules are mandatory for any workflow that uses `tools/pw` (directly or indirectly).
1. Preflight before first browser action:
- Run `tools/pw --help` once with escalation (`sandbox_permissions=require_escalated`).
2. All `tools/pw ...` commands (including browse/like/comment/reply flows) must be executed with escalation (`sandbox_permissions=require_escalated`) by default.
3. If preflight or any `tools/pw ...` command still fails with network sandbox signatures, rerun the same command with escalation immediately:
- `ENOTFOUND`
- `EAI_AGAIN`
- `ETIMEDOUT`
- `ECONNREFUSED`
- `registry.npmjs.org` fetch failure
4. Do not continue XiaoHongShu actions (browse/like/comment/reply) until preflight succeeds.
5. Do not try alternate non-escalated workarounds for `tools/pw`.