Improve: Use consistent ExecOptions type and proper fallback for maxBuffer

Co-authored-by: Siumauricio <47042324+Siumauricio@users.noreply.github.com>
This commit is contained in:
copilot-swe-agent[bot]
2025-12-28 19:33:30 +00:00
parent 222bcba91b
commit e416aa6a10
@@ -15,12 +15,12 @@ const MAX_EXEC_BUFFER_SIZE = 100 * 1024 * 1024;
export const execAsync = async (
command: string,
options?: { cwd?: string; env?: NodeJS.ProcessEnv; shell?: string },
options?: ExecOptions & { shell?: string },
): Promise<{ stdout: string; stderr: string }> => {
try {
const result = await execAsyncBase(command, {
...options,
maxBuffer: MAX_EXEC_BUFFER_SIZE,
maxBuffer: options?.maxBuffer ?? MAX_EXEC_BUFFER_SIZE,
});
return {
stdout: result.stdout.toString(),
@@ -64,7 +64,7 @@ export const execAsyncStream = (
const childProcess = exec(
command,
{ maxBuffer: MAX_EXEC_BUFFER_SIZE, ...options },
{ ...options, maxBuffer: options?.maxBuffer ?? MAX_EXEC_BUFFER_SIZE },
(error) => {
if (error) {
reject(