fix(provider-webdriver): harden BrowserStack app references and endpoints

Merged
AM
2mo ago
+1207-189

Summary

Split out of #3118 and stacked on #3167. Please review only the top three commits. This PR has no TestMu code.

  • A query string on the session-details endpoint override is kept at the end of the URL (appendUrlPath). Before, the route was appended after the query.
  • Whitespace-only artifact URLs now count as absent.
  • If connection verification gets a 2xx answer that is not JSON, it now returns a typed COMMAND_FAILED with the status and hint. Before, this was reported as a network failure.
  • Review nit [2]: there is now a single bs:// canonicalizer and grammar (/^bs:\/\/[\w.-]+$/) in providers.ts. It is used at connect, on the remote-config connect route, in verification and when preparing a session.
    • BS://id is now treated as bs://id.
    • A malformed id is now INVALID_ARGS.

Behaviour change: a bs:// id with characters outside [\w.-] is now refused. BrowserStack's documented app_url (bs://<hex hash>) fits it. A bare custom_id is still not accepted through --provider-app; that is unchanged.

Validation

  • pnpm check:affected --run passes, and eager-closure-budgets passes.
  • Not run live against BrowserStack.

🤖 Generated with Claude Code