Browser/Logging: share default openclaw tmp dir resolver

This commit is contained in:
Gustavo Madeira Santana
2026-02-12 16:43:07 -05:00
parent 4aa035f38f
commit b02c88d3e7
8 changed files with 191 additions and 18 deletions

View File

@@ -1,8 +1,8 @@
import type { Page } from "playwright-core";
import crypto from "node:crypto";
import fs from "node:fs/promises";
import os from "node:os";
import path from "node:path";
import { resolvePreferredOpenClawTmpDir } from "../infra/tmp-openclaw-dir.js";
import {
ensurePageState,
getPageForTargetId,
@@ -21,7 +21,7 @@ import {
function buildTempDownloadPath(fileName: string): string {
const id = crypto.randomUUID();
const safeName = fileName.trim() ? fileName.trim() : "download.bin";
return path.join(os.tmpdir(), "openclaw", "downloads", `${id}-${safeName}`);
return path.join(resolvePreferredOpenClawTmpDir(), "downloads", `${id}-${safeName}`);
}
function createPageDownloadWaiter(page: Page, timeoutMs: number) {