Skip to content

feat(browser-runtime): implement the Steel browser runtime - #344

Open
vaibhavdabas16 wants to merge 3 commits into
TIGER-AI-Lab:mainfrom
vaibhavdabas16:feat/steel-browser-runtime
Open

feat(browser-runtime): implement the Steel browser runtime#344
vaibhavdabas16 wants to merge 3 commits into
TIGER-AI-Lab:mainfrom
vaibhavdabas16:feat/steel-browser-runtime

Conversation

@vaibhavdabas16

Copy link
Copy Markdown
Contributor

Closes #105. That was the last open sub-issue of #103 (support more browser runtimes).

What

--browser-runtime steel has been reserved since the runtime abstraction landed, but selecting it raised steel browser runtime is reserved but not implemented yet. This implements it.

Steel Cloud and the self-hosted steel-dev/steel-browser linked in #105 expose the same /v1/sessions API, so one provider covers both:

  • Steel CloudSTEEL_API_KEY in .env.local, sent as the steel-api-key header.
  • Self-hostedSTEEL_BASE_URL=http://localhost:3000. No key is required, so the key is only mandatory when the endpoint is the cloud one.

Details

  • Sessions are created with ClawBench's 1920x1080 viewport and the task time limit plus 120s of headroom. Steel expresses timeout in milliseconds, so the value is converted and bounded to [60_000, 86_400_000].
  • dimensions and timeout are set by ClawBench and rejected as user options; the rest of the allowlist is blockAds, solveCaptcha, useProxy, proxyUrl, region, userAgent, stealthConfig, sessionContext, extensionIds, each type-checked at construction the way the Browserbase and Kernel providers do.
  • Steel serves its rrweb replay from the session viewer rather than as a downloadable file, so there is no recording.mp4 to fetch. The runtime reports recording_mode: "provider" with the viewer URL as recording_url — the same shape Browserbase already uses, which batch.py summary rendering already understands. finalize() is therefore a no-op; cleanup() releases the session and treats 404/409 as already_closed.
  • steel joins MANAGED_BROWSER_RUNTIMES, so batch runs default to --max-concurrent 1, pass --hide-browser-viewer, and refuse the claude-code-chrome-extension harness — consistent with the other managed runtimes.
  • The TUI runtime picker offers Steel and prints a session-viewer tip.
  • Browserbase and Kernel each carried an identical inline block scrubbing the API key out of URLError reasons. Steel needed a third, so that is now a shared _scrub_secret helper.

Testing

tests/test_browser_runtime.py replaces the "reserved" assertion with 11 cases covering the create/release round trip, payload and timeout bounds, cloud vs self-hosted key requirements, option validation, release-on-bad-response, 404 cleanup, and that neither HTTP nor network errors leak the key into an error message or into run-meta.json.

Full suite passes locally (286 passed, 10 skipped).

Not verified against a live Steel deployment — I don't have Steel credentials. Every request/response shape is exercised against fakes; a maintainer with an account or a local steel-browser should smoke-test one task before merge.

`--browser-runtime steel` was reserved but raised "not implemented yet".
Implement it against Steel's `/v1/sessions` API, which is shared by Steel
Cloud and a self-hosted steel-browser, so both are reachable: the API key
is mandatory only when talking to the cloud endpoint, and STEEL_BASE_URL
points at a local deployment.

Sessions are created with ClawBench's 1920x1080 viewport and the task time
limit plus 120s of headroom (expressed in milliseconds, as Steel expects),
and released on cleanup. Steel serves its replay from the session viewer
instead of a downloadable file, so the runtime reports recording_mode
"provider" with the viewer URL, the same shape Browserbase already uses.

Steel joins MANAGED_BROWSER_RUNTIMES so batch runs default to
--max-concurrent 1 and hide the local browser viewer, and it is offered in
the TUI runtime picker.

Also extracts the API-key scrubbing that Browserbase and Kernel each
carried inline into a shared `_scrub_secret` helper rather than adding a
third copy.
Replaces the "reserved, not implemented" assertion with coverage of the
create/release round trip: the request payload and bounded millisecond
timeout, cloud vs self-hosted key requirements, the option allowlist and
type checks, release-on-bad-response, 404 cleanup, and that neither HTTP
nor network errors leak the API key into a message or into run metadata.
Drops the "reserved and not implemented" note and adds a Steel section
covering Steel Cloud and self-hosted setup, the supported provider
options, the fields ClawBench sets itself, and the fact that a Steel run
has no local recording.mp4.
@Perry2004

Copy link
Copy Markdown
Collaborator

Thanks for the contribution 🎉.
I'll review this PR as a priority.

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.

FEAT: support steel browser

2 participants