mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-09 02:08:27 +00:00
chore!: remove moltbot legacy state/config support
This commit is contained in:
@@ -160,7 +160,6 @@ async function maybeMigrateLegacyConfig(): Promise<string[]> {
|
||||
|
||||
const legacyCandidates = [
|
||||
path.join(home, ".clawdbot", "clawdbot.json"),
|
||||
path.join(home, ".moltbot", "moltbot.json"),
|
||||
path.join(home, ".moldbot", "moldbot.json"),
|
||||
];
|
||||
|
||||
|
||||
@@ -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)");
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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 });
|
||||
|
||||
Reference in New Issue
Block a user