Repository navigation
Add browser providers and Kernel hosted browsers - #66
Merged
Merged
Conversation
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
added this pull request to stack #67
October 5, 2026 18:18
brynary
marked this pull request as ready for review
October 5, 2026 18:18
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.
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 newerlithos-llmpin 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 checkpassed 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.