From 5d42fbe45af4080dba2d6a588a2d50439f347f11 Mon Sep 17 00:00:00 2001 From: Self-Managing Codebase Manager <7004983+WillTaylor22@users.noreply.github.com> Date: Tue, 26 May 2026 09:19:16 +0000 Subject: [PATCH 1/2] memory: pw-capture-script-needs-executable-path Surfaced during PR #11 review-feedback round 1: the cached browser shim in tests/global-setup.ts (ENG-19) self-heals the test-runner path, but ad-hoc node-driven capture scripts (the step 4(j) flow) bypass globalSetup and need to pass executablePath directly to chromium.launch(). Captures fail with 'Executable doesn't exist' otherwise, even on a sandbox with a working cached browser. --- .claude/memory/MEMORY.md | 1 + .../2026-05-26-pw-capture-script-needs-executable-path.md | 3 +++ 2 files changed, 4 insertions(+) create mode 100644 .claude/memory/learnings/2026-05-26-pw-capture-script-needs-executable-path.md diff --git a/.claude/memory/MEMORY.md b/.claude/memory/MEMORY.md index 17e87ea..e8ad7d3 100644 --- a/.claude/memory/MEMORY.md +++ b/.claude/memory/MEMORY.md @@ -7,6 +7,7 @@ Keep this file under 200 lines — anything longer is content bloat, not memory. - [learnings/sentry-mcp-no-comment-tool](learnings/2026-05-26-sentry-mcp-no-comment-tool.md) — Sentry MCP can't comment on issues; back-link from Linear only - [learnings/vercel-blocks-unknown-author-email](learnings/2026-05-26-vercel-blocks-unknown-author-email.md) — Vercel preview deploys block when commit author email has no GitHub account; use the noreply alias - [learnings/sandbox-cant-clone-private-repo](learnings/2026-05-26-sandbox-cant-clone-private-repo.md) — Don't `git clone` from sandbox bash; the `github_repository` resource is auth'd, raw `git clone` is not +- [learnings/pw-capture-script-needs-executable-path](learnings/2026-05-26-pw-capture-script-needs-executable-path.md) — Ad-hoc `node`-driven Playwright capture scripts must pass `executablePath` directly; `tests/global-setup.ts` only self-heals when launched via the test runner ## Decisions - [decisions/mcp-for-small-writes-checkout-for-big](decisions/2026-05-26-mcp-for-small-writes-checkout-for-big.md) — Single-file writes go through GitHub MCP; multi-file or test-needing changes use the mounted checkout + `git push` diff --git a/.claude/memory/learnings/2026-05-26-pw-capture-script-needs-executable-path.md b/.claude/memory/learnings/2026-05-26-pw-capture-script-needs-executable-path.md new file mode 100644 index 0000000..1d909f6 --- /dev/null +++ b/.claude/memory/learnings/2026-05-26-pw-capture-script-needs-executable-path.md @@ -0,0 +1,3 @@ +# Ad-hoc Playwright capture scripts must pass `executablePath` + +`tests/global-setup.ts` self-heals the cached browser path **only** when Playwright is launched via the test runner (it's wired as `globalSetup` in `playwright.config.ts`). One-shot capture scripts run via `node /workspace/repo/.pr-capture.cjs` bypass that setup and hit a second-order failure: even after symlinking `/opt/pw-browsers/chromium-{wanted}` → `/opt/pw-browsers/chromium-1194`, Playwright still looks for `chromium_headless_shell-{wanted}/chrome-headless-shell-linux64/chrome-headless-shell` — but the 1194 cache stores it as `chromium_headless_shell-1194/chrome-linux/headless_shell` (different layout). Fix: launch with `executablePath: '/opt/pw-browsers/chromium-1194/chrome-linux/chrome'` (the full chrome binary, not the headless shell). This is what the step 4(j) capture script in the manager prompt needs — without it the script fails with "Executable doesn't exist" even on a sandbox that has a working cached browser. From 167cc2edad5e974515afed0bf60c6eda49d0c4d7 Mon Sep 17 00:00:00 2001 From: Self-Managing Codebase Manager <7004983+WillTaylor22@users.noreply.github.com> Date: Tue, 26 May 2026 09:23:47 +0000 Subject: [PATCH 2/2] Address review: tighten capture-script memory entry framing global-setup.ts already shims the inner headless-shell layout (lines 82-95). Reframe per reviewer's nit: the relevant point is just that ad-hoc node-driven capture scripts bypass globalSetup entirely, so passing executablePath sidesteps the question. --- .../2026-05-26-pw-capture-script-needs-executable-path.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.claude/memory/learnings/2026-05-26-pw-capture-script-needs-executable-path.md b/.claude/memory/learnings/2026-05-26-pw-capture-script-needs-executable-path.md index 1d909f6..cf1d64f 100644 --- a/.claude/memory/learnings/2026-05-26-pw-capture-script-needs-executable-path.md +++ b/.claude/memory/learnings/2026-05-26-pw-capture-script-needs-executable-path.md @@ -1,3 +1,3 @@ # Ad-hoc Playwright capture scripts must pass `executablePath` -`tests/global-setup.ts` self-heals the cached browser path **only** when Playwright is launched via the test runner (it's wired as `globalSetup` in `playwright.config.ts`). One-shot capture scripts run via `node /workspace/repo/.pr-capture.cjs` bypass that setup and hit a second-order failure: even after symlinking `/opt/pw-browsers/chromium-{wanted}` → `/opt/pw-browsers/chromium-1194`, Playwright still looks for `chromium_headless_shell-{wanted}/chrome-headless-shell-linux64/chrome-headless-shell` — but the 1194 cache stores it as `chromium_headless_shell-1194/chrome-linux/headless_shell` (different layout). Fix: launch with `executablePath: '/opt/pw-browsers/chromium-1194/chrome-linux/chrome'` (the full chrome binary, not the headless shell). This is what the step 4(j) capture script in the manager prompt needs — without it the script fails with "Executable doesn't exist" even on a sandbox that has a working cached browser. +`tests/global-setup.ts` self-heals the cached browser path (outer `chromium-{wanted}` symlink and inner `chrome-headless-shell-linux64/chrome-headless-shell` layout) **only** when Playwright is launched via the test runner — it's wired as `globalSetup` in `playwright.config.ts`. One-shot capture scripts run via `node /workspace/repo/.pr-capture.cjs` (the step 4(j) flow in the manager prompt) bypass `globalSetup` entirely, so the launch fails with "Executable doesn't exist" even on a sandbox with a working cached browser. Fix: launch with `executablePath: '/opt/pw-browsers/chromium-1194/chrome-linux/chrome'` (the full chrome binary). Sidesteps the headless-shell layout question altogether.