From 4fa35d3fd9151a0c916eccbef4d4f78b3b9647a6 Mon Sep 17 00:00:00 2001 From: Peter Steinberger Date: Tue, 17 Feb 2026 02:24:31 +0100 Subject: [PATCH] Revert "fix: use resolveUserPath utility for tilde expansion" This reverts commit f82a3d3e2bb47f1cac5eff036380a52df1420d20. --- src/auto-reply/reply/commands-export-session.ts | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/src/auto-reply/reply/commands-export-session.ts b/src/auto-reply/reply/commands-export-session.ts index 5305c41a5..23e30dff9 100644 --- a/src/auto-reply/reply/commands-export-session.ts +++ b/src/auto-reply/reply/commands-export-session.ts @@ -1,18 +1,17 @@ +import type { SessionEntry as PiSessionEntry, SessionHeader } from "@mariozechner/pi-coding-agent"; +import { SessionManager } from "@mariozechner/pi-coding-agent"; import fs from "node:fs"; import path from "node:path"; import { fileURLToPath } from "node:url"; -import type { SessionEntry as PiSessionEntry, SessionHeader } from "@mariozechner/pi-coding-agent"; -import { SessionManager } from "@mariozechner/pi-coding-agent"; +import type { SessionEntry } from "../../config/sessions/types.js"; +import type { ReplyPayload } from "../types.js"; +import type { HandleCommandsParams } from "./commands-types.js"; import { resolveDefaultSessionStorePath, resolveSessionFilePath, } from "../../config/sessions/paths.js"; import { loadSessionStore } from "../../config/sessions/store.js"; -import type { SessionEntry } from "../../config/sessions/types.js"; -import { resolveUserPath } from "../../utils.js"; -import type { ReplyPayload } from "../types.js"; import { resolveCommandsSystemPromptBundle } from "./commands-system-prompt.js"; -import type { HandleCommandsParams } from "./commands-types.js"; // Export HTML templates are bundled with this module const EXPORT_HTML_DIR = path.join(path.dirname(fileURLToPath(import.meta.url)), "export-html"); @@ -170,7 +169,11 @@ 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 - ? resolveUserPath(args.outputPath) + ? path.resolve( + args.outputPath.startsWith("~") + ? args.outputPath.replace("~", process.env.HOME ?? "") + : args.outputPath, + ) : path.join(params.workspaceDir, defaultFileName); // Ensure directory exists