

























@@ -193,12 +193,15 @@ vi.mock("../config/sessions/transcript-resolve.runtime.js", () => {
193193};
194194const joinPath = (...parts: string[]): string => {
195195const separator = parts.some((part) => part.includes("\\")) ? "\\" : "/";
196-return parts
197-.map((part, index) =>
198-index === 0 ? part.replace(/[\\/]+$/u, "") : part.replace(/^[\\/]+|[\\/]+$/gu, ""),
199-)
200-.filter(Boolean)
201-.join(separator);
196+const normalizedParts: string[] = [];
197+for (const [index, part] of parts.entries()) {
198+const normalized =
199+index === 0 ? part.replace(/[\\/]+$/u, "") : part.replace(/^[\\/]+|[\\/]+$/gu, "");
200+if (normalized.length > 0) {
201+normalizedParts.push(normalized);
202+}
203+}
204+return normalizedParts.join(separator);
202205};
203206const resolveSessionFile = (sessionId: string, agentId: string, sessionsDir?: string): string =>
204207joinPath(sessionsDir ?? ".openclaw", "agents", agentId, "sessions", `${sessionId}.jsonl`);
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。