惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

V
Visual Studio Blog
J
Java Code Geeks
H
Hackread – Cybersecurity News, Data Breaches, AI and More
D
Docker
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
博客园 - 聂微东
MyScale Blog
MyScale Blog
H
Help Net Security
Last Week in AI
Last Week in AI
T
The Blog of Author Tim Ferriss
M
MIT News - Artificial intelligence
大猫的无限游戏
大猫的无限游戏
酷 壳 – CoolShell
酷 壳 – CoolShell
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
P
Proofpoint News Feed
博客园 - 叶小钗
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
Y
Y Combinator Blog
Recent Announcements
Recent Announcements
F
Fortinet All Blogs
Martin Fowler
Martin Fowler
Microsoft Security Blog
Microsoft Security Blog
T
Tailwind CSS Blog
aimingoo的专栏
aimingoo的专栏

Recent Commits to openclaw:main

test: merge chat side-result checks · openclaw/openclaw@ddd2c2a test: merge cron history checks · openclaw/openclaw@f7eb746 test: merge responsive navigation shell checks · openclaw/openclaw@c2e4b47 docs(changelog): add codex oauth fixes · openclaw/openclaw@628e6cd test: merge navigation routing cases · openclaw/openclaw@5d8cecb Tests: mock channel registry bundled fallback · openclaw/openclaw@2b08233 Secrets: avoid broad web search discovery for single plugin config · openclaw/openclaw@a464f59 test: merge config view browser checks · openclaw/openclaw@20cf511 fix(status): align oauth health with runtime · openclaw/openclaw@eed7116 feat: add macOS screen snapshots for monitor preview (#67954) thanks … · openclaw/openclaw@f377db1 fix: report shared auth scopes in hello-ok (#67810) thanks @BunsDev · openclaw/openclaw@0b6c39b Auto-reply: avoid eager bundled route fallback · openclaw/openclaw@3ea1bf4 Tests: narrow session binding contract setup · openclaw/openclaw@54e4e16 fix(macOS): enable undo/redo in webchat composer text input (#34962) · openclaw/openclaw@00951dc Tests: speed up channel setup promotion · openclaw/openclaw@82b529a Docs: refresh agent instructions · openclaw/openclaw@5775fe2 fix(auth): serialize OAuth refresh across agents to fix #26322 (#67876) · openclaw/openclaw@8e79080 test: allow ollama public surface boundary test · openclaw/openclaw@7d4f1a6 Docs: add test performance guardrails · openclaw/openclaw@89706d3 Tests: restore context-engine usage proof · openclaw/openclaw@e4c4f95 Tests: slim context engine runtime coverage · openclaw/openclaw@74c198f ci: retry failed custom checkouts · openclaw/openclaw@0ee5baf test: trim duplicate provider auth onboarding cases · openclaw/openclaw@1ffc02e matrix: fix sessions_spawn --thread subagent session spawning (#67643) · openclaw/openclaw@1ce2596 test: reduce auth choice fixture churn · openclaw/openclaw@857b9cd test: mock health status config boundaries · openclaw/openclaw@9d5ab4a test: mock onboard config io boundary · openclaw/openclaw@299694d test: mock legacy state plugin boundaries · openclaw/openclaw@2713089 test: mock channel install boundaries · openclaw/openclaw@b945248 test: mock doctor preview channel boundaries · openclaw/openclaw@b1a3ad4
fix(cli): suppress self-update version warnings · opencla...
vincentkoc · 2026-05-25 · via Recent Commits to openclaw:main

@@ -13,6 +13,7 @@ UPDATE_BASELINE_VERSION="${OPENCLAW_INSTALL_UPDATE_BASELINE:-latest}"

1313

UPDATE_BASELINE_TAG_URL="${OPENCLAW_INSTALL_UPDATE_BASELINE_TAG_URL:-}"

1414

UPDATE_EXPECT_VERSION="${OPENCLAW_INSTALL_UPDATE_EXPECT_VERSION:-}"

1515

UPDATE_TAG_URL="${OPENCLAW_INSTALL_UPDATE_TAG_URL:-}"

16+

SELF_UPDATE_WARNING_FIXED_VERSION="${OPENCLAW_INSTALL_SELF_UPDATE_WARNING_FIXED_VERSION:-2026.5.25}"

1617

FRESHNESS_VERSION="${OPENCLAW_INSTALL_FRESHNESS_VERSION:-latest}"

1718

# npm min-release-age is days; 10000 keeps the control failure independent of normal release cadence.

1819

FRESHNESS_MIN_RELEASE_AGE="${OPENCLAW_INSTALL_FRESHNESS_MIN_RELEASE_AGE:-10000}"

@@ -120,6 +121,75 @@ is_self_swapped_package_process_exit() {

120121

[[ "$stderr" == *"/node_modules/openclaw/dist/"* ]]

121122

}

122123124+

is_version_before() {

125+

local candidate="$1"

126+

local floor="$2"

127+

node - "$candidate" "$floor" <<'NODE'

128+

const [, , candidate, floor] = process.argv;

129+

function parse(version) {

130+

const [core, prerelease = ""] = String(version).split("-", 2);

131+

return {

132+

core: core.split(".").map((part) => Number.parseInt(part, 10) || 0),

133+

prerelease: prerelease ? prerelease.split(".") : [],

134+

};

135+

}

136+

function comparePrerelease(left, right) {

137+

if (left.length === 0 && right.length === 0) {

138+

return 0;

139+

}

140+

if (left.length === 0) {

141+

return 1;

142+

}

143+

if (right.length === 0) {

144+

return -1;

145+

}

146+

for (let index = 0; index < Math.max(left.length, right.length); index += 1) {

147+

const l = left[index];

148+

const r = right[index];

149+

if (l === undefined) {

150+

return -1;

151+

}

152+

if (r === undefined) {

153+

return 1;

154+

}

155+

const ln = Number.parseInt(l, 10);

156+

const rn = Number.parseInt(r, 10);

157+

const lNumeric = String(ln) === l;

158+

const rNumeric = String(rn) === r;

159+

if (lNumeric && rNumeric && ln !== rn) {

160+

return ln < rn ? -1 : 1;

161+

}

162+

if (lNumeric !== rNumeric) {

163+

return lNumeric ? -1 : 1;

164+

}

165+

if (l !== r) {

166+

return l < r ? -1 : 1;

167+

}

168+

}

169+

return 0;

170+

}

171+

const left = parse(candidate);

172+

const right = parse(floor);

173+

for (let index = 0; index < Math.max(left.core.length, right.core.length); index += 1) {

174+

const l = left.core[index] ?? 0;

175+

const r = right.core[index] ?? 0;

176+

if (l < r) {

177+

process.exit(0);

178+

}

179+

if (l > r) {

180+

process.exit(1);

181+

}

182+

}

183+

const prereleaseOrder = comparePrerelease(left.prerelease, right.prerelease);

184+

process.exit(prereleaseOrder < 0 ? 0 : 1);

185+

NODE

186+

}

187+188+

allow_legacy_update_warning() {

189+

[[ "${OPENCLAW_INSTALL_ALLOW_LEGACY_UPDATE_WARNING:-0}" == "1" ]] && return 0

190+

is_version_before "$UPDATE_BASELINE_VERSION" "$SELF_UPDATE_WARNING_FIXED_VERSION"

191+

}

192+123193

npm_install_global() {

124194

local label="$1"

125195

shift

@@ -268,11 +338,20 @@ run_update_smoke() {

268338

local update_status

269339

local update_stderr_file

270340

local update_stderr

341+

local update_env=(

342+

env

343+

npm_config_omit=optional

344+

NPM_CONFIG_OMIT=optional

345+

OPENCLAW_ALLOW_ROOT=1

346+

)

347+

if allow_legacy_update_warning; then

348+

update_env+=(OPENCLAW_UPDATE_IN_PROGRESS=1)

349+

fi

271350

update_stderr_file="$(mktemp)"

272351

set +e

273352

UPDATE_JSON="$(

274353

run_with_heartbeat "openclaw update" \

275-

env npm_config_omit=optional NPM_CONFIG_OMIT=optional OPENCLAW_ALLOW_ROOT=1 \

354+

"${update_env[@]}" \

276355

openclaw update --tag "$UPDATE_TAG_URL" --yes --json 2>"$update_stderr_file"

277356

)"

278357

update_status=$?

@@ -283,6 +362,12 @@ run_update_smoke() {

283362

if [[ -n "$update_stderr" ]]; then

284363

printf "%s\n" "$update_stderr" >&2

285364

fi

365+

if [[ "$update_stderr" == *"config was written by version"* ]] && allow_legacy_update_warning; then

366+

echo "WARN: legacy baseline emitted a self-update version-skew warning; fixed baselines must not" >&2

367+

elif [[ "$update_stderr" == *"config was written by version"* ]]; then

368+

echo "ERROR: openclaw update emitted a self-update version-skew warning" >&2

369+

return 1

370+

fi

286371

if [[ "$update_status" -ne 0 ]]; then

287372

if is_self_swapped_package_process_exit "$update_stderr"; then

288373

echo "WARN: legacy updater process exited after self-swap; validating update JSON and installed CLI" >&2