From f97ee545105bf6e1a39207638e8d93b2b145e98c Mon Sep 17 00:00:00 2001 From: goku <15951837502@163.com> Date: Fri, 28 Aug 2026 21:06:50 +0800 Subject: [PATCH] =?UTF-8?q?fix(orchestrator):=20check-update=20=E6=94=B9?= =?UTF-8?q?=E6=9F=A5=20dsh-harness-one=EF=BC=880.5+=20=E7=94=A8=E6=88=B7?= =?UTF-8?q?=E6=A3=80=E6=9F=A5=E6=9B=B4=E6=96=B0=E5=A4=B1=E7=81=B5=EF=BC=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit system/info 的检查端点自 v0.5.0 单包化后漏改:仍查废弃老包 dsh-ccpg-one(latest 永钉 0.4.1),导致所有 0.5.0+ 用户点 「检查更新」永远「已是最新」,看不到 0.6.x。执行器 latestVersion() 一直是对的(查 dsh-harness-one),只有检查口径错位——用户看到 不提示,实际有新版可升。 改为复用 system-upgrade.js 导出的 PACKAGE(dsh-harness-one), 检查口径与实际升级口径同源,不再两处写包名。 测试:system-upgrade 12 例 + orchestrator 17 套全绿(端点无 单测直测,行为由隔离环境 UI 实测覆盖——见升级验证流程)。 --- dsh-plugins/dsh-ccpg-orchestrator/lib/index.js | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/dsh-plugins/dsh-ccpg-orchestrator/lib/index.js b/dsh-plugins/dsh-ccpg-orchestrator/lib/index.js index b460c3e..c101235 100644 --- a/dsh-plugins/dsh-ccpg-orchestrator/lib/index.js +++ b/dsh-plugins/dsh-ccpg-orchestrator/lib/index.js @@ -50,7 +50,7 @@ import { } from './agent-schema.js'; import { FeishuClient } from './feishu.js'; import { createFeishuNotificationChannel } from './notification-feishu.js'; -import { collectInstallReport, compareSemver, executePlan, planUpgrade } from './system-upgrade.js'; +import { collectInstallReport, compareSemver, executePlan, planUpgrade, PACKAGE as UPGRADE_PACKAGE } from './system-upgrade.js'; import { NotificationChannelRegistry, WorkflowNotificationManager } from './notifications.js'; import { listFeishuCreds, addFeishuCred, removeFeishuCred, setDefaultFeishuCred, getFeishuCredOrEnv } from './credentials.js'; import { Orchestrator, lintGraph, getKind } from './engine.js'; @@ -2217,8 +2217,11 @@ export function apply(ctx, config) { try { const ctrl = new AbortController(); const timer = setTimeout(() => ctrl.abort(), 8000); - const r = await fetch('https://registry.npmjs.org/dsh-ccpg-one', { - headers: { accept: 'application/vnd.npm.install-v1+json', 'user-agent': 'dsh-ccpg-one-upgrade-check' }, + // 发版渠道自 0.5.0 起是单包 dsh-harness-one(老包 latest 永钉 0.4.1, + // 查老包会让所有 0.5+ 用户永远「已是最新」);与 system-upgrade 的 + // latestVersion() 同源,保证检查口径 = 实际升级口径。 + const r = await fetch(`https://registry.npmjs.org/${UPGRADE_PACKAGE}`, { + headers: { accept: 'application/vnd.npm.install-v1+json', 'user-agent': 'dsh-harness-one-upgrade-check' }, signal: ctrl.signal, }); clearTimeout(timer);