From f82a3d3e2bb47f1cac5eff036380a52df1420d20 Mon Sep 17 00:00:00 2001 From: boris Date: Mon, 16 Feb 2026 12:56:57 +0100 Subject: [PATCH] fix: use resolveUserPath utility for tilde expansion --- src/auto-reply/reply/commands-export-session.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/auto-reply/reply/commands-export-session.ts b/src/auto-reply/reply/commands-export-session.ts index 57d49a8d7..eb2f7e3a9 100644 --- a/src/auto-reply/reply/commands-export-session.ts +++ b/src/auto-reply/reply/commands-export-session.ts @@ -24,6 +24,7 @@ import { import { loadSessionStore } from "../../config/sessions/store.js"; import { getRemoteSkillEligibility } from "../../infra/skills-remote.js"; import { buildTtsSystemPromptHint } from "../../tts/tts.js"; +import { resolveUserPath } from "../../utils.js"; // Export HTML templates are bundled with this module const EXPORT_HTML_DIR = path.join(path.dirname(fileURLToPath(import.meta.url)), "export-html"); @@ -290,7 +291,7 @@ export async function buildExportSessionReply(params: HandleCommandsParams): Pro const timestamp = new Date().toISOString().replace(/[:.]/g, "-").slice(0, 19); const defaultFileName = `openclaw-session-${entry.sessionId.slice(0, 8)}-${timestamp}.html`; const outputPath = args.outputPath - ? path.resolve(args.outputPath.startsWith("~") ? args.outputPath.replace("~", process.env.HOME ?? "") : args.outputPath) + ? resolveUserPath(args.outputPath) : path.join(params.workspaceDir, defaultFileName); // Ensure directory exists