(text, limit = MAX_COMMENT_STDERR_CHARS)
| 2538 | const MAX_COMMENT_STDERR_CHARS = 20000; |
| 2539 | |
| 2540 | function tailForComment(text, limit = MAX_COMMENT_STDERR_CHARS) { |
| 2541 | const s = String(text || ""); |
| 2542 | if (s.length <= limit) return s; |
| 2543 | return `[... ${s.length - limit} earlier characters truncated; see the ocr-stderr.log artifact ...]\n${s.slice(-limit)}`; |
| 2544 | } |
| 2545 | |
| 2546 | function safeFence(content) { |
| 2547 | const matches = String(content || "").match(/`+/g) || []; |
no outgoing calls