| 24 | |
| 25 | // Helper to create detailed error messages |
| 26 | export function createToolCallErrorMessage( |
| 27 | expectedTools: string | string[], |
| 28 | foundTools: string[], |
| 29 | result: string, |
| 30 | ) { |
| 31 | const expectedStr = Array.isArray(expectedTools) |
| 32 | ? expectedTools.join(' or ') |
| 33 | : expectedTools; |
| 34 | return ( |
| 35 | `Expected to find ${expectedStr} tool call(s). ` + |
| 36 | `Found: ${foundTools.length > 0 ? foundTools.join(', ') : 'none'}. ` + |
| 37 | `Output preview: ${result ? result.substring(0, 200) + '...' : 'no output'}` |
| 38 | ); |
| 39 | } |
| 40 | |
| 41 | // Helper to print debug information when tests fail |
| 42 | export function printDebugInfo( |