Repository navigation
Close browsers gracefully, and run dev evals on Chrome for Testing - #3355
Merged
Merged
Conversation
`ending()` SIGKILLed the browser's process group after every render gate run (#1691), because installed Chrome's graceful shutdown took about 4 s. On macOS that kill is what leaks keychain keys: each Google Chrome launch runs a Secure Enclave self-test that creates two keys and deletes them when it finishes, and a Chrome ended first leaves both behind. Every leaked key makes each later keychain read in Chrome slower, which is what made the graceful close slow, so the kill fed the cost it avoided. One Mac reached ~27k keys and kept secd at 50-70% CPU. The headless shell, Chrome for Testing and Firefox close in 0.02-0.3 s, so the kill saved nothing for them; `page check --render` with the shell times the same either way. Chrome 157 delays the self-test by 45 s and samples it, so a short check with installed Chrome will create no keys once users update. Until then a check with installed Chrome closes in up to ~10 s on a Mac whose keychain is already bloated. Browsers now close through Playwright's own context manager, and `ending()` is gone. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
`eval-ui-review`, the ui-review-detection provider and the arrangement eval's judge launched installed Google Chrome. On macOS every such launch runs Chrome's Secure Enclave self-test, and a Chrome ended before it finishes leaves two keychain keys behind. Chrome for Testing is a full Chrome build with no keychain entitlement, so it creates none, and unlike the headless shell it reports the autofill layer's form issues (a field with neither id nor name), which is why these evals wanted full Chrome. eval-ui-review needs its screenshots and the model's live tool to be one build, and the Python and Node Playwright pins resolved different Chromium builds (1.63 → 1243, 1.64 → 1248). The Python lock moves to Playwright 1.64.0 so `channel="chromium"` names the same Chrome for Testing 156 on both sides; the suite's headless shell moves from 153 to the same build. `leaf-dev setup` now installs the full Chromium build beside the shell. It still installs branded Chrome, which the render gate's default-channel journey test launches on purpose. The recorded `environment.json` key is now `browser`, since it is no longer Chrome's version. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
leaf-agent
approved these changes
Oct 20, 2026
This was referenced Oct 20, 2026
leaf-agent
added a commit
that referenced
this pull request
Oct 20, 2026
The [main CI run](https://github.com/max-sixty/leaf/actions/runs/39475232229) failed in 22 browser cases after #3355 moved Python Playwright from 1.63 to 1.64. The new browser changed scrolling behavior across reading-place, pane, margin, and touch tests; its trace format also changed from 9 to 10, which the bundled importer rejects. With the current source and Playwright 1.63, every reported failed case passes. This PR pins both Python and Node Playwright to 1.63, keeping the two eval clients on the same Chrome for Testing build while preserving #3355's graceful browser shutdown. Verification: all 22 reported failed cases pass locally with the new pins, including the trace importer and feature gallery; the short-workspace reading cue case passes; `pnpm run check` and pre-commit pass. The focused figure resize case and trace import both failed with 1.64 on the same source, then passed with 1.63. Restoring 1.64 will require reconciling its browser behavior and trace format. Co-authored-by: leaf-agent <[email protected]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
On macOS, every launch of Google-signed Chrome runs a Secure Enclave self-test that creates two keychain keys and deletes them when it finishes. A Chrome that ends first leaves both behind, and nothing ever collects them. Every leaked key makes each later keychain read in Chrome slower. Since #1691,
ending()has SIGKILLed the browser's process group after each render gate run, because installed Chrome's graceful close took about 4 s. That slow close was itself caused by leaked keys, so the kill fed the cost it was avoiding. One Mac reached about 27k keys, which keptsecdat 50–70% CPU.Close gracefully.
ending()is gone, and every browser closes through Playwright's own context manager. The headless shell, Chrome for Testing and Firefox close in 0.02–0.3 s, so dropping the kill costs nothing there:page check --renderon the shell takes 5.2–5.6 s either way. Installed Chrome 157 (Stable 2026-11-03) delays the self-test by 45 s and runs it on only 1 Mac Stable launch in 64, so short checks will stop creating keys once users update. Until then, on a Mac whose keychain is already bloated, a check with installed Chrome can take up to about 10 s to close.Dev evals on Chrome for Testing.
eval-ui-review, the ui-review-detection provider and the arrangement eval's judge now launch Chrome for Testing, which has no keychain entitlement, instead of installed Chrome. It is a full Chrome build, so unlike the headless shell it still reports the autofill layer's form issues.eval-ui-reviewneeds its screenshots and the model's live tool to come from one build, but the Python (1.63) and Node (1.64) Playwright pins resolved different Chromium builds. So the Python lock moves to Playwright 1.64.0. Both sides now launch Chrome for Testing 156, and the suite's headless shell moves from 153 to the same build.leaf-dev setupinstalls the full Chromium build beside the shell, about 360 MB more per fresh setup. It still installs branded Chrome, because the render gate's default-channel journey test launches it on purpose.Tested locally on macOS: the pre-merge selection (1,912 passed), and Chrome for Testing launched from both Node and Python Playwright, including through the judge's
playwright-cli --browser=chromium.