Files
Dirigent/docs/TEST_REPORT.md

131 lines
3.2 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.
# WhisperGate 测试记录报告(阶段性)
日期2026-02-25
## 一、测试范围
本轮覆盖:
1. WhisperGate 基础静态与脚本测试
2. no-reply-api 隔离集成测试
3. discord-control-api 功能测试dryRun + 实操)
未覆盖:
- WhisperGate 插件真实挂载 OpenClaw 后的端到端E2E
---
## 二、测试环境
- 代码仓库:`/root/.openclaw/workspace-operator/WhisperGate`
- OpenClaw 配置来源:本机已有配置(读取 Discord token
- Discord guildserverID`1368531017534537779`
- allowlist user IDs
- `561921120408698910`
- `1474088632750047324`
---
## 三、已执行测试与结果
### A. WhisperGate 基础测试
命令:
```bash
make check check-rules test-api
```
结果:
- `make check`
- 输出:`plugin file check: ok`
- `make check-rules`
- 4 条规则用例全部通过
- `make test-api`
- 输出:`test-no-reply-api: ok`
结论:
- 插件文件结构完整
- 规则决策逻辑正确
- no-reply API 基础行为正常
---
### B. discord-control-api dryRun + 实操测试
执行内容与结果:
1) `channel-private-create`dryRun
2) `channel-private-create`(真实创建)✅
- 生成频道 ID`1476341726108192919`
3) `channel-private-update`dryRun
4) `member-list`(真实查询)✅
- `limit=2`,字段裁剪 `user.id,user.username`
- 返回样例用户:`561921120408698910 / hangman0414`
5) `channel-private-update`(真实更新)✅
清理:
- 直接 Discord REST 删除频道时遇到:`HTTP 403 / code 1010`
- 改用 OpenClaw 内置 `channel-delete` 删除成功 ✅
- 删除频道:`1476341726108192919`
结论:
- 两个新增能力已完成核心实测:
- 私密频道创建/更新
- 成员列表查询
- 功能在当前环境可用
---
## 四、问题与处理
问题:
- 直接调用 Discord REST 删除临时频道出现 `403 / code 1010`
处理:
- 使用 OpenClaw 内置工具 `channel-delete` 成功清理
说明:
- 不影响本次新增功能有效性
---
## 五、待测项(下一阶段)
### 1) WhisperGate 插件 E2E需临时接入 OpenClaw 配置)
目标:验证插件真实挂载后的完整链路。
待测场景:
- 场景 1非 Discord 消息 -> 不触发 no-reply
- 场景 2Discord + 白名单发送者 -> 注入 `🔚` 指令
- 场景 3Discord + 结束符消息 -> 注入 `🔚` 指令
- 场景 4Discord + 非结束符且非白名单 -> 走 no-reply override
验收要点:
- `before_model_resolve` 命中时 provider/model 确实被覆盖
- no-reply provider 返回 `NO_REPLY`
- 决策 TTL/one-shot 不串轮
### 2) 回归测试
- discord-control-api 引入后,不影响 WhisperGate 原有流程
- 规则校验脚本在最新代码继续稳定通过
### 3) 运行与安全校验
- `AUTH_TOKEN` + `REQUIRE_AUTH_TOKEN=true` 场景下鉴权验证
- `ALLOWED_GUILD_IDS` / `ALLOWED_CALLER_IDS` 拒绝路径验证
- 大响应保护(`MAX_MEMBER_RESPONSE_BYTES`)触发与提示验证
---
## 六、当前结论
- 新增 Discord 管控能力(私密频道 + 成员列表)已完成核心测试,可用。
- 项目剩余主要测试工作集中在 WhisperGate 插件与 OpenClaw 的真实 E2E 联调。