fix(agents): use static shell snapshot temp prefix

This commit is contained in:
Peter Steinberger
2026-05-31 17:12:09 +01:00
parent 63d0c1d513
commit fbfbe45fc6

View File

@@ -249,9 +249,7 @@ async function validateSnapshot(
async function captureShellSnapshot(opts: ShellSnapshotWrapOptions): Promise<string | null> {
const shellName = path.basename(opts.shell);
const captureOutputDir = await fs.mkdtemp(
path.join(os.tmpdir(), `openclaw-shell-snapshot-${process.pid}-`),
);
const captureOutputDir = await fs.mkdtemp(path.join(os.tmpdir(), "openclaw-shell-snapshot-"));
await fs.chmod(captureOutputDir, 0o700);
const captureOutputPath = path.join(captureOutputDir, "snapshot.out");
const captureOutputFile = await fs.open(captureOutputPath, "wx", 0o600);