diff --git a/apps/open-swe/src/tools/shell.ts b/apps/open-swe/src/tools/shell.ts index f7241a1b..c8529b20 100644 --- a/apps/open-swe/src/tools/shell.ts +++ b/apps/open-swe/src/tools/shell.ts @@ -11,6 +11,11 @@ const logger = createLogger(LogLevel.INFO, "ShellTool"); const DEFAULT_COMMAND_TIMEOUT = 60_000; // 1 minute +const DEFAULT_ENV = { + // Prevents corepack from showing a y/n download prompt which causes the command to hang + COREPACK_ENABLE_DOWNLOAD_PROMPT: "0", +}; + const shellToolSchema = z.object({ command: z.array(z.string()).describe("The command to run"), workdir: z @@ -48,6 +53,7 @@ export const shellTool = tool( const result = await sandbox.commands.run(command.join(" "), { timeoutMs: timeout ?? DEFAULT_COMMAND_TIMEOUT, cwd: workdir, + envs: DEFAULT_ENV, }); if (result.error) {