({
turnCount = 320,
fileLineCount = 28,
fileLineWidth = 72,
}: LargeTranscriptFixtureOptions = {})
| 201 | * same regime that has historically led to freezing and multi-GB RSS spikes. |
| 202 | */ |
| 203 | export function makeLargeTranscriptMessages({ |
| 204 | turnCount = 320, |
| 205 | fileLineCount = 28, |
| 206 | fileLineWidth = 72, |
| 207 | }: LargeTranscriptFixtureOptions = {}) { |
| 208 | const messages = [] |
| 209 | const buildLine = (turn: number, line: number) => |
| 210 | `export const value_${turn.toString(36)}_${line |
| 211 | .toString(36) |
| 212 | .padStart(2, '0')} = '${`${turn}-${line}`.padEnd(fileLineWidth, 'x')}';` |
| 213 | |
| 214 | for (let i = 0; i < turnCount; i += 1) { |
| 215 | const fileBody = Array.from( |
| 216 | { length: fileLineCount }, |
| 217 | (_, line) => buildLine(i, line), |
| 218 | ).join('\n') |
| 219 | |
| 220 | messages.push( |
| 221 | createUserMessage({ |
| 222 | content: `user-${i} inspect src/file-${i}.ts and explain the regression`, |
| 223 | }), |
| 224 | ) |
| 225 | messages.push( |
| 226 | createAssistantMessage({ |
| 227 | content: [ |
| 228 | `assistant-${i}`, |
| 229 | '', |
| 230 | `Rendered excerpt for src/file-${i}.ts:`, |
| 231 | '```ts', |
| 232 | `// src/file-${i}.ts`, |
| 233 | fileBody, |
| 234 | '```', |
| 235 | '', |
| 236 | `Summary ${i}: this file contributes to the long-history render stress fixture.`, |
| 237 | ].join('\n'), |
| 238 | }), |
| 239 | ) |
| 240 | } |
| 241 | |
| 242 | return messages |
| 243 | } |
| 244 | |
| 245 | export function readScreenText(screen: Screen): string { |
| 246 | const rows: string[] = [] |
no test coverage detected