






















@@ -454,6 +454,18 @@ function describeBetaNpmFallback(params: {
454454return `Plugin "${params.pluginId}" ${reason} for ${betaSpec}; falling back to ${params.fallbackSpec}.`;
455455}
456456457+function formatBetaChannelFallbackOutcomeSuffix(params: {
458+fallbackLabel: string | undefined;
459+fallbackSpec: string | undefined;
460+verb: "used" | "would use";
461+}): string {
462+if (!params.fallbackSpec) {
463+return "";
464+}
465+const betaTarget = params.fallbackLabel ?? "beta target";
466+return ` (beta channel fallback: ${params.verb} ${params.fallbackSpec} after ${betaTarget} failed).`;
467+}
468+457469function npmUpdateFailureSpec(params: {
458470effectiveSpec: string | undefined;
459471fallbackSpec: string | undefined;
@@ -1152,6 +1164,7 @@ export async function updateNpmInstalledPlugins(params: {
11521164continue;
11531165}
11541166let usedNpmFallback = false;
1167+let channelFallbackSuffix = "";
11551168if (!probe.ok && record.source === "npm" && npmSpecs?.fallbackSpec) {
11561169logger.warn?.(
11571170describeBetaNpmFallback({
@@ -1162,6 +1175,11 @@ export async function updateNpmInstalledPlugins(params: {
11621175}),
11631176);
11641177usedNpmFallback = true;
1178+channelFallbackSuffix = formatBetaChannelFallbackOutcomeSuffix({
1179+fallbackLabel: npmSpecs.fallbackLabel ?? effectiveSpec,
1180+fallbackSpec: npmSpecs.fallbackSpec,
1181+verb: "would use",
1182+});
11651183probe = await installPluginFromNpmSpec({
11661184spec: npmSpecs.fallbackSpec,
11671185mode: "update",
@@ -1187,6 +1205,11 @@ export async function updateNpmInstalledPlugins(params: {
11871205clawhubSpecs?.fallbackSpec &&
11881206shouldFallbackBetaClawHubUpdate(probe)
11891207) {
1208+channelFallbackSuffix = formatBetaChannelFallbackOutcomeSuffix({
1209+fallbackLabel: clawhubSpecs.fallbackLabel ?? effectiveSpec,
1210+fallbackSpec: clawhubSpecs.fallbackSpec,
1211+verb: "would use",
1212+});
11901213logger.warn?.(
11911214`Plugin "${pluginId}" has no beta ClawHub release for ${clawhubSpecs.fallbackLabel ?? effectiveSpec}; falling back to ${clawhubSpecs.fallbackSpec}.`,
11921215);
@@ -1264,15 +1287,15 @@ export async function updateNpmInstalledPlugins(params: {
12641287status: "unchanged",
12651288currentVersion: currentVersion ?? undefined,
12661289nextVersion: resolvedProbeVersion,
1267-message: `${pluginId} is up to date (${currentLabel}).`,
1290+message: `${pluginId} is up to date (${currentLabel}).${channelFallbackSuffix}`,
12681291});
12691292} else {
12701293outcomes.push({
12711294 pluginId,
12721295status: "updated",
12731296currentVersion: currentVersion ?? undefined,
12741297nextVersion: resolvedProbeVersion,
1275-message: `Would update ${pluginId}: ${currentLabel} -> ${nextVersion}.`,
1298+message: `Would update ${pluginId}: ${currentLabel} -> ${nextVersion}.${channelFallbackSuffix}`,
12761299});
12771300}
12781301continue;
@@ -1339,6 +1362,7 @@ export async function updateNpmInstalledPlugins(params: {
13391362continue;
13401363}
13411364let usedNpmFallback = false;
1365+let channelFallbackSuffix = "";
13421366if (!result.ok && record.source === "npm" && npmSpecs?.fallbackSpec) {
13431367logger.warn?.(
13441368describeBetaNpmFallback({
@@ -1349,6 +1373,11 @@ export async function updateNpmInstalledPlugins(params: {
13491373}),
13501374);
13511375usedNpmFallback = true;
1376+channelFallbackSuffix = formatBetaChannelFallbackOutcomeSuffix({
1377+fallbackLabel: npmSpecs.fallbackLabel ?? effectiveSpec,
1378+fallbackSpec: npmSpecs.fallbackSpec,
1379+verb: "used",
1380+});
13521381result = await installNpmSpecForUpdate({
13531382spec: npmSpecs.fallbackSpec,
13541383mode: "update",
@@ -1373,6 +1402,11 @@ export async function updateNpmInstalledPlugins(params: {
13731402clawhubSpecs?.fallbackSpec &&
13741403shouldFallbackBetaClawHubUpdate(result)
13751404) {
1405+channelFallbackSuffix = formatBetaChannelFallbackOutcomeSuffix({
1406+fallbackLabel: clawhubSpecs.fallbackLabel ?? effectiveSpec,
1407+fallbackSpec: clawhubSpecs.fallbackSpec,
1408+verb: "used",
1409+});
13761410logger.warn?.(
13771411`Plugin "${pluginId}" has no beta ClawHub release for ${clawhubSpecs.fallbackLabel ?? effectiveSpec}; falling back to ${clawhubSpecs.fallbackSpec}.`,
13781412);
@@ -1494,15 +1528,15 @@ export async function updateNpmInstalledPlugins(params: {
14941528status: "unchanged",
14951529currentVersion: currentVersion ?? undefined,
14961530nextVersion: nextVersion ?? undefined,
1497-message: `${pluginId} already at ${currentLabel}.`,
1531+message: `${pluginId} already at ${currentLabel}.${channelFallbackSuffix}`,
14981532});
14991533} else {
15001534outcomes.push({
15011535 pluginId,
15021536status: "updated",
15031537currentVersion: currentVersion ?? undefined,
15041538nextVersion: nextVersion ?? undefined,
1505-message: `Updated ${pluginId}: ${currentLabel} -> ${nextLabel}.`,
1539+message: `Updated ${pluginId}: ${currentLabel} -> ${nextLabel}.${channelFallbackSuffix}`,
15061540});
15071541}
15081542}
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。