[fix]: handle mapping `timeout` -> `timeoutMs`

Merged
SE
8mo ago
+13-2

why

  • the timeoutMs param in goto was not being respected when using the stagehand api
  • the /navigate route on the server expects timeout, while the actual goto() implementation in node expects timeoutMs

what changed

  • added logic to correctly send the timeoutMs param to the server as timeout
  • added server side logic to map the timeout back to timoeutMs (which is what goto() expects)

screenshot: (navigate correctly adheres to defined timeout)

Screenshot 2026-03-27 at 4 13 04 PM

Summary by cubic

Fixes timeout handling for navigation by mapping timeoutMs on the client to timeout over the API, then back to timeoutMs for page.goto(). Navigations now respect the configured timeout when using the Stagehand API.

  • Bug Fixes
    • Client sends timeout to /navigate from options.timeoutMs.
    • Server maps timeout to timeoutMs before calling page.goto().