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

推荐订阅源

Google DeepMind News
Google DeepMind News
aimingoo的专栏
aimingoo的专栏
爱范儿
爱范儿
D
Docker
I
InfoQ
Microsoft Security Blog
Microsoft Security Blog
G
Google Developers Blog
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
Vercel News
Vercel News
H
Hackread – Cybersecurity News, Data Breaches, AI and More
T
Tailwind CSS Blog
D
DataBreaches.Net
月光博客
月光博客
N
Netflix TechBlog - Medium
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
V
Visual Studio Blog
MyScale Blog
MyScale Blog
B
Blog
阮一峰的网络日志
阮一峰的网络日志
L
LangChain Blog
Recent Announcements
Recent Announcements
Microsoft Azure Blog
Microsoft Azure Blog
WordPress大学
WordPress大学

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
refactor: clean up update and plugin uninstall helpers · ...
steipete · 2026-04-26 · via Recent Commits to openclaw:main

@@ -19,6 +19,7 @@ import { resolveGatewayInstallEntrypoint } from "../../daemon/gateway-entrypoint

1919

import { resolveGatewayRestartLogPath } from "../../daemon/restart-logs.js";

2020

import { resolveGatewayService } from "../../daemon/service.js";

2121

import { createLowDiskSpaceWarning } from "../../infra/disk-space.js";

22+

import { runGlobalPackageUpdateSteps } from "../../infra/package-update-steps.js";

2223

import { nodeVersionSatisfiesEngine } from "../../infra/runtime-guard.js";

2324

import {

2425

channelToNpmTag,

@@ -33,13 +34,10 @@ import {

3334

checkUpdateStatus,

3435

} from "../../infra/update-check.js";

3536

import {

36-

collectInstalledGlobalPackageErrors,

3737

canResolveRegistryVersionForPackageTarget,

3838

createGlobalInstallEnv,

3939

cleanupGlobalRenameDirs,

40-

globalInstallFallbackArgs,

4140

globalInstallArgs,

42-

resolveExpectedInstalledVersionFromSpec,

4341

resolveGlobalInstallTarget,

4442

resolveGlobalInstallSpec,

4543

} from "../../infra/update-global.js";

@@ -399,86 +397,45 @@ async function runPackageInstallUpdate(params: {

399397

}

400398

}

401399402-

const updateStep = await runUpdateStep({

403-

name: "global update",

404-

argv: globalInstallArgs(installTarget, installSpec),

405-

env: installEnv,

400+

const packageUpdate = await runGlobalPackageUpdateSteps({

401+

installTarget,

402+

installSpec,

403+

packageName,

404+

packageRoot: pkgRoot,

405+

runCommand,

406406

timeoutMs: params.timeoutMs,

407-

progress: params.progress,

408-

});

409-410-

const steps = [updateStep];

411-

let finalInstallStep = updateStep;

412-

if (updateStep.exitCode !== 0) {

413-

const fallbackArgv = globalInstallFallbackArgs(installTarget, installSpec);

414-

if (fallbackArgv) {

415-

const fallbackStep = await runUpdateStep({

416-

name: "global update (omit optional)",

417-

argv: fallbackArgv,

418-

env: installEnv,

419-

timeoutMs: params.timeoutMs,

420-

progress: params.progress,

421-

});

422-

steps.push(fallbackStep);

423-

finalInstallStep = fallbackStep;

424-

}

425-

}

426-

let afterVersion = beforeVersion;

427-428-

const verifiedPackageRoot =

429-

(

430-

await resolveGlobalInstallTarget({

431-

manager: installTarget,

432-

runCommand,

433-

timeoutMs: params.timeoutMs,

434-

})

435-

).packageRoot ?? pkgRoot;

436-

if (verifiedPackageRoot) {

437-

afterVersion = await readPackageVersion(verifiedPackageRoot);

438-

const expectedVersion = resolveExpectedInstalledVersionFromSpec(packageName, installSpec);

439-

const verificationErrors = await collectInstalledGlobalPackageErrors({

440-

packageRoot: verifiedPackageRoot,

441-

expectedVersion,

442-

});

443-

if (verificationErrors.length > 0) {

444-

steps.push({

445-

name: "global install verify",

446-

command: `verify ${verifiedPackageRoot}`,

447-

cwd: verifiedPackageRoot,

448-

durationMs: 0,

449-

exitCode: 1,

450-

stderrTail: verificationErrors.join("\n"),

451-

stdoutTail: null,

452-

});

453-

}

454-

const entryPath = await resolveGatewayInstallEntrypoint(verifiedPackageRoot);

455-

if (entryPath) {

456-

const doctorStep = await runUpdateStep({

457-

name: `${CLI_NAME} doctor`,

458-

argv: [resolveNodeRunner(), entryPath, "doctor", "--non-interactive", "--fix"],

459-

env: {

460-

...process.env,

461-

OPENCLAW_UPDATE_IN_PROGRESS: "1",

462-

},

463-

timeoutMs: params.timeoutMs,

407+

...(installEnv === undefined ? {} : { env: installEnv }),

408+

runStep: (stepParams) =>

409+

runUpdateStep({

410+

...stepParams,

464411

progress: params.progress,

465-

});

466-

steps.push(doctorStep);

467-

}

468-

}

412+

}),

413+

postVerifyStep: async (verifiedPackageRoot) => {

414+

const entryPath = await resolveGatewayInstallEntrypoint(verifiedPackageRoot);

415+

if (entryPath) {

416+

return await runUpdateStep({

417+

name: `${CLI_NAME} doctor`,

418+

argv: [resolveNodeRunner(), entryPath, "doctor", "--non-interactive", "--fix"],

419+

env: {

420+

...process.env,

421+

OPENCLAW_UPDATE_IN_PROGRESS: "1",

422+

},

423+

timeoutMs: params.timeoutMs,

424+

progress: params.progress,

425+

});

426+

}

427+

return null;

428+

},

429+

});

469430470-

const failedStep =

471-

finalInstallStep.exitCode !== 0

472-

? finalInstallStep

473-

: (steps.find((step) => step !== updateStep && step.exitCode !== 0) ?? null);

474431

return {

475-

status: failedStep ? "error" : "ok",

432+

status: packageUpdate.failedStep ? "error" : "ok",

476433

mode: manager,

477-

root: verifiedPackageRoot ?? params.root,

478-

reason: failedStep ? failedStep.name : undefined,

434+

root: packageUpdate.verifiedPackageRoot ?? params.root,

435+

reason: packageUpdate.failedStep ? packageUpdate.failedStep.name : undefined,

479436

before: { version: beforeVersion },

480-

after: { version: afterVersion },

481-

steps,

437+

after: { version: packageUpdate.afterVersion ?? beforeVersion },

438+

steps: packageUpdate.steps,

482439

durationMs: Date.now() - params.startedAt,

483440

};

484441

}