(params: {
outputStr: string
message: string | null
diffFromOutput: string | null
})
| 311 | } |
| 312 | |
| 313 | function hasFailedEditOutput(params: { |
| 314 | outputStr: string |
| 315 | message: string | null |
| 316 | diffFromOutput: string | null |
| 317 | }): boolean { |
| 318 | const { outputStr, message, diffFromOutput } = params |
| 319 | const trimmedOutput = outputStr.trim() |
| 320 | if (!trimmedOutput) { |
| 321 | return false |
| 322 | } |
| 323 | if ( |
| 324 | extractValueForKey(outputStr, 'errorMessage') || |
| 325 | isErrorOutput(outputStr) |
| 326 | ) { |
| 327 | return true |
| 328 | } |
| 329 | if (diffFromOutput || isSuccessfulEditMessage(message)) { |
| 330 | return false |
| 331 | } |
| 332 | return !isSuccessfulEditMessage(trimmedOutput) |
| 333 | } |
| 334 | |
| 335 | function isFailedEditToolBlock(toolBlock: ToolContentBlock): boolean { |
| 336 | const outputRaw = toolBlock.outputRaw as unknown |
no test coverage detected