mirror of
https://github.com/google-gemini/gemini-cli.git
synced 2026-04-21 10:34:35 -07:00
fix(core): ensure file stream output dir exists and test uses explicit tool output path
This commit is contained in:
@@ -466,7 +466,9 @@ export class ShellToolInvocation extends BaseToolInvocation<
|
||||
const onAbort = () => combinedController.abort();
|
||||
|
||||
const outputFileName = `gemini_shell_output_${crypto.randomBytes(6).toString('hex')}.log`;
|
||||
const outputFilePath = path.join(os.tmpdir(), outputFileName);
|
||||
const projectTempDir = this.context.config.storage.getProjectTempDir();
|
||||
fs.mkdirSync(projectTempDir, { recursive: true });
|
||||
const outputFilePath = path.join(projectTempDir, outputFileName);
|
||||
const outputStream = fs.createWriteStream(outputFilePath);
|
||||
|
||||
let fullOutputReturned = false;
|
||||
@@ -669,7 +671,8 @@ export class ShellToolInvocation extends BaseToolInvocation<
|
||||
}
|
||||
|
||||
const result = await resultPromise;
|
||||
await new Promise<void>((resolve) => {
|
||||
await new Promise<void>((resolve, reject) => {
|
||||
outputStream.on('error', reject);
|
||||
outputStream.end(resolve);
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user