fix: support moltbot legacy state dir

This commit is contained in:
Peter Steinberger
2026-02-14 17:14:15 +00:00
parent dee3abfcd5
commit 571c195c54
4 changed files with 63 additions and 2 deletions

View File

@@ -17,10 +17,11 @@ export function resolveIsNixMode(env: NodeJS.ProcessEnv = process.env): boolean
export const isNixMode = resolveIsNixMode();
const LEGACY_STATE_DIRNAMES = [".clawdbot", ".moldbot"] as const;
// Support historical (and occasionally misspelled) legacy state dirs.
const LEGACY_STATE_DIRNAMES = [".clawdbot", ".moldbot", ".moltbot"] as const;
const NEW_STATE_DIRNAME = ".openclaw";
const CONFIG_FILENAME = "openclaw.json";
const LEGACY_CONFIG_FILENAMES = ["clawdbot.json", "moldbot.json"] as const;
const LEGACY_CONFIG_FILENAMES = ["clawdbot.json", "moldbot.json", "moltbot.json"] as const;
function resolveDefaultHomeDir(): string {
return resolveRequiredHomeDir(process.env, os.homedir);