






















@@ -7,6 +7,7 @@ import type { OpenClawConfig } from "../config/types.openclaw.js";
77import { runCommandWithTimeout } from "../process/exec.js";
88import { normalizeLowercaseStringOrEmpty } from "../shared/string-coerce.js";
99import { VERSION } from "../version.js";
10+import { isTruthyEnvValue } from "./env.js";
1011import { writeJsonAtomic } from "./json-files.js";
1112import { resolveOpenClawPackageRoot } from "./openclaw-root.js";
1213import { normalizeUpdateChannel, DEFAULT_PACKAGE_CHANNEL } from "./update-channels.js";
@@ -317,8 +318,10 @@ export async function runGatewayUpdateCheck(params: {
317318return;
318319}
319320const auto = resolveAutoUpdatePolicy(params.cfg);
321+const autoDisabledByEnv = isTruthyEnvValue(process.env.OPENCLAW_NO_AUTO_UPDATE);
322+const shouldRunAutoUpdate = auto.enabled && !autoDisabledByEnv;
320323const shouldRunUpdateHints = params.cfg.update?.checkOnStart !== false;
321-if (!shouldRunUpdateHints && !auto.enabled) {
324+if (!shouldRunUpdateHints && !shouldRunAutoUpdate) {
322325return;
323326}
324327@@ -338,7 +341,9 @@ export async function runGatewayUpdateCheck(params: {
338341onUpdateAvailableChange: params.onUpdateAvailableChange,
339342});
340343}
341-const checkIntervalMs = resolveCheckIntervalMs(params.cfg);
344+const checkIntervalMs = shouldRunAutoUpdate
345+ ? resolveCheckIntervalMs(params.cfg)
346+ : UPDATE_CHECK_INTERVAL_MS;
342347if (lastCheckedAt && Number.isFinite(lastCheckedAt)) {
343348if (now - lastCheckedAt < checkIntervalMs) {
344349return;
@@ -407,7 +412,14 @@ export async function runGatewayUpdateCheck(params: {
407412nextState.lastNotifiedTag = tag;
408413}
409414410-if (auto.enabled && (channel === "stable" || channel === "beta")) {
415+if (auto.enabled && autoDisabledByEnv) {
416+params.log.info("auto-update disabled by OPENCLAW_NO_AUTO_UPDATE", {
417+version: resolved.version,
418+ tag,
419+});
420+}
421+422+if (shouldRunAutoUpdate && (channel === "stable" || channel === "beta")) {
411423const runAuto = params.runAutoUpdate ?? runAutoUpdateCommand;
412424const attemptIntervalMs =
413425channel === "beta"
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。