* Compresses terminal output by applying run-length encoding and truncating to reasonable limits. * Uses hardcoded defaults: 500 lines, 50K characters - these are UI display limits to prevent * memory issues, not LLM context limits (which are controlled by terminalOutputPreviewSize). * @param
(input: string)
| 275 | * @returns The compressed terminal output |
| 276 | */ |
| 277 | public static compressTerminalOutput(input: string): string { |
| 278 | // Hardcoded UI display limits - these prevent unbounded memory growth |
| 279 | // in the chat display, separate from the LLM context limits |
| 280 | const LINE_LIMIT = 500 |
| 281 | const CHARACTER_LIMIT = 50_000 |
| 282 | |
| 283 | return truncateOutput(applyRunLengthEncoding(input), LINE_LIMIT, CHARACTER_LIMIT) |
| 284 | } |
| 285 | |
| 286 | /** |
| 287 | * Sets whether to enable ZDOTDIR handling for zsh |
nothing calls this directly
no test coverage detected