mirror of
https://github.com/farcasclaudiu/openclaw.git
synced 2026-06-28 17:01:53 +03:00
chore!: remove moltbot legacy state/config support
This commit is contained in:
@@ -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.
|
- 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.
|
- 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
|
### 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.
|
- 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.
|
||||||
|
|||||||
@@ -159,10 +159,6 @@ out to QMD for retrieval. Key points:
|
|||||||
```bash
|
```bash
|
||||||
# Pick the same state dir OpenClaw uses
|
# Pick the same state dir OpenClaw uses
|
||||||
STATE_DIR="${OPENCLAW_STATE_DIR:-$HOME/.openclaw}"
|
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_CONFIG_HOME="$STATE_DIR/agents/main/qmd/xdg-config"
|
||||||
export XDG_CACHE_HOME="$STATE_DIR/agents/main/qmd/xdg-cache"
|
export XDG_CACHE_HOME="$STATE_DIR/agents/main/qmd/xdg-cache"
|
||||||
|
|||||||
@@ -160,7 +160,6 @@ async function maybeMigrateLegacyConfig(): Promise<string[]> {
|
|||||||
|
|
||||||
const legacyCandidates = [
|
const legacyCandidates = [
|
||||||
path.join(home, ".clawdbot", "clawdbot.json"),
|
path.join(home, ".clawdbot", "clawdbot.json"),
|
||||||
path.join(home, ".moltbot", "moltbot.json"),
|
|
||||||
path.join(home, ".moldbot", "moldbot.json"),
|
path.join(home, ".moldbot", "moldbot.json"),
|
||||||
];
|
];
|
||||||
|
|
||||||
|
|||||||
@@ -19,7 +19,7 @@ describe("noteMacLaunchctlGatewayEnvOverrides", () => {
|
|||||||
await noteMacLaunchctlGatewayEnvOverrides(cfg, { platform: "darwin", getenv, noteFn });
|
await noteMacLaunchctlGatewayEnvOverrides(cfg, { platform: "darwin", getenv, noteFn });
|
||||||
|
|
||||||
expect(noteFn).toHaveBeenCalledTimes(1);
|
expect(noteFn).toHaveBeenCalledTimes(1);
|
||||||
expect(getenv).toHaveBeenCalledTimes(6);
|
expect(getenv).toHaveBeenCalledTimes(4);
|
||||||
|
|
||||||
const [message, title] = noteFn.mock.calls[0] ?? [];
|
const [message, title] = noteFn.mock.calls[0] ?? [];
|
||||||
expect(title).toBe("Gateway (macOS)");
|
expect(title).toBe("Gateway (macOS)");
|
||||||
|
|||||||
@@ -73,8 +73,6 @@ export async function noteMacLaunchctlGatewayEnvOverrides(
|
|||||||
|
|
||||||
const getenv = deps?.getenv ?? launchctlGetenv;
|
const getenv = deps?.getenv ?? launchctlGetenv;
|
||||||
const deprecatedLaunchctlEntries = [
|
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_TOKEN", await getenv("CLAWDBOT_GATEWAY_TOKEN")],
|
||||||
["CLAWDBOT_GATEWAY_PASSWORD", await getenv("CLAWDBOT_GATEWAY_PASSWORD")],
|
["CLAWDBOT_GATEWAY_PASSWORD", await getenv("CLAWDBOT_GATEWAY_PASSWORD")],
|
||||||
].filter((entry): entry is [string, string] => Boolean(entry[1]?.trim()));
|
].filter((entry): entry is [string, string] => Boolean(entry[1]?.trim()));
|
||||||
@@ -126,10 +124,7 @@ export function noteDeprecatedLegacyEnvVars(
|
|||||||
deps?: { noteFn?: typeof note },
|
deps?: { noteFn?: typeof note },
|
||||||
) {
|
) {
|
||||||
const entries = Object.entries(env)
|
const entries = Object.entries(env)
|
||||||
.filter(
|
.filter(([key, value]) => key.startsWith("CLAWDBOT_") && value?.trim())
|
||||||
([key, value]) =>
|
|
||||||
(key.startsWith("MOLTBOT_") || key.startsWith("CLAWDBOT_")) && value?.trim(),
|
|
||||||
)
|
|
||||||
.map(([key]) => key);
|
.map(([key]) => key);
|
||||||
if (entries.length === 0) {
|
if (entries.length === 0) {
|
||||||
return;
|
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 () => {
|
it("does not warn when legacy state dir is an already-migrated symlink mirror", async () => {
|
||||||
const root = await makeTempRoot();
|
const root = await makeTempRoot();
|
||||||
const targetDir = path.join(root, ".openclaw");
|
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, "sessions"), { recursive: true });
|
||||||
fs.mkdirSync(path.join(targetDir, "agent"), { recursive: true });
|
fs.mkdirSync(path.join(targetDir, "agent"), { recursive: true });
|
||||||
fs.mkdirSync(legacyDir, { 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 () => {
|
it("warns when legacy state dir is empty and target already exists", async () => {
|
||||||
const root = await makeTempRoot();
|
const root = await makeTempRoot();
|
||||||
const targetDir = path.join(root, ".openclaw");
|
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(targetDir, { recursive: true });
|
||||||
fs.mkdirSync(legacyDir, { 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 () => {
|
it("warns when legacy state dir contains non-symlink entries and target already exists", async () => {
|
||||||
const root = await makeTempRoot();
|
const root = await makeTempRoot();
|
||||||
const targetDir = path.join(root, ".openclaw");
|
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(targetDir, { recursive: true });
|
||||||
fs.mkdirSync(legacyDir, { recursive: true });
|
fs.mkdirSync(legacyDir, { recursive: true });
|
||||||
fs.writeFileSync(path.join(legacyDir, "sessions.json"), "{}", "utf-8");
|
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 () => {
|
it("does not warn when legacy state dir contains nested symlink mirrors", async () => {
|
||||||
const root = await makeTempRoot();
|
const root = await makeTempRoot();
|
||||||
const targetDir = path.join(root, ".openclaw");
|
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(path.join(targetDir, "agents", "main"), { recursive: true });
|
||||||
fs.mkdirSync(legacyDir, { recursive: true });
|
fs.mkdirSync(legacyDir, { recursive: true });
|
||||||
fs.mkdirSync(path.join(legacyDir, "agents"), { 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 () => {
|
it("warns when legacy state dir symlink points outside the target tree", async () => {
|
||||||
const root = await makeTempRoot();
|
const root = await makeTempRoot();
|
||||||
const targetDir = path.join(root, ".openclaw");
|
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");
|
const outsideDir = path.join(root, ".outside-state");
|
||||||
fs.mkdirSync(path.join(targetDir, "sessions"), { recursive: true });
|
fs.mkdirSync(path.join(targetDir, "sessions"), { recursive: true });
|
||||||
fs.mkdirSync(legacyDir, { 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 () => {
|
it("warns when legacy state dir contains a broken symlink target", async () => {
|
||||||
const root = await makeTempRoot();
|
const root = await makeTempRoot();
|
||||||
const targetDir = path.join(root, ".openclaw");
|
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, "sessions"), { recursive: true });
|
||||||
fs.mkdirSync(legacyDir, { 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 () => {
|
it("warns when legacy symlink escapes target tree through second-hop symlink", async () => {
|
||||||
const root = await makeTempRoot();
|
const root = await makeTempRoot();
|
||||||
const targetDir = path.join(root, ".openclaw");
|
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");
|
const outsideDir = path.join(root, ".outside-state");
|
||||||
fs.mkdirSync(targetDir, { recursive: true });
|
fs.mkdirSync(targetDir, { recursive: true });
|
||||||
fs.mkdirSync(legacyDir, { recursive: true });
|
fs.mkdirSync(legacyDir, { recursive: true });
|
||||||
|
|||||||
@@ -77,19 +77,12 @@ describe("state + config path candidates", () => {
|
|||||||
const expected = [
|
const expected = [
|
||||||
path.join(resolvedHome, ".openclaw", "openclaw.json"),
|
path.join(resolvedHome, ".openclaw", "openclaw.json"),
|
||||||
path.join(resolvedHome, ".openclaw", "clawdbot.json"),
|
path.join(resolvedHome, ".openclaw", "clawdbot.json"),
|
||||||
path.join(resolvedHome, ".openclaw", "moltbot.json"),
|
|
||||||
path.join(resolvedHome, ".openclaw", "moldbot.json"),
|
path.join(resolvedHome, ".openclaw", "moldbot.json"),
|
||||||
path.join(resolvedHome, ".clawdbot", "openclaw.json"),
|
path.join(resolvedHome, ".clawdbot", "openclaw.json"),
|
||||||
path.join(resolvedHome, ".clawdbot", "clawdbot.json"),
|
path.join(resolvedHome, ".clawdbot", "clawdbot.json"),
|
||||||
path.join(resolvedHome, ".clawdbot", "moltbot.json"),
|
|
||||||
path.join(resolvedHome, ".clawdbot", "moldbot.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", "openclaw.json"),
|
||||||
path.join(resolvedHome, ".moldbot", "clawdbot.json"),
|
path.join(resolvedHome, ".moldbot", "clawdbot.json"),
|
||||||
path.join(resolvedHome, ".moldbot", "moltbot.json"),
|
|
||||||
path.join(resolvedHome, ".moldbot", "moldbot.json"),
|
path.join(resolvedHome, ".moldbot", "moldbot.json"),
|
||||||
];
|
];
|
||||||
expect(candidates).toEqual(expected);
|
expect(candidates).toEqual(expected);
|
||||||
|
|||||||
+2
-2
@@ -17,10 +17,10 @@ export function resolveIsNixMode(env: NodeJS.ProcessEnv = process.env): boolean
|
|||||||
|
|
||||||
export const isNixMode = resolveIsNixMode();
|
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 NEW_STATE_DIRNAME = ".openclaw";
|
||||||
const CONFIG_FILENAME = "openclaw.json";
|
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 {
|
function resolveDefaultHomeDir(): string {
|
||||||
return resolveRequiredHomeDir(process.env, os.homedir);
|
return resolveRequiredHomeDir(process.env, os.homedir);
|
||||||
|
|||||||
Reference in New Issue
Block a user