refactor(config): drop obsolete legacy config aliases

This commit is contained in:
Peter Steinberger
2026-03-29 22:00:38 +01:00
parent d9274444b7
commit 63e5c3349e
12 changed files with 40 additions and 22 deletions

View File

@@ -14,6 +14,7 @@ Docs: https://docs.openclaw.ai
### Fixes
- Config/legacy cleanup: stop probing obsolete alternate legacy config names and service labels during local config/service detection, while keeping the active `~/.openclaw/openclaw.json` path canonical.
- ACP/sessions_spawn: register ACP child runs for completion tracking and lifecycle cleanup, and make registration-failure cleanup explicitly best-effort so callers do not assume an already-started ACP turn was fully aborted. (#40885) Thanks @xaeon2026 and @vincentkoc.
- ACPX/runtime: derive the bundled ACPX expected version from the extension package metadata instead of hardcoding a separate literal, so plugin-local ACPX installs stop drifting out of health-check parity after version bumps. (#49089) Thanks @jiejiesks and @vincentkoc.
- Gateway/auth: make local-direct `trusted-proxy` fallback require the configured shared token instead of silently authenticating same-host callers, while keeping same-host reverse proxy identity-header flows on the normal trusted-proxy path. Thanks @zhangning-agent and @vincentkoc.

View File

@@ -0,0 +1,23 @@
---
title: "Legacy Config Cleanup"
summary: "Remove stale alternate config references, delete obsolete compatibility paths, and rename leftover legacy runtime/test identifiers"
author: "Peter Steinberger <steipete@gmail.com>"
github_username: "steipete"
created: "2026-03-29"
status: "in_progress"
read_when:
- "Cleaning up legacy config path handling or old rebrand compatibility shims"
---
Context:
- A stale alternate config file in `~/.openclaw/` was unused.
- Active config resolution already prefers `~/.openclaw/openclaw.json`.
- Remaining legacy references were split across config-path compat, installer probes, legacy service detection, and test/runtime labels.
Plan:
- Delete the stale local alternate config.
- Remove obsolete config/state-dir compatibility from path resolution and doctor preflight.
- Drop old legacy gateway service detection and prompts.
- Rename leftover runtime/test strings to `openclaw` or generic legacy wording.

View File

@@ -2074,7 +2074,7 @@ run_bootstrap_onboarding_if_needed() {
fi
local config_path="${OPENCLAW_CONFIG_PATH:-$HOME/.openclaw/openclaw.json}"
if [[ -f "${config_path}" || -f "$HOME/.clawdbot/clawdbot.json" || -f "$HOME/.moltbot/moltbot.json" || -f "$HOME/.moldbot/moldbot.json" ]]; then
if [[ -f "${config_path}" || -f "$HOME/.clawdbot/clawdbot.json" ]]; then
return
fi
@@ -2492,7 +2492,7 @@ main() {
ui_info "Skipping onboard (requested); run openclaw onboard later"
else
local config_path="${OPENCLAW_CONFIG_PATH:-$HOME/.openclaw/openclaw.json}"
if [[ -f "${config_path}" || -f "$HOME/.clawdbot/clawdbot.json" || -f "$HOME/.moltbot/moltbot.json" || -f "$HOME/.moldbot/moldbot.json" ]]; then
if [[ -f "${config_path}" || -f "$HOME/.clawdbot/clawdbot.json" ]]; then
ui_info "Config already present; running doctor"
run_doctor
should_open_dashboard=true

View File

@@ -84,7 +84,7 @@ export function runDockerSandboxShellCommand(
"sh",
"-c",
params.script,
"moltbot-sandbox-fs",
"openclaw-sandbox-fs",
];
if (params.args?.length) {
dockerArgs.push(...params.args);

View File

@@ -23,10 +23,7 @@ async function maybeMigrateLegacyConfig(): Promise<string[]> {
// missing config
}
const legacyCandidates = [
path.join(home, ".clawdbot", "clawdbot.json"),
path.join(home, ".moldbot", "moldbot.json"),
];
const legacyCandidates = [path.join(home, ".clawdbot", "clawdbot.json")];
let legacyPath: string | null = null;
for (const candidate of legacyCandidates) {

View File

@@ -411,7 +411,7 @@ export async function maybeScanExtraGatewayServices(
const legacyServices = extraServices.filter((svc) => svc.legacy === true);
if (legacyServices.length > 0) {
const shouldRemove = await prompter.confirmRuntimeRepair({
message: "Remove legacy gateway services (clawdbot/moltbot) now?",
message: "Remove legacy gateway services now?",
initialValue: true,
});
if (shouldRemove) {

View File

@@ -17,11 +17,11 @@ export function resolveIsNixMode(env: NodeJS.ProcessEnv = process.env): boolean
export const isNixMode = resolveIsNixMode();
// Support historical (and occasionally misspelled) legacy state dirs.
const LEGACY_STATE_DIRNAMES = [".clawdbot", ".moldbot"] as const;
// Support the remaining legacy pre-rebrand state dir.
const LEGACY_STATE_DIRNAMES = [".clawdbot"] 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"] as const;
function resolveDefaultHomeDir(): string {
return resolveRequiredHomeDir(process.env, os.homedir);

View File

@@ -11,10 +11,7 @@ export const NODE_SERVICE_MARKER = "openclaw";
export const NODE_SERVICE_KIND = "node";
export const NODE_WINDOWS_TASK_SCRIPT_NAME = "node.cmd";
export const LEGACY_GATEWAY_LAUNCH_AGENT_LABELS: string[] = [];
export const LEGACY_GATEWAY_SYSTEMD_SERVICE_NAMES: string[] = [
"clawdbot-gateway",
"moltbot-gateway",
];
export const LEGACY_GATEWAY_SYSTEMD_SERVICE_NAMES: string[] = ["clawdbot-gateway"];
export const LEGACY_GATEWAY_WINDOWS_TASK_NAMES: string[] = [];
export function normalizeGatewayProfile(profile?: string): string | null {

View File

@@ -15,7 +15,7 @@ export type ExtraGatewayService = {
label: string;
detail: string;
scope: "user" | "system";
marker?: "openclaw" | "clawdbot" | "moltbot";
marker?: "openclaw" | "clawdbot";
legacy?: boolean;
};
@@ -23,7 +23,7 @@ export type FindExtraGatewayServicesOptions = {
deep?: boolean;
};
const EXTRA_MARKERS = ["openclaw", "clawdbot", "moltbot"] as const;
const EXTRA_MARKERS = ["openclaw", "clawdbot"] as const;
export function renderGatewayServiceCleanupHints(
env: Record<string, string | undefined> = process.env as Record<string, string | undefined>,
@@ -142,7 +142,7 @@ function isIgnoredSystemdName(name: string): boolean {
function isLegacyLabel(label: string): boolean {
const lower = label.toLowerCase();
return lower.includes("clawdbot") || lower.includes("moltbot");
return lower.includes("clawdbot");
}
async function readDirEntries(dir: string): Promise<string[]> {
@@ -217,7 +217,7 @@ async function scanLaunchdDir(params: {
label,
detail: `plist: ${fullPath}`,
scope: params.scope,
marker: isLegacyLabel(label) ? "clawdbot" : "moltbot",
marker: "clawdbot",
legacy: true,
});
continue;

View File

@@ -36,7 +36,7 @@ export interface TimestampInjectionOptions {
* these handlers, so there is no double-stamping risk. The detection
* pattern is a safety net for edge cases.
*
* @see https://github.com/moltbot/moltbot/issues/3658
* @see https://github.com/openclaw/openclaw/issues/3658
*/
export function injectTimestamp(message: string, opts?: TimestampInjectionOptions): string {
if (!message.trim()) {

View File

@@ -481,7 +481,7 @@ export const agentHandlers: GatewayRequestHandlers = {
// Inject timestamp into user-authored messages that don't already have one.
// Channel messages (Discord, Telegram, etc.) get timestamps via envelope
// formatting in a separate code path — they never reach this handler.
// See: https://github.com/moltbot/moltbot/issues/3658
// See: https://github.com/openclaw/openclaw/issues/3658
if (!skipTimestampInjection) {
message = injectTimestamp(message, timestampOptsFromConfig(cfg));
}

View File

@@ -1509,7 +1509,7 @@ export const chatHandlers: GatewayRequestHandlers = {
});
// Inject timestamp so agents know the current date/time.
// Only BodyForAgent gets the timestamp — Body stays raw for UI display.
// See: https://github.com/moltbot/moltbot/issues/3658
// See: https://github.com/openclaw/openclaw/issues/3658
const stampedMessage = injectTimestamp(messageForAgent, timestampOptsFromConfig(cfg));
const ctx: MsgContext = {