When cdp url is set, but browser type is not set throw a 400

Merged
TK
7mo ago
+53-1

why

Currently, if a cdp url is set, but browser.type is not set to local a session is created on api

what changed

We now warn people that they need to set the browser.type to local to properly use their own custom cdp url

test plan

tested locally with http requests + from go client + added tests


Summary by cubic

Return 400 on POST /v1/sessions/start when browser.cdpUrl is provided but browser.type is not "local", preventing unintended session creation and guiding correct local CDP usage.

  • Bug Fixes
    • Reject requests with cdpUrl when browser.type is missing or not "local"; respond 400 with a clear message to set browser.type to "local".
    • Keep local validation: when browser.type is "local", require cdpUrl or launchOptions.
    • Add integration tests for missing type and type="browserbase" with cdpUrl.