Skip to content

Launch leaf-dev's browsers and leaf children on the pinned headless shell - #2786

Merged
max-sixty merged 3 commits into
mainfrom
leaf-dev-headless-shell
Oct 13, 2026
Merged

max-sixty merged 3 commits into
mainfrom
leaf-dev-headless-shell

Conversation

@max-sixty

@max-sixty max-sixty commented Oct 13, 2026 •

Copy link
Copy Markdown
Owner

#1488 named the pinned headless shell as the suite's browser, but leaf-dev still reached the host's browser through launch_browser, which picks installed Google Chrome. Every leaf-dev stills, probe, eval, journey and verify-site run, and every leaf page check a leaf-dev child ran, launched Chrome with a fresh profile.

On macOS that cost has grown since #1488 measured about a second of secd CPU per launch. Each fresh profile leaves a key in Chrome's unexportable-keys keychain group, and every later Chrome launch makes secd read all of them back. On the maintainer's Mac the group holds 27,188 keys, and one read took 5.6 s of secd CPU; agent sessions running stills and page checks kept secd at 50–70%.

What changes

  • leaf_dev.browser.headless_shell() (was chrome()) launches Playwright's pinned headless shell, the build _browser drives. Every caller is renamed, and refresh-previews uses it instead of launching the shell itself.
  • leaf_dev.browser.shell_executable() now owns the shell lookup that was in the suite's headless_shell fixture. The fixture calls it, and arms.environment() names it as LEAF_BROWSER_EXECUTABLE for every leaf and agent child, unless LEAF_BROWSER_EXECUTABLE is already set. It outranks CHROME_PATH and CHROME_BIN, which hosts set for other tools (GitHub's runner sets CHROME_BIN to its Chrome), as the suite's fixture already does. Page checks inside evals, journeys, bench-check and the site build draw with the shell too.
  • eval-ui-review keeps installed Chrome, now launched explicitly: its provider.mjs gives the model's live tool installed Chrome, so the screenshots and the recorded version stay on the same build.
  • publish-site installs the shell. Its deploy-site job ran verify-site and the journey on the runner's preinstalled Chrome, with no Playwright install.

The product's own launch order (launch_browser: named executable, then installed Chrome, then PATH) is unchanged, since a user's host has no Playwright shell. One consequence for evals: an agent's page check there no longer raises Chrome's autofill-layer DevTools issues, which the shell doesn't report (render_gate/readings.py).

notes/browser-support.md's recheck for installed Chrome now uses a channel="chrome" one-liner, since leaf-dev probe reads the shell.

This was written by Claude Code on behalf of max-sixty

max-sixty and others added 2 commits October 13, 2026 15:38
…hell

leaf-dev reached the host's browser through `launch_browser`, which picks
installed Google Chrome, so every stills, probe, eval, journey and
verify-site run, and every `page check` a leaf-dev child ran, launched
Chrome with a fresh profile. On macOS each fresh profile leaves a key in
Chrome's keychain group that every later launch makes `secd` read back.

`leaf_dev.browser.headless_shell()` (was `chrome()`) launches the shell,
and `shell_executable()`, moved from the suite's fixture, is named as
LEAF_BROWSER_EXECUTABLE for every child `arms.environment()` builds.
eval-ui-review keeps installed Chrome explicitly, matching its provider's
live tool. publish-site installs the shell it now needs.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>

@leaf-agent leaf-agent left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The new child environment overrides a browser the host explicitly selected through CHROME_PATH or CHROME_BIN. launch_browser() reads LEAF_BROWSER_EXECUTABLE first, so setting it to the shell changes the browser used by leaf-dev children. Apply the shell default only when none of the three browser variables names an executable.

Comment thread dev/leaf_dev/arms.py Resolved
@max-sixty
max-sixty merged commit 6948407 into main Oct 13, 2026
4 checks passed
@max-sixty
max-sixty deleted the leaf-dev-headless-shell branch October 13, 2026 23:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants