()
| 264 | backgroundSignalManager.on("backgroundRequested", moveToBackground); |
| 265 | |
| 266 | const resetTimeout = () => { |
| 267 | if (timeoutId) { |
| 268 | clearTimeout(timeoutId); |
| 269 | } |
| 270 | timeoutId = setTimeout(() => { |
| 271 | if (isResolved) return; |
| 272 | isResolved = true; |
| 273 | child.kill(); |
| 274 | let output = stdout + (stderr ? `\nStderr: ${stderr}` : ""); |
| 275 | output += `\n\n[Command timed out after ${TIMEOUT_MS / 1000} seconds of no output]`; |
| 276 | |
| 277 | const truncationResult = truncateOutputFromStart(output, { |
| 278 | maxChars, |
| 279 | maxLines, |
| 280 | }); |
| 281 | const finalOutput = truncationResult.wasTruncated |
| 282 | ? appendParallelLimitNote(truncationResult.output) |
| 283 | : truncationResult.output; |
| 284 | resolve(finalOutput); |
| 285 | }, TIMEOUT_MS); |
| 286 | }; |
| 287 | |
| 288 | const showCurrentOutput = () => { |
| 289 | if (!context?.toolCallId) return; |
no test coverage detected