@@ -4,12 +4,7 @@ import * as vscode from "vscode"
44
55import delay from "delay"
66
7- import {
8- CommandExecutionStatus ,
9- DEFAULT_TERMINAL_OUTPUT_CHARACTER_LIMIT ,
10- DEFAULT_TERMINAL_OUTPUT_PREVIEW_SIZE ,
11- PersistedCommandOutput ,
12- } from "@roo-code/types"
7+ import { CommandExecutionStatus , DEFAULT_TERMINAL_OUTPUT_PREVIEW_SIZE , PersistedCommandOutput } from "@roo-code/types"
138import { TelemetryService } from "@roo-code/telemetry"
149
1510import { Task } from "../task/Task"
@@ -69,11 +64,7 @@ export class ExecuteCommandTool extends BaseTool<"execute_command"> {
6964 const provider = await task . providerRef . deref ( )
7065 const providerState = await provider ?. getState ( )
7166
72- const {
73- terminalOutputLineLimit = 500 ,
74- terminalOutputCharacterLimit = DEFAULT_TERMINAL_OUTPUT_CHARACTER_LIMIT ,
75- terminalShellIntegrationDisabled = true ,
76- } = providerState ?? { }
67+ const { terminalShellIntegrationDisabled = true } = providerState ?? { }
7768
7869 // Get command execution timeout from VSCode configuration (in seconds)
7970 const commandExecutionTimeoutSeconds = vscode . workspace
@@ -98,8 +89,6 @@ export class ExecuteCommandTool extends BaseTool<"execute_command"> {
9889 command : unescapedCommand ,
9990 customCwd,
10091 terminalShellIntegrationDisabled,
101- terminalOutputLineLimit,
102- terminalOutputCharacterLimit,
10392 commandExecutionTimeout,
10493 }
10594
@@ -153,8 +142,6 @@ export type ExecuteCommandOptions = {
153142 command : string
154143 customCwd ?: string
155144 terminalShellIntegrationDisabled ?: boolean
156- terminalOutputLineLimit ?: number
157- terminalOutputCharacterLimit ?: number
158145 commandExecutionTimeout ?: number
159146}
160147
@@ -165,8 +152,6 @@ export async function executeCommandInTerminal(
165152 command,
166153 customCwd,
167154 terminalShellIntegrationDisabled = true ,
168- terminalOutputLineLimit = 500 ,
169- terminalOutputCharacterLimit = DEFAULT_TERMINAL_OUTPUT_CHARACTER_LIMIT ,
170155 commandExecutionTimeout = 0 ,
171156 } : ExecuteCommandOptions ,
172157) : Promise < [ boolean , ToolResponse ] > {
@@ -223,8 +208,8 @@ export async function executeCommandInTerminal(
223208
224209 let accumulatedOutput = ""
225210 // Bound accumulated output buffer size to prevent unbounded memory growth for long-running commands.
226- // The interceptor preserves full output; this buffer is only for UI display.
227- const maxAccumulatedOutputSize = terminalOutputCharacterLimit * 2
211+ // The interceptor preserves full output; this buffer is only for UI display (100KB limit) .
212+ const maxAccumulatedOutputSize = 100_000
228213 const callbacks : RooTerminalCallbacks = {
229214 onLine : async ( lines : string , process : RooTerminalProcess ) => {
230215 accumulatedOutput += lines
@@ -238,11 +223,7 @@ export async function executeCommandInTerminal(
238223 interceptor ?. write ( lines )
239224
240225 // Continue sending compressed output to webview for UI display (unchanged behavior)
241- const compressedOutput = Terminal . compressTerminalOutput (
242- accumulatedOutput ,
243- terminalOutputLineLimit ,
244- terminalOutputCharacterLimit ,
245- )
226+ const compressedOutput = Terminal . compressTerminalOutput ( accumulatedOutput )
246227 const status : CommandExecutionStatus = { executionId, status : "output" , output : compressedOutput }
247228 provider ?. postMessageToWebview ( { type : "commandExecutionStatus" , text : JSON . stringify ( status ) } )
248229
@@ -272,11 +253,7 @@ export async function executeCommandInTerminal(
272253 }
273254
274255 // Continue using compressed output for UI display
275- result = Terminal . compressTerminalOutput (
276- output ?? "" ,
277- terminalOutputLineLimit ,
278- terminalOutputCharacterLimit ,
279- )
256+ result = Terminal . compressTerminalOutput ( output ?? "" )
280257
281258 task . say ( "command_output" , result )
282259 completed = true
0 commit comments