Commit cd95b7e
committed
Fix the Chromium assertion: playwright-cli is stateful and I invented its API
CI's last failure. The assertion ran:
playwright-cli screenshot --browser-arg=--no-sandbox file:///page.html /tmp/x.png
Every part of that is wrong, and none of it was read from the tool.
Read from the published @playwright/cli@0.1.17 tarball instead:
- It is STATEFUL. `open <url>` starts a session; `screenshot --filename <path>` acts on the
current page. There is no one-shot screenshot-a-URL form -- `screenshot [target]` takes an
element reference from a page snapshot.
- There is no --browser-arg. The sandbox is controlled by PLAYWRIGHT_MCP_SANDBOX, an env var.
So INT-CONTAINER-RUNTIME-CONTRACT saying "Chromium must launch with --no-sandbox" named a
mechanism that does not exist; the decision was right, the lever was imaginary.
- file:// navigation is BLOCKED by default outside cwd unless
PLAYWRIGHT_MCP_ALLOW_UNRESTRICTED_FILE_ACCESS is set. A good default, and the assertion
does not weaken it: the page is served from /workspace, which is cwd.
Same root cause as the ModelRuntime bug one commit ago -- describing an upstream API from
inference rather than from the artifact. The difference is only that this one failed loudly.
Also closed a real gap: INT-CONTAINER-RUNTIME-CONTRACT still hardcoded ANTHROPIC_API_KEY in
the env allowlist, while the decision to support any pi provider was only ever written in the
plan. The key variable is now specified as derived from pi's own table via
findEnvKeys(provider) -- ~30 providers, no hardcoding, no pass-through, and it cannot drift
when pi adds one. PLAYWRIGHT_MCP_SANDBOX added to the allowlist, or the job works in CI and
fails in production.1 parent 68d7abb commit cd95b7e
2 files changed
Lines changed: 36 additions & 15 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
147 | 147 | | |
148 | 148 | | |
149 | 149 | | |
150 | | - | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
151 | 155 | | |
152 | | - | |
| 156 | + | |
153 | 157 | | |
154 | | - | |
155 | | - | |
156 | | - | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
157 | 162 | | |
158 | 163 | | |
159 | 164 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
337 | 337 | | |
338 | 338 | | |
339 | 339 | | |
340 | | - | |
341 | | - | |
| 340 | + | |
| 341 | + | |
| 342 | + | |
| 343 | + | |
| 344 | + | |
| 345 | + | |
| 346 | + | |
| 347 | + | |
| 348 | + | |
| 349 | + | |
| 350 | + | |
| 351 | + | |
342 | 352 | | |
343 | 353 | | |
344 | 354 | | |
| |||
355 | 365 | | |
356 | 366 | | |
357 | 367 | | |
358 | | - | |
359 | | - | |
360 | | - | |
361 | | - | |
362 | | - | |
363 | | - | |
364 | | - | |
365 | | - | |
| 368 | + | |
| 369 | + | |
| 370 | + | |
| 371 | + | |
| 372 | + | |
| 373 | + | |
| 374 | + | |
| 375 | + | |
| 376 | + | |
366 | 377 | | |
| 378 | + | |
| 379 | + | |
| 380 | + | |
| 381 | + | |
| 382 | + | |
367 | 383 | | |
368 | 384 | | |
369 | 385 | | |
| |||
0 commit comments