(text, limit = MAX_COMMENT_STDERR_CHARS)
| 2667 | const MAX_COMMENT_STDERR_CHARS = 20000; |
| 2668 | |
| 2669 | function tailForComment(text, limit = MAX_COMMENT_STDERR_CHARS) { |
| 2670 | const s = String(text || ""); |
| 2671 | if (s.length <= limit) return s; |
| 2672 | return `[... ${s.length - limit} earlier characters truncated; see the ocr-stderr.log artifact ...]\n${s.slice(-limit)}`; |
| 2673 | } |
| 2674 | |
| 2675 | function safeFence(content) { |
| 2676 | const matches = String(content || "").match(/`+/g) || []; |
no outgoing calls