diff --git a/apps/web/app/layout.tsx b/apps/web/app/layout.tsx index 0f46760724f..4209048b01e 100644 --- a/apps/web/app/layout.tsx +++ b/apps/web/app/layout.tsx @@ -16,6 +16,8 @@ export const viewport: Viewport = { maximumScale: 1, }; +export const dynamic = "force-dynamic"; + export default function RootLayout({ children, }: { diff --git a/apps/web/lib/telemetry.ts b/apps/web/lib/telemetry.ts index 2c4c7add8d5..cc89a1c5c0e 100644 --- a/apps/web/lib/telemetry.ts +++ b/apps/web/lib/telemetry.ts @@ -1,5 +1,6 @@ import { randomUUID } from "node:crypto"; import { existsSync, readFileSync, writeFileSync, mkdirSync } from "node:fs"; +import { homedir } from "node:os"; import { join, dirname } from "node:path"; import { PostHog } from "posthog-node"; @@ -30,7 +31,7 @@ export function getOrCreateAnonymousId(): string { if (_cachedAnonymousId) return _cachedAnonymousId; try { - const stateDir = join(process.env.HOME || "~", ".openclaw-dench"); + const stateDir = join(process.env.HOME || homedir(), ".openclaw-dench"); const configPath = join(stateDir, "telemetry.json"); let raw: Record = {}; diff --git a/extensions/posthog-analytics/lib/privacy.ts b/extensions/posthog-analytics/lib/privacy.ts index df9b3d552ae..d1b3dfb3448 100644 --- a/extensions/posthog-analytics/lib/privacy.ts +++ b/extensions/posthog-analytics/lib/privacy.ts @@ -1,5 +1,6 @@ import { randomUUID } from "node:crypto"; import { existsSync, readFileSync, writeFileSync, mkdirSync } from "node:fs"; +import { homedir } from "node:os"; import { join, dirname } from "node:path"; const SECRETS_PATTERN = @@ -10,7 +11,7 @@ const REDACTED = "[REDACTED]"; function resolveConfigPath(openclawConfig?: any): string { const stateDir = openclawConfig?.stateDir ?? - join(process.env.HOME || "~", ".openclaw-dench"); + join(process.env.HOME || homedir(), ".openclaw-dench"); return join(stateDir, "telemetry.json"); }