Skip to content

Add browser providers and Kernel hosted browsers - #66

Merged
brynary merged 10 commits into
recover/09-app-urlfrom
recover/10-hosted-browsers
Oct 5, 2026
Merged

brynary merged 10 commits into
recover/09-app-urlfrom
recover/10-hosted-browsers

Conversation

@brynary

@brynary brynary commented Oct 5, 2026 •

Copy link
Copy Markdown
Contributor

Add local and Kernel providers, per-worker leases and cleanup, CDP attachment through Playwright, hosted live-view logging, and support for newer Node versions in development runtimes. Keep this work separate for review.

Recovers the intended changes from #53, which were merged into the old development stack but did not reach main. Preserves the newer lithos-llm pin from #54.

Stage 10 of 10. Based on #65. Full recovery inventory and merge order: #57.

Merge the recovery PRs in order with merge commits. Once the preceding PR lands, retarget this PR to main.

Draft: review hosted-browser leasing and cleanup, live-view URL logging, and the documented remote upload limit (files must be smaller than 50 MiB). Local browsers remain the default.

Validation: CARGO_NET_OFFLINE=true mise run check passed on this branch. This runs formatting, Clippy, local Rust/browser tests, shim checks, eval tooling, and workflow checks. Paid model evals, the external BrowserSim round trip, and live Kernel checks were not rerun.

brynary and others added 10 commits October 5, 2026 08:55
A run now gets its browsers from a BrowserProvider. `whirl run
--browser-provider local|kernel` picks one; local is the default and
launches each flow's engine beside the shim as before. `kernel` leases
one Kernel hosted Chromium per worker slot and needs KERNEL_API_KEY.

- whirl-shim gains a `provider` module: the BrowserProvider trait
  (boxed futures, so it is dyn-compatible like ActPlanner),
  BrowserSource { Launch, Attach { cdp_endpoint } }, BrowserLease,
  Capabilities, RunId, ProviderError, and LocalBrowsers. BrowserOptions
  carries the worker's source and maps it to the new `connect` field.
- Shim protocol 10 adds `connect` to `startFlow`. With it, the shim
  attaches with chromium.connectOverCDP instead of launching, keys its
  browser by the endpoint, and rejects a non-Chromium engine.
- whirl-kernel is a new leaf crate that implements the trait with the
  Kernel Rust SDK: a 600 s idle timeout, run and slot tags on each
  browser, delete on release (a missing browser counts as released),
  and a sweep of every active browser tagged with the run.
- whirl-run's new `leases` module rejects a literal `browser` option
  the provider cannot run (usage error, before any lease), takes one
  lease per slot concurrently, gives back the arrived leases and sweeps
  when one fails, and releases then sweeps at the end of the run within
  20 s. RunSettings holds Arc<dyn BrowserProvider>; the runner never
  names a provider implementation. Each worker passes its slot's
  source to its flows.
- The binary maps the flag to a provider and is the only crate that
  depends on whirl-kernel.

SPEC section 13 lists the flag and section 15 notes that Playwright in
the shim attaches over CDP to a hosted browser. The draft crate layout
ADR adds whirl-kernel and the rule that a hosted provider is a crate
named after its service, used only by the binary. The kernel-sdk
dependency is a path to a local checkout until the SDK has a release.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
`whirl doctor` required the exact pinned Node, v24.19.0, wherever the
shim's Node came from, so it failed on a machine whose `node` is a newer
release, such as Homebrew's v26. The two doctor acceptance tests failed
there for the same reason.

ShimLaunch now records its origin: LaunchOrigin::Environment for
WHIRL_SHIM_JS and WHIRL_NODE, LaunchOrigin::Bundle for the installed
bundle. Doctor still requires the bundle's exact pinned Node, which
`whirl install` provides. A development runtime passes with any Node
from the pinned major version up; Playwright 1.62 supports Node 20 and
later. Unit tests cover both origins. The full suite passes on Node
v26.0.0 and on v24.19.0.

SPEC section 13 and the protocol's launch section state the rule.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
The telemetry rules no longer forbid URLs in log fields. With WHIRL_LOG
at `info` or lower, the runner logs each lease's live view URL when the
lease arrives, with the provider name and lease id, so a person can
watch a headed hosted browser. Kernel gives a live view URL only for a
headed browser, so `--headed --browser-provider kernel` shows it.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
whirl-kernel took kernel-sdk from a path on one machine, so the
workspace built nowhere else. It now pins
github.com/brynary/kernel-rust-sdk at 9342f36, the SDK's main. The SDK
has no crates.io release yet. Every crate it adds to the lockfile was
published more than 24 hours ago.

Also sort the shim's protocol type imports, which Biome's
organizeImports check requires.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Two Unreleased entries: `--browser-provider kernel`, with its key, its
engine check, the live view log, the network requirement, and the file
size limit for UPLOAD and DROP; and doctor's acceptance of newer Node in
a development runtime. The shim protocol entry now says 10.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Lease browsers from a swappable provider, with Kernel hosted browsers
…RE syntax

Keep the migrated check syntax in documentation, parser and lint tests, browser tests, and eval flows. Retain the 0.13.0 release entry and incorporate the base branch's expanded iframe eval results.
Replace check sections with ASSERT and CAPTURE lines
Add MOCK and request checks, and reject check sections
@brynary
brynary added this pull request to stack #67 October 5, 2026 18:18
@brynary
brynary marked this pull request as ready for review October 5, 2026 18:18
@brynary
brynary merged commit 4b1e20a into main Oct 5, 2026
3 checks passed
@brynary
brynary deleted the recover/10-hosted-browsers branch October 5, 2026 18:29
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.

1 participant