import { execFile } from "node:child_process"; import fs from "node:fs"; import os from "node:os"; import path from "node:path"; import { promisify } from "node:util"; import type { OpenClawConfig } from "../config/types.openclaw.js"; import { hasConfiguredSecretInput } from "../config/types.secrets.js"; import { normalizeOptionalString } from "../shared/string-coerce.js"; import { note } from "../terminal/note.js"; import { shortenHomePath } from "../utils.js";
const execFileAsync = promisify(execFile);
function resolveHomeDir(): string { return process.env.HOME ?? os.homedir();
}
export async function noteMacLaunchAgentOverrides() { if (process.platform !== "darwin") { return;
} const home = resolveHomeDir(); const markerCandidates = [path.join(home, ".openclaw", "disable-launchagent")]; const markerPath = markerCandidates.find((candidate) => fs.existsSync(candidate)); if (!markerPath) { return;
}
const displayMarkerPath = shortenHomePath(markerPath); const lines = [
`- LaunchAgent writes are disabled via ${displayMarkerPath}.`, "- To restore default behavior:",
` rm ${displayMarkerPath}`,
].filter((line): line is string => Boolean(line));
note(lines.join("\n"), "Gateway (macOS)");
}
if (!compileCache) {
lines.push( "- NODE_COMPILE_CACHE is not set; repeated CLI runs can be slower on small hosts (Pi/VM).",
);
} elseif (isTmpCompileCachePath(compileCache)) {
lines.push( "- NODE_COMPILE_CACHE points to /tmp; use /var/tmp so cache survives reboots and warms startup reliably.",
);
}
if (isTruthyEnvValue(disableCompileCache)) {
lines.push("- NODE_DISABLE_COMPILE_CACHE is set; startup compile cache is disabled.");
}
if (noRespawn !== "1") {
lines.push( "- OPENCLAW_NO_RESPAWN is not set to 1; set it to avoid extra startup overhead from self-respawn.",
);
}
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.