From 3b56a6252bbc4dcf3d3c68a5e3cbb0e1162e58a9 Mon Sep 17 00:00:00 2001 From: Peter Steinberger Date: Sat, 14 Feb 2026 12:40:41 +0100 Subject: [PATCH] chore!: remove moltbot legacy state/config support --- CHANGELOG.md | 4 ++++ docs/concepts/memory.md | 4 ---- src/commands/doctor-config-flow.ts | 1 - ...tform-notes.launchctl-env-overrides.e2e.test.ts | 2 +- src/commands/doctor-platform-notes.ts | 7 +------ src/commands/doctor-state-migrations.e2e.test.ts | 14 +++++++------- src/config/paths.test.ts | 7 ------- src/config/paths.ts | 4 ++-- 8 files changed, 15 insertions(+), 28 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index fcb9ef872..acc8a7878 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -14,6 +14,10 @@ Docs: https://docs.openclaw.ai - Agents: add pre-prompt context diagnostics (`messages`, `systemPromptChars`, `promptChars`, provider/model, session file) before embedded runner prompt calls to improve overflow debugging. (#8930) Thanks @Glucksberg. - Onboarding/Providers: add first-class Hugging Face Inference provider support (provider wiring, onboarding auth choice/API key flow, and default-model selection), and preserve Hugging Face auth intent in auth-choice remapping (`tokenProvider=huggingface` with `authChoice=apiKey`) while skipping env-override prompts when an explicit token is provided. (#13472) Thanks @Josephrp. +### Breaking + +- Config/State: removed legacy `.moltbot` auto-detection/migration and `moltbot.json` config candidates. If you still have state/config under `~/.moltbot`, move it to `~/.openclaw` (recommended) or set `OPENCLAW_STATE_DIR` / `OPENCLAW_CONFIG_PATH` explicitly. + ### Fixes - Gateway/Auth: add trusted-proxy mode hardening follow-ups by keeping `OPENCLAW_GATEWAY_*` env compatibility, auto-normalizing invalid setup combinations in interactive `gateway configure` (trusted-proxy forces `bind=lan` and disables Tailscale serve/funnel), and suppressing shared-secret/rate-limit audit findings that do not apply to trusted-proxy deployments. (#15940) Thanks @nickytonline. diff --git a/docs/concepts/memory.md b/docs/concepts/memory.md index 616a24df3..70da3e24d 100644 --- a/docs/concepts/memory.md +++ b/docs/concepts/memory.md @@ -159,10 +159,6 @@ out to QMD for retrieval. Key points: ```bash # Pick the same state dir OpenClaw uses STATE_DIR="${OPENCLAW_STATE_DIR:-$HOME/.openclaw}" - if [ -d "$HOME/.moltbot" ] && [ ! -d "$HOME/.openclaw" ] \ - && [ -z "${OPENCLAW_STATE_DIR:-}" ]; then - STATE_DIR="$HOME/.moltbot" - fi export XDG_CONFIG_HOME="$STATE_DIR/agents/main/qmd/xdg-config" export XDG_CACHE_HOME="$STATE_DIR/agents/main/qmd/xdg-cache" diff --git a/src/commands/doctor-config-flow.ts b/src/commands/doctor-config-flow.ts index da60c2974..6f59e9906 100644 --- a/src/commands/doctor-config-flow.ts +++ b/src/commands/doctor-config-flow.ts @@ -160,7 +160,6 @@ async function maybeMigrateLegacyConfig(): Promise { const legacyCandidates = [ path.join(home, ".clawdbot", "clawdbot.json"), - path.join(home, ".moltbot", "moltbot.json"), path.join(home, ".moldbot", "moldbot.json"), ]; diff --git a/src/commands/doctor-platform-notes.launchctl-env-overrides.e2e.test.ts b/src/commands/doctor-platform-notes.launchctl-env-overrides.e2e.test.ts index e88aff775..706b62826 100644 --- a/src/commands/doctor-platform-notes.launchctl-env-overrides.e2e.test.ts +++ b/src/commands/doctor-platform-notes.launchctl-env-overrides.e2e.test.ts @@ -19,7 +19,7 @@ describe("noteMacLaunchctlGatewayEnvOverrides", () => { await noteMacLaunchctlGatewayEnvOverrides(cfg, { platform: "darwin", getenv, noteFn }); expect(noteFn).toHaveBeenCalledTimes(1); - expect(getenv).toHaveBeenCalledTimes(6); + expect(getenv).toHaveBeenCalledTimes(4); const [message, title] = noteFn.mock.calls[0] ?? []; expect(title).toBe("Gateway (macOS)"); diff --git a/src/commands/doctor-platform-notes.ts b/src/commands/doctor-platform-notes.ts index 8bfe94f8f..ebe1a93e2 100644 --- a/src/commands/doctor-platform-notes.ts +++ b/src/commands/doctor-platform-notes.ts @@ -73,8 +73,6 @@ export async function noteMacLaunchctlGatewayEnvOverrides( const getenv = deps?.getenv ?? launchctlGetenv; const deprecatedLaunchctlEntries = [ - ["MOLTBOT_GATEWAY_TOKEN", await getenv("MOLTBOT_GATEWAY_TOKEN")], - ["MOLTBOT_GATEWAY_PASSWORD", await getenv("MOLTBOT_GATEWAY_PASSWORD")], ["CLAWDBOT_GATEWAY_TOKEN", await getenv("CLAWDBOT_GATEWAY_TOKEN")], ["CLAWDBOT_GATEWAY_PASSWORD", await getenv("CLAWDBOT_GATEWAY_PASSWORD")], ].filter((entry): entry is [string, string] => Boolean(entry[1]?.trim())); @@ -126,10 +124,7 @@ export function noteDeprecatedLegacyEnvVars( deps?: { noteFn?: typeof note }, ) { const entries = Object.entries(env) - .filter( - ([key, value]) => - (key.startsWith("MOLTBOT_") || key.startsWith("CLAWDBOT_")) && value?.trim(), - ) + .filter(([key, value]) => key.startsWith("CLAWDBOT_") && value?.trim()) .map(([key]) => key); if (entries.length === 0) { return; diff --git a/src/commands/doctor-state-migrations.e2e.test.ts b/src/commands/doctor-state-migrations.e2e.test.ts index 6ecec28a1..ce8474f54 100644 --- a/src/commands/doctor-state-migrations.e2e.test.ts +++ b/src/commands/doctor-state-migrations.e2e.test.ts @@ -356,7 +356,7 @@ describe("doctor legacy state migrations", () => { it("does not warn when legacy state dir is an already-migrated symlink mirror", async () => { const root = await makeTempRoot(); const targetDir = path.join(root, ".openclaw"); - const legacyDir = path.join(root, ".moltbot"); + const legacyDir = path.join(root, ".clawdbot"); fs.mkdirSync(path.join(targetDir, "sessions"), { recursive: true }); fs.mkdirSync(path.join(targetDir, "agent"), { recursive: true }); fs.mkdirSync(legacyDir, { recursive: true }); @@ -377,7 +377,7 @@ describe("doctor legacy state migrations", () => { it("warns when legacy state dir is empty and target already exists", async () => { const root = await makeTempRoot(); const targetDir = path.join(root, ".openclaw"); - const legacyDir = path.join(root, ".moltbot"); + const legacyDir = path.join(root, ".clawdbot"); fs.mkdirSync(targetDir, { recursive: true }); fs.mkdirSync(legacyDir, { recursive: true }); @@ -395,7 +395,7 @@ describe("doctor legacy state migrations", () => { it("warns when legacy state dir contains non-symlink entries and target already exists", async () => { const root = await makeTempRoot(); const targetDir = path.join(root, ".openclaw"); - const legacyDir = path.join(root, ".moltbot"); + const legacyDir = path.join(root, ".clawdbot"); fs.mkdirSync(targetDir, { recursive: true }); fs.mkdirSync(legacyDir, { recursive: true }); fs.writeFileSync(path.join(legacyDir, "sessions.json"), "{}", "utf-8"); @@ -414,7 +414,7 @@ describe("doctor legacy state migrations", () => { it("does not warn when legacy state dir contains nested symlink mirrors", async () => { const root = await makeTempRoot(); const targetDir = path.join(root, ".openclaw"); - const legacyDir = path.join(root, ".moltbot"); + const legacyDir = path.join(root, ".clawdbot"); fs.mkdirSync(path.join(targetDir, "agents", "main"), { recursive: true }); fs.mkdirSync(legacyDir, { recursive: true }); fs.mkdirSync(path.join(legacyDir, "agents"), { recursive: true }); @@ -438,7 +438,7 @@ describe("doctor legacy state migrations", () => { it("warns when legacy state dir symlink points outside the target tree", async () => { const root = await makeTempRoot(); const targetDir = path.join(root, ".openclaw"); - const legacyDir = path.join(root, ".moltbot"); + const legacyDir = path.join(root, ".clawdbot"); const outsideDir = path.join(root, ".outside-state"); fs.mkdirSync(path.join(targetDir, "sessions"), { recursive: true }); fs.mkdirSync(legacyDir, { recursive: true }); @@ -461,7 +461,7 @@ describe("doctor legacy state migrations", () => { it("warns when legacy state dir contains a broken symlink target", async () => { const root = await makeTempRoot(); const targetDir = path.join(root, ".openclaw"); - const legacyDir = path.join(root, ".moltbot"); + const legacyDir = path.join(root, ".clawdbot"); fs.mkdirSync(path.join(targetDir, "sessions"), { recursive: true }); fs.mkdirSync(legacyDir, { recursive: true }); @@ -484,7 +484,7 @@ describe("doctor legacy state migrations", () => { it("warns when legacy symlink escapes target tree through second-hop symlink", async () => { const root = await makeTempRoot(); const targetDir = path.join(root, ".openclaw"); - const legacyDir = path.join(root, ".moltbot"); + const legacyDir = path.join(root, ".clawdbot"); const outsideDir = path.join(root, ".outside-state"); fs.mkdirSync(targetDir, { recursive: true }); fs.mkdirSync(legacyDir, { recursive: true }); diff --git a/src/config/paths.test.ts b/src/config/paths.test.ts index 5e49ff6b4..cc764039a 100644 --- a/src/config/paths.test.ts +++ b/src/config/paths.test.ts @@ -77,19 +77,12 @@ describe("state + config path candidates", () => { const expected = [ path.join(resolvedHome, ".openclaw", "openclaw.json"), path.join(resolvedHome, ".openclaw", "clawdbot.json"), - path.join(resolvedHome, ".openclaw", "moltbot.json"), path.join(resolvedHome, ".openclaw", "moldbot.json"), path.join(resolvedHome, ".clawdbot", "openclaw.json"), path.join(resolvedHome, ".clawdbot", "clawdbot.json"), - path.join(resolvedHome, ".clawdbot", "moltbot.json"), path.join(resolvedHome, ".clawdbot", "moldbot.json"), - path.join(resolvedHome, ".moltbot", "openclaw.json"), - path.join(resolvedHome, ".moltbot", "clawdbot.json"), - path.join(resolvedHome, ".moltbot", "moltbot.json"), - path.join(resolvedHome, ".moltbot", "moldbot.json"), path.join(resolvedHome, ".moldbot", "openclaw.json"), path.join(resolvedHome, ".moldbot", "clawdbot.json"), - path.join(resolvedHome, ".moldbot", "moltbot.json"), path.join(resolvedHome, ".moldbot", "moldbot.json"), ]; expect(candidates).toEqual(expected); diff --git a/src/config/paths.ts b/src/config/paths.ts index 8b788b114..6e9a35597 100644 --- a/src/config/paths.ts +++ b/src/config/paths.ts @@ -17,10 +17,10 @@ export function resolveIsNixMode(env: NodeJS.ProcessEnv = process.env): boolean export const isNixMode = resolveIsNixMode(); -const LEGACY_STATE_DIRNAMES = [".clawdbot", ".moltbot", ".moldbot"] as const; +const LEGACY_STATE_DIRNAMES = [".clawdbot", ".moldbot"] as const; const NEW_STATE_DIRNAME = ".openclaw"; const CONFIG_FILENAME = "openclaw.json"; -const LEGACY_CONFIG_FILENAMES = ["clawdbot.json", "moltbot.json", "moldbot.json"] as const; +const LEGACY_CONFIG_FILENAMES = ["clawdbot.json", "moldbot.json"] as const; function resolveDefaultHomeDir(): string { return resolveRequiredHomeDir(process.env, os.homedir);