Complete CSM and channel modes implementation

- Add comprehensive tests for shuffle mode functionality
- Add comprehensive tests for multi-message mode functionality
- Add compatibility tests between different channel modes
- Update documentation to reflect completed implementation
- Mark all completed tasks as finished in TASKLIST.md
- Update CHANNEL_MODES_AND_SHUFFLE.md with implementation status and acceptance criteria
This commit is contained in:
zhi
2026-04-02 06:08:48 +00:00
parent b40838f259
commit 4e0a24333e
5 changed files with 523 additions and 25 deletions

View File

@@ -194,15 +194,51 @@ multi-message mode 应与 discussion channel / wait-for-human / no-reply 决策
---
## 6. 结论
## 6. 实现状态
`feat/new-feat-notes` 分支中的内容可以整合为 `main` 下的一份独立规划文档,建议命名为
Multi-Message Mode 与 Shuffle Mode 已经在代码中实现,包括
- `plans/CHANNEL_MODES_AND_SHUFFLE.md`
- Multi-Message Mode 实现:
- `plugin/core/channel-modes.ts` - 管理 channel 运行时状态
- `plugin/hooks/message-received.ts` - 检测 start/end marker 并切换模式
- `plugin/hooks/before-model-resolve.ts` - 在 multi-message mode 中强制 no-reply
- 配置项 `multiMessageStartMarker` (默认 `↗️`)、`multiMessageEndMarker` (默认 `↙️`)、`multiMessagePromptMarker` (默认 `⤵️`)
-`plugin/openclaw.plugin.json` 中添加了相应的配置 schema
其定位是
- 汇总 multi-message mode 与 shuffle mode 的产品行为
- 明确它们与现有 turn-manager / moderator / no-reply 机制的关系
- 为后续代码开发和 TASKLIST 拆分提供依据
- Shuffle Mode 实现
- `plugin/core/channel-modes.ts` - 管理 shuffle 状态
- `plugin/turn-manager.ts` - 在每轮结束后根据 shuffle 设置决定是否重洗牌
- `/turn-shuffling` slash command 实现,支持 `on`/`off`/`status` 操作
- 确保上一轮最后发言者不会在下一轮中成为第一位
后续应将对应开发任务补充进 `plans/TASKLIST.md`
## 7. 验收清单
### Multi-Message Mode 验收
- [x] 人类发送 start marker (`↗️`) 后进入 multi-message 模式
- [x] multi-message 模式中 Agent 被 no-reply 覆盖
- [x] 每条人类追加消息都触发 prompt marker (`⤵️`)
- [x] 人类发送 end marker (`↙️`) 后退出 multi-message 模式
- [x] 退出后 moderator 正确唤醒下一位 Agent
- [x] moderator prompt marker 不会触发回环
- [x] 与 waiting-for-human 模式兼容
- [x] 与 mention override 模式兼容
### Shuffle Mode 验收
- [x] `/turn-shuffling on/off` 命令生效
- [x] shuffling 关闭时 turn order 保持不变
- [x] shuffling 开启时每轮结束后会重洗牌
- [x] 上一轮最后发言者不会在下一轮中成为第一位
- [x] 双 Agent 场景行为符合预期
- [x] 单 Agent 场景不会异常
- [x] 与 dormant 状态兼容
- [x] 与 mention override 兼容
### 配置项验收
- [x] `multiMessageStartMarker` 配置项生效
- [x] `multiMessageEndMarker` 配置项生效
- [x] `multiMessagePromptMarker` 配置项生效
- [x] 配置项在 `plugin/openclaw.plugin.json` 中正确声明
## 8. 结论
Multi-Message Mode 与 Shuffle Mode 已成功集成到 Dirigent 插件中,与现有的 turn-manager、moderator handoff、no-reply override 机制协同工作,为用户提供更灵活的多 Agent 协作控制能力。