(task: OpenADETask)
| 120 | } |
| 121 | |
| 122 | function taskReviewThreadXml(task: OpenADETask): string { |
| 123 | const events = task.events.filter((event) => eventRecord(event)?.type !== "snapshot") |
| 124 | const maxBytes = 240_000 |
| 125 | const included: unknown[] = [] |
| 126 | let byteLength = 0 |
| 127 | for (let index = events.length - 1; index >= 0; index--) { |
| 128 | const eventText = JSON.stringify(events[index]) |
| 129 | const eventBytes = Buffer.byteLength(eventText, "utf8") |
| 130 | if (included.length > 0 && byteLength + eventBytes > maxBytes) break |
| 131 | included.unshift(events[index]) |
| 132 | byteLength += eventBytes |
| 133 | } |
| 134 | return JSON.stringify(included, null, 2) |
| 135 | } |
| 136 | |
| 137 | function recentSnapshotFiles(task: OpenADETask, limit = 40): string[] { |
| 138 | const summaries: string[] = [] |
no test coverage detected