tools: add offline rpa window watchdog

This commit is contained in:
zhaoyilun
2026-07-11 20:04:34 +08:00
parent e8b4110cd2
commit c2a1ca560f
3 changed files with 209 additions and 6 deletions

View File

@@ -31,6 +31,52 @@ powershell -NoProfile -ExecutionPolicy Bypass -File E:\coding\codex\isphere-ai-b
- 不生成屏幕截图,避免因为窗口在屏幕外得到无意义图片。
- 继续输出 UIA dump供 RPA 选择器验证。
## 抗干扰能力
新增守护模式:
```powershell
powershell -NoProfile -ExecutionPolicy Bypass -File E:\coding\codex\isphere-ai-bridge\scripts\open-offline-real-client-window.ps1 -WindowMode Visible -WatchSeconds 30 -PollIntervalMs 500
```
也可和无感模式一起使用:
```powershell
powershell -NoProfile -ExecutionPolicy Bypass -File E:\coding\codex\isphere-ai-bridge\scripts\open-offline-real-client-window.ps1 -UserSilent -WatchSeconds 30 -PollIntervalMs 500
```
当前守护逻辑:
- 用户手动移动主窗口:检测到位置/大小偏离后自动移回目标位置。
- 用户手动移动提示窗:检测到位置/大小偏离后自动移回目标位置。
- 用户关闭主窗口/杀掉客户端进程:检测到主窗口消失后自动重新启动离线客户端。
- 每次守护输出:
- `watch_iteration_count`
- `repair_count`
- `relaunch_count`
- `recovery_actions`
本轮实际验证:
1. 模拟移动窗口到 `760,260,310x610`
- 守护输出 `repair_count=1`
- `recovery_actions=["repair_window_placement"]`
- 最终窗口恢复到 `120,120,270x570`
2. 模拟关闭客户端进程:
- 被关闭 PID`11592`
- 守护输出 `relaunch_count=1`
- 新启动 PID`10504`
- `recovery_actions=["relaunch_missing_main_window","repair_after_relaunch"]`
- 最终 UIA 根控件仍为 `frmLogin`
抗干扰强度结论:
- 对“用户移动窗口”:强。
- 对“用户关闭窗口/进程”:中强,可自动重启。
- 对“用户在关键发送瞬间抢焦点/操作同一窗口”:当前还不是强,需要动作级锁定和发送前后校验。
- 对“应用崩溃/服务端不可用”:只能自动拉起窗口;业务登录/聊天能力仍受真实服务端影响。
本轮验证结果:
- 新启动进程:`IMPlatformClient.exe`