(q)
| 95 | } |
| 96 | |
| 97 | function _clipQuestion(q) { |
| 98 | const s = String(q || '').trim(); |
| 99 | if (!s) return '(buyer did not provide a question body)'; |
| 100 | if (s.length <= MAX_ANSWER_PROMPT_CHARS) return s; |
| 101 | return s.slice(0, MAX_ANSWER_PROMPT_CHARS - 40) + '\n...[TRUNCATED]...'; |
| 102 | } |
| 103 | |
| 104 | function _answerFilePath(taskId) { |
| 105 | const safe = String(taskId || 'task').replace(/[^a-zA-Z0-9_\-]/g, '_').slice(0, 64); |