Files
isphere-ai-bridge/docs/source-discovery/2026-07-11-a-route-open-conversation-window.md
2026-07-12 01:22:56 +08:00

125 lines
4.8 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# A-route open_conversation 窗口验证说明
日期2026-07-11
分支:`codex/a-route-rpa-send`
> 2026-07-12 校准:本文记录的是 synthetic 离线探针阶段和当时的真实窗体构造阻塞。后续已经通过
> `scripts\open-offline-real-frmP2PChat.ps1` 在未登录/离线环境打开真实 `frmP2PChat`。
> 当前以 `docs/source-discovery/2026-07-11-a-route-open-real-chat-window.md` 为准。
## 本轮目标
用户明确当前先不要求真实发送消息,只要求“打开那个会话窗口”,用来验证数字员工是否能:
1. 识别会话窗口。
2. 定位发送编辑框。
3. 定位发送按钮/文件按钮。
4. 执行一次可审计的点击。
本地环境没有 iSphere 服务端,无法登录,所以真实会话窗口不能通过正常业务路径打开。
## 已实现:离线会话窗口探针
新增脚本:
```powershell
powershell -NoProfile -ExecutionPolicy Bypass -File E:\coding\codex\isphere-ai-bridge\scripts\open-offline-chat-window-probe.ps1 -ProbeClick
```
它会打开一个本地 WinForms 会话窗口探针,不连接服务端,不发送真实消息。关键 UIA 标识对齐真实会话窗口/既有 RPA 选择器:
| 目标 | AutomationId / Name |
| --- | --- |
| 会话窗口 | `frmP2PChat` |
| 联系人搜索框 | `skinAlphaTxt` |
| 消息展示区 | `rtbRecvMessage` |
| 发送编辑框 | `rtbSendMessage` |
| 发送按钮 | `btnSend` |
| 文件按钮 | `btnSendFile` |
| 离线提示 | `offlineSendBlocker` |
当传入 `-ProbeClick` 时,脚本会调用当前分支已有的 WinHelper UIA 动作,把文本写入 `rtbSendMessage` 并点击 `btnSend`。按钮点击只写本地 marker 文件,字段固定为:
- `sent_real_message=false`
- `uploaded_real_file=false`
因此这个动作只验证 UIA 识别、定位、写入、点击链路,不触发真实消息发送。
## 自动化测试
新增测试:
```powershell
powershell -NoProfile -ExecutionPolicy Bypass -File E:\coding\codex\isphere-ai-bridge\scripts\test-open-offline-chat-window-probe.ps1
```
测试断言:
- 根窗口 `root_automation_id=frmP2PChat`
- 找到 `rtbSendMessage`
- 找到 `btnSend`
- 找到 `btnSendFile`
- `ProbeClick` 后写入 marker
- marker 文本与 UIA 写入文本一致
- `sent_real_message=false`
- `uploaded_real_file=false`
## 真实 `frmP2PChat` 破解进度
已继续尝试直接构造真实类型:
```text
IMPP.Client.Business.ChatManager.SingleChat.frmP2PChat
```
构造函数签名:
```text
frmP2PChat(com.vision.smack.Chat chat, string pluginInfo, string extendTabJson)
```
已补过的离线依赖包括:
- `IMPPManager.Instance.MessageCenter`
- `IMPPManager.Instance.LogonUser`
- `IMPPManager.Instance.UserInfo`
- `SmarkManager.Connection`
- `SmarkManager.RosterManager`
- `SmarkManager.PresenceManager`
- `SmarkManager.P2PChatManager`
- `ConfigSystemManager.config`
- `P2PChat.OtherJid`
本节以下内容是当时的中间判断。后续 Task 7 已经补齐更多离线依赖并成功打开真实窗体因此这里不再作为当前阻塞。它仍保留为风险索引构造函数内部确实把窗体初始化、登录态、连接态、名册状态、消息中心事件、配置状态混在一起。IL 证据显示构造函数中直接访问:
- `IMPPManager.Instance.Connection.add_OnConnectError`
- `IMPPManager.Instance.Connection.add_OnReConnectOk`
- `P2PChat.OtherJid.getBareJid`
- `IMPPManager.Instance.UserInfo.get_Jid`
- `UCChatSendMessageBox.GetChatRichTextBox`
- `UCChatSendMessageBox.GetReceiptCheckBox`
- `IMPPManager.Instance.GetMessageCenter().add_OnTcpMessageArrived`
- `IMPPManager.Instance.RosterManager.UpdateStrangerStatus`
- `Config.BaseConfig.VisualPhoneEnable`
后续解决方式不是走正常登录链路,而是建立更完整的离线依赖 harness并在构造完成后补齐关键用户/JID/配置缓存。当前结论已变更为:真实 `frmP2PChat` 可以离线打开,但真实发送仍会被客户端离线状态阻断。
## 当前业务结论
从“验证 RPA 能否识别、定位、点击会话窗口”的业务目标看,本轮已经可验证:
- 会话窗口可打开。
- 核心 AutomationId 可识别。
- 文本可写入。
- 按钮可点击。
- 点击结果可留本地审计 marker。
- 全程不发真实消息、不上传真实文件。
从“真实 iSphere 会话窗口”的目标看,后续已完成离线打开真实 `frmP2PChat`。从“真实业务发送”的目标看,仍需要在线登录环境。
## 下一步建议
1. synthetic 探针只作为回归兜底;真实窗口验证优先使用 `open-offline-real-frmP2PChat.ps1`
2. 把真实离线 `frmP2PChat` HWND 接入 `isphere_send_message``uia_rpa` connector做可重复 UI 写入/点击 smoke。
3. 在线环境拿到真实登录后的 `frmP2PChat` HWND 后,用同一套 WinHelper 选择器验证业务发送。