(toolNames: string[], timeout?: number)
| 392 | } |
| 393 | |
| 394 | async waitForAnyToolCall(toolNames: string[], timeout?: number) { |
| 395 | // Use environment-specific timeout |
| 396 | if (!timeout) { |
| 397 | timeout = this.getDefaultTimeout(); |
| 398 | } |
| 399 | |
| 400 | // Wait for telemetry to be ready before polling for tool calls |
| 401 | await this.waitForTelemetryReady(); |
| 402 | |
| 403 | return this.poll( |
| 404 | () => { |
| 405 | const toolLogs = this.readToolLogs(); |
| 406 | return toolNames.some((name) => |
| 407 | toolLogs.some((log) => log.toolRequest.name === name), |
| 408 | ); |
| 409 | }, |
| 410 | timeout, |
| 411 | 100, |
| 412 | ); |
| 413 | } |
| 414 | |
| 415 | async poll( |
| 416 | predicate: () => boolean, |
no test coverage detected