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

@@ -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 = {