mirror of
https://github.com/qingchencloud/clawpanel.git
synced 2026-05-31 13:20:10 +08:00
feat(diagnose): detect and inform about @homebridge/ciao cmd popup bug (#250)
* feat(diagnose): detect and inform about @homebridge/ciao cmd popup bug
On Windows, OpenClaw's transitive dependency @homebridge/ciao (<=1.3.6)
calls child_process.exec('arp -a ...') every 15-30 seconds without
passing windowsHide:true, causing a cmd.exe popup to flash.
This is an upstream library bug:
- Issue: homebridge/ciao#64
- PR: homebridge/ciao#65 (open, not merged)
ClawPanel deliberately chooses 'detect and inform' rather than silently
patching the user's node_modules. We respect the user's control over
their own machine.
Changes:
- src-tauri/src/commands/diagnose.rs: new check_ciao_windowshide_bug
command; scans openclaw's @homebridge/ciao/lib/NetworkManager.js and
reports whether the buggy exec pattern is present
- src-tauri/src/lib.rs: register the new command
- scripts/dev-api.js: Web-mode stub (returns affected:false since the
bug does not manifest off-Windows)
- src/lib/tauri-api.js: add api.checkCiaoWindowsHideBug
- src/lib/ciao-bug-warning.js: new module with toast + modal flow,
version-scoped dismiss (localStorage)
- src/locales/modules/ciaoBug.js: translations in 5 primary languages
- src/locales/index.js: register the ciaoBug module
- src/main.js: call checker 3s after splash hides
Non-Windows users see nothing; Windows users see a single warning toast
(version-dismissible) linking to three fix paths: wait for upstream,
apply patch-package, or edit NetworkManager.js manually.
* fix(diagnose): gate helper with cfg(windows), drop unneeded return
CI failures on Linux + macOS:
- openclaw_module_root was dead code when target_os != windows
since the only caller is the #[cfg(target_os = "windows")] block
inside check_ciao_windowshide_bug
- Explicit `return CiaoCheckResult {...};` in the non-Windows branch
triggered clippy::needless_return
Fix:
- Add #[cfg(target_os = "windows")] to openclaw_module_root so it
is not compiled on other platforms
- Convert the non-Windows early exit to a tail expression
This commit is contained in:
11
src/main.js
11
src/main.js
@@ -344,6 +344,17 @@ async function boot() {
|
||||
setTimeout(() => splash.remove(), 500)
|
||||
}
|
||||
|
||||
// 启动 3 秒后提示 @homebridge/ciao cmd 弹窗问题(仅 Windows 受影响)
|
||||
// 只在桌面端跑——Web 模式下的 dev-api.js 桩会直接返回 affected:false
|
||||
setTimeout(async () => {
|
||||
try {
|
||||
const { checkAndWarnCiaoBug } = await import('./lib/ciao-bug-warning.js')
|
||||
checkAndWarnCiaoBug()
|
||||
} catch (err) {
|
||||
console.debug('[ciao-bug] module skipped:', err)
|
||||
}
|
||||
}, 3000)
|
||||
|
||||
// 默认密码提醒横幅
|
||||
if (sessionStorage.getItem('clawpanel_must_change_pw') === '1') {
|
||||
const banner = document.createElement('div')
|
||||
|
||||
Reference in New Issue
Block a user