( toolOutput: string, )
| 283 | } |
| 284 | |
| 285 | function classifyToolResultContext( |
| 286 | toolOutput: string, |
| 287 | ): 'error' | 'large-diff' | 'test-fail' | null { |
| 288 | if (!toolOutput) { |
| 289 | return null |
| 290 | } |
| 291 | if (TEST_FAIL_RE.test(toolOutput)) { |
| 292 | return 'test-fail' |
| 293 | } |
| 294 | if (ERROR_RE.test(toolOutput)) { |
| 295 | return 'error' |
| 296 | } |
| 297 | if (/^(@@ |diff )/m.test(toolOutput)) { |
| 298 | const changedLineCount = toolOutput.match(/^[+-](?![+-])/gm)?.length ?? 0 |
| 299 | if (changedLineCount > LARGE_DIFF_THRESHOLD) { |
| 300 | return 'large-diff' |
| 301 | } |
| 302 | } |
| 303 | return null |
| 304 | } |
| 305 | |
| 306 | function buildReactionTranscript( |
| 307 | messages: readonly Message[], |
no outgoing calls
no test coverage detected