[feat]: apply `toolTimeout` arg to more tools

SE
8mo ago
+1001-522

why

  • toolTimeout was only being applied to the act, extract, fillForm, & ariaTree tools
  • we want the toolTimeout to take effect across all of the tools (with the exception of wait & think)
  • additionally, when a timeout was being hit, the duration of the timeout was not being included in the error logs

what changed

  • wrapped all agent tool calls (other than wait & think) in withTimeout()
  • update error logs to include the timeout duration in the log message

updated error logs with timeout duration:

Screenshot 2026-03-17 at 3 53 50 PM

example of tool call respecting timeout (screenshot() had no toolTimeout before)

Screenshot 2026-03-17 at 4 13 02 PM

test plan

  • extended tests in timeout.spec.ts to validate that all of the tools correctly respect toolTimeout

Summary by cubic

Applies a user-defined toolTimeout to all agent tools except wait and think, and adds clear timeout error messages that include the duration. Addresses Linear STG-1510 by standardizing timeout handling and improving logs across tools.

  • New Features

    • Wrapped tool executions in withTimeout() and plumbed toolTimeout via createAgentTools; updated: click, clickAndHold, dragAndDrop, type, keys, scroll (DOM and hybrid), screenshot, goto, navback, search (Brave and Browserbase), fillFormVision; refined timeout messages in act, extract, fillForm, ariaTree.
    • Timeout errors now log and return TimeoutError: <message> with the timeout (ms); added integration tests in timeouts.spec.ts to verify each tool respects toolTimeout.
  • Migration

    • No breaking changes. Set toolTimeout when creating tools or agents: createAgentTools(v3, { toolTimeout: <ms> }) or v3.agent({ toolTimeout: <ms> }).