[feat]: apply `toolTimeout` arg to more tools
SE
8mo ago+1001+1001+0123456789012345678901234567890123456789-522-522-012345678901234567890123456789
why
toolTimeoutwas only being applied to theact,extract,fillForm, &ariaTreetools- we want the
toolTimeoutto take effect across all of the tools (with the exception ofwait&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) inwithTimeout() - update error logs to include the timeout duration in the log message
updated error logs with timeout duration:
example of tool call respecting timeout (screenshot() had no toolTimeout before)
test plan
- extended tests in
timeout.spec.tsto validate that all of the tools correctly respecttoolTimeout
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 plumbedtoolTimeoutviacreateAgentTools; updated: click, clickAndHold, dragAndDrop, type, keys, scroll (DOM and hybrid), screenshot, goto, navback, search (Brave and Browserbase), fillFormVision; refined timeout messages inact,extract,fillForm,ariaTree. - Timeout errors now log and return
TimeoutError: <message>with the timeout (ms); added integration tests intimeouts.spec.tsto verify each tool respectstoolTimeout.
- Wrapped tool executions in
-
Migration
- No breaking changes. Set
toolTimeoutwhen creating tools or agents:createAgentTools(v3, { toolTimeout: <ms> })orv3.agent({ toolTimeout: <ms> }).
- No breaking changes. Set