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

推荐订阅源

美团技术团队
T
The Blog of Author Tim Ferriss
月光博客
月光博客
阮一峰的网络日志
阮一峰的网络日志
Engineering at Meta
Engineering at Meta
量子位
I
InfoQ
Jina AI
Jina AI
Microsoft Security Blog
Microsoft Security Blog
H
Help Net Security
H
Hackread – Cybersecurity News, Data Breaches, AI and More
G
Google Developers Blog
J
Java Code Geeks
Recent Announcements
Recent Announcements
aimingoo的专栏
aimingoo的专栏
小众软件
小众软件
V
V2EX
腾讯CDC
P
Proofpoint News Feed
A
About on SuperTechFans
爱范儿
爱范儿
U
Unit 42
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
Last Week in AI
Last Week in AI

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(update): defer configured plugin installs for shipped...
steipete · 2026-05-18 · via Recent Commits to openclaw:main

@@ -748,6 +748,7 @@ function recordClawHubPackageName(value: string | undefined): string | undefined

748748

async function installCandidate(params: {

749749

candidate: DownloadableInstallCandidate;

750750

records: Record<string, PluginInstallRecord>;

751+

env: NodeJS.ProcessEnv;

751752

updateChannel?: UpdateChannel;

752753

mode?: "install" | "update";

753754

preferNpm?: boolean;

@@ -758,7 +759,7 @@ async function installCandidate(params: {

758759

failedPluginId?: string;

759760

}> {

760761

const { candidate } = params;

761-

const extensionsDir = resolveDefaultPluginExtensionsDir();

762+

const extensionsDir = resolveDefaultPluginExtensionsDir(params.env);

762763

const changes: string[] = [];

763764

const clawhubSpecs = candidate.clawhubSpec

764765

? resolveClawHubInstallSpecsForUpdateChannel({

@@ -774,6 +775,16 @@ async function installCandidate(params: {

774775

: null;

775776

const clawhubInstallSpec = clawhubSpecs?.installSpec ?? candidate.clawhubSpec;

776777

const npmInstallSpec = npmSpecs?.installSpec ?? candidate.npmSpec;

778+

const npmDir = resolveDefaultPluginNpmDir(params.env);

779+

const existingClawHubPackagePath = clawhubInstallSpec

780+

? resolveExistingCandidateClawHubPackagePath({

781+

candidate,

782+

extensionsDir,

783+

})

784+

: null;

785+

const existingNpmPackagePath = npmInstallSpec

786+

? resolveExistingCandidateNpmPackagePath({ candidate, npmDir })

787+

: null;

777788

const shouldTryClawHub =

778789

clawhubInstallSpec &&

779790

!(params.preferNpm && npmInstallSpec) &&

@@ -783,7 +794,7 @@ async function installCandidate(params: {

783794

spec: clawhubInstallSpec,

784795

extensionsDir,

785796

expectedPluginId: candidate.pluginId,

786-

mode: params.mode ?? "install",

797+

mode: params.mode === "update" || existingClawHubPackagePath ? "update" : "install",

787798

});

788799

if (clawhubResult.ok) {

789800

const pluginId = clawhubResult.pluginId;

@@ -828,16 +839,31 @@ async function installCandidate(params: {

828839

failedPluginId: candidate.pluginId,

829840

};

830841

}

831-

const result = await installPluginFromNpmSpec({

842+

const npmInstallMode = params.mode === "update" || existingNpmPackagePath ? "update" : "install";

843+

let result = await installPluginFromNpmSpec({

832844

spec: npmInstallSpec,

833845

extensionsDir,

846+

npmDir,

834847

expectedPluginId: candidate.pluginId,

835848

expectedIntegrity: candidate.expectedIntegrity,

836849

...(candidate.trustedSourceLinkedOfficialInstall

837850

? { trustedSourceLinkedOfficialInstall: true }

838851

: {}),

839-

mode: params.mode ?? "install",

852+

mode: npmInstallMode,

840853

});

854+

if (!result.ok && npmInstallMode === "install" && isPluginAlreadyExistsError(result.error)) {

855+

result = await installPluginFromNpmSpec({

856+

spec: npmInstallSpec,

857+

extensionsDir,

858+

npmDir,

859+

expectedPluginId: candidate.pluginId,

860+

expectedIntegrity: candidate.expectedIntegrity,

861+

...(candidate.trustedSourceLinkedOfficialInstall

862+

? { trustedSourceLinkedOfficialInstall: true }

863+

: {}),

864+

mode: "update",

865+

});

866+

}

841867

if (!result.ok) {

842868

return {

843869

records: params.records,

@@ -869,6 +895,39 @@ async function installCandidate(params: {

869895

};

870896

}

871897898+

function isPluginAlreadyExistsError(error: string): boolean {

899+

return /\bplugin already exists:/.test(error);

900+

}

901+902+

function resolveExistingCandidateNpmPackagePath(params: {

903+

candidate: DownloadableInstallCandidate;

904+

npmDir: string;

905+

}): string | null {

906+

const npmName = params.candidate.npmSpec

907+

? parseRegistryNpmSpec(params.candidate.npmSpec)?.name

908+

: undefined;

909+

if (!npmName) {

910+

return null;

911+

}

912+

const packagePath = resolveNpmPackageInstallPath({

913+

packageName: npmName,

914+

npmRoot: params.npmDir,

915+

});

916+

return existsSync(packagePath) ? packagePath : null;

917+

}

918+919+

function resolveExistingCandidateClawHubPackagePath(params: {

920+

candidate: DownloadableInstallCandidate;

921+

extensionsDir: string;

922+

}): string | null {

923+

try {

924+

const packagePath = resolvePluginInstallDir(params.candidate.pluginId, params.extensionsDir);

925+

return existsSync(packagePath) ? packagePath : null;

926+

} catch {

927+

return null;

928+

}

929+

}

930+872931

export type RepairMissingPluginInstallsResult = {

873932

changes: string[];

874933

warnings: string[];

@@ -1165,6 +1224,7 @@ async function repairMissingPluginInstalls(params: {

11651224

const installed = await installCandidate({

11661225

candidate,

11671226

records: nextRecords,

1227+

env,

11681228

updateChannel,

11691229

mode: shouldReplaceBrokenOfficialInstall ? "update" : "install",

11701230

preferNpm: preferNpmInstalls,