CW代码:https://github.com/RinLit-233-shiroko/Class-Widgets-2
Activity
PANDAJSR commentedon Aug 31, 2026
/oc 分析
github-actions commentedon Aug 31, 2026
分析完成。以下是该 Bug 的完整分析。
结论
这是前端 OOBE 卡片渲染逻辑的问题,不是后端检测逻辑的问题。
OobeWizard.tsx中recommended列表把 4 个"双端联动"插件(ClassIsland / Class Widgets / SecRandom / ICC-CE)的卡片无条件强制展示,即使本机根本没有安装这些软件。根因
src/renderer/src/components/OobeWizard.tsx:910复现链路:
bridge.detectInstalledApps()(OobeWizard.tsx:161)→ IPCapps:detect(electron/main.ts:1142)→detectCompanionApps()(companion-apps.ts:19)返回目录中全部 5 个应用,每个都带detected: boolean。recommended的过滤条件除了app.detected,还硬编码了 4 个 pluginId。于是即使detected === false(CW 未安装),class-widgets卡片也会被保留。OobeWizard.tsx:1030{recommended.map(...)}之下,标题是"本机已检测到"(:1028)。用户看到的结果就是:没装 Class Widgets,但 CW 卡片(含"安装 SecAgent 端插件""选择 Class Widgets 可执行文件"按钮)出现在"本机已检测到"区域,误导用户以为被检测到/已安装。
佐证:检测本身是对的
companion-apps.ts:19-33的detectCompanionApps只在找到候选路径时置detected: true。companion-apps.test.ts也验证了"没装就不 detected"的语义。installAllPlugins,:783-784)对未检测到且未手动选目标的 app 会return跳过——说明后端/批量安装逻辑尊重检测结果,只有渲染列表强制展示,两者不一致。影响范围
src/renderer/src/components/OobeWizard.tsxsrc/renderer/src/components/OobeWizard.tsxcompanion-apps.test.ts测检测层)建议修复方案
把"强制展示"改为"有条件展示":卡片仅在满足任一条件时出现——
app.detected);或plugins.some(...),用户可能已配置过该联动);或这样一台全新、未装 CW 的机器上 OOBE 不会出现 CW 卡片;而装了 CW(即使路径非标准、通过手动选择加入)或已装过 SecAgent 端联动插件的机器,卡片仍然保留。
需要注意的设计取舍:当前"无条件展示"可能是刻意设计——为了让安装在非标准目录、自动检测不到的双端应用仍能在 OOBE 里通过"选择可执行文件"完成手动配置。如果直接按上面的方案收紧,这些用户会失去入口。因此实现前需要确认产品意图:
:1029)里放一个通用的"选择可执行文件"按钮作为兜底,同时让卡片只在检测到时展示。验证建议
src/companion-apps.test.ts基础上补一个"未安装 Class Widgets 时detectCompanionApps返回detected: false"的用例(已有类似语义);若将过滤逻辑抽成纯函数,可单独测卡片可见性。由于你发出的是
/oc 分析,我按"只分析、不改代码"处理,未做任何修改。如需我按上面的方案直接实现并跑测试、提交 PR,告诉我即可。opencode session | github run
PANDAJSR commentedon Aug 31, 2026
/oc 修复
github-actions commentedon Aug 31, 2026
Author identity unknown
*** Please tell me who you are.
Run
git config --global user.email "you@example.com"
git config --global user.name "Your Name"
to set your account's default identity.
Omit --global to set the identity only in this repository.
fatal: empty ident name (for runner@runnervmgx7h7.1rxsas4jmcgutcxaxjgeesxcfa.gx.internal.cloudapp.net) not allowed
opencode session | github run
PANDAJSR commentedon Aug 31, 2026
/oc 请继续完成这个修复,提交代码并创建 PR
github-actions commentedon Aug 31, 2026
GitHub Actions is not permitted to create or approve pull requests. - https://docs.github.com/rest/pulls/pulls#create-a-pull-request
opencode session | github run
PANDAJSR commentedon Sep 1, 2026
/oc 重试
PANDAJSR commentedon Sep 1, 2026
/oc 重试
opencode-agent commentedon Sep 1, 2026
Created PR #16
opencode session | github run
opencode-agent commentedon Sep 1, 2026
User opencode-agent[bot] does not have write permissions
github run