From 29f1f01219daf59cd741573275c37f8cc3738f86 Mon Sep 17 00:00:00 2001 From: zhi Date: Thu, 2 Apr 2026 07:48:25 +0000 Subject: [PATCH] docs: finalize channel mode and shuffle docs --- README.md | 8 ++++++++ docs/CONFIG.example.json | 3 +++ docs/INTEGRATION.md | 5 +++++ plans/CHANNEL_MODES_AND_SHUFFLE.md | 25 +++++++++++++++---------- plans/TASKLIST.md | 10 +++++----- 5 files changed, 36 insertions(+), 15 deletions(-) diff --git a/README.md b/README.md index dfcf810..a6a5ae4 100644 --- a/README.md +++ b/README.md @@ -101,6 +101,9 @@ Discord extension capabilities: `docs/DISCORD_CONTROL.md`. /dirigent turn-status /dirigent turn-advance /dirigent turn-reset +/dirigent turn-shuffling +/dirigent turn-shuffling on +/dirigent turn-shuffling off ``` --- @@ -116,8 +119,13 @@ Common options (see `docs/INTEGRATION.md`): - `waitIdentifier` (default `👤`) — agent ends with this to pause all agents until human replies - `channelPoliciesFile` (per-channel overrides) - `moderatorBotToken` (handoff messages) +- `multiMessageStartMarker` (default `↗️`) +- `multiMessageEndMarker` (default `↙️`) +- `multiMessagePromptMarker` (default `⤵️`) - `enableDebugLogs`, `debugLogChannelIds` +Shuffle mode does not currently have a global config key. It is a per-channel runtime toggle, defaults to off, and is controlled with `/dirigent turn-shuffling ...`. + --- ## Development plan (incremental commits) diff --git a/docs/CONFIG.example.json b/docs/CONFIG.example.json index 84e3a80..db8ca0b 100644 --- a/docs/CONFIG.example.json +++ b/docs/CONFIG.example.json @@ -14,6 +14,9 @@ "agentList": [], "endSymbols": ["🔚"], "schedulingIdentifier": "➡️", + "multiMessageStartMarker": "↗️", + "multiMessageEndMarker": "↙️", + "multiMessagePromptMarker": "⤵️", "channelPoliciesFile": "~/.openclaw/dirigent-channel-policies.json", "noReplyProvider": "dirigentway", "noReplyModel": "no-reply", diff --git a/docs/INTEGRATION.md b/docs/INTEGRATION.md index 6eb7378..dde7a77 100644 --- a/docs/INTEGRATION.md +++ b/docs/INTEGRATION.md @@ -58,6 +58,9 @@ Environment overrides: - `CHANNEL_POLICIES_FILE` (standalone channel policy file path) - `CHANNEL_POLICIES_JSON` (only used to initialize file when missing) - `END_SYMBOLS_JSON` +- `MULTI_MESSAGE_START_MARKER` +- `MULTI_MESSAGE_END_MARKER` +- `MULTI_MESSAGE_PROMPT_MARKER` The script: - writes via `openclaw config set ... --json` @@ -76,3 +79,5 @@ Policy state semantics: - Keep no-reply API bound to loopback/private network. - If you use API auth, set `AUTH_TOKEN` and align provider apiKey usage. +- Multi-message mode markers default to `↗️` / `↙️` / `⤵️` when no overrides are supplied. +- Shuffle mode is not configured globally in the current implementation; it is a per-channel runtime toggle controlled with `/dirigent turn-shuffling`, `/dirigent turn-shuffling on`, and `/dirigent turn-shuffling off`. diff --git a/plans/CHANNEL_MODES_AND_SHUFFLE.md b/plans/CHANNEL_MODES_AND_SHUFFLE.md index 4c130d9..0ecde0f 100644 --- a/plans/CHANNEL_MODES_AND_SHUFFLE.md +++ b/plans/CHANNEL_MODES_AND_SHUFFLE.md @@ -28,13 +28,13 @@ ### 1.2 配置项 -建议新增以下可配置项: +新增并已实现以下可配置项: - `multiMessageStartMarker`:默认 `↗️` - `multiMessageEndMarker`:默认 `↙️` - `multiMessagePromptMarker`:默认 `⤵️` -这些配置应加入插件 config schema,并在运行时可被 hook/turn-manager 使用。 +这些配置已加入插件 config schema,并在运行时被 `message-received` / `before-message-write` / `before-model-resolve` 使用。 --- @@ -100,13 +100,17 @@ multi-message mode 应与 discussion channel / wait-for-human / no-reply 决策 并新增 slash command: -- `/turn-shuffling on` -- `/turn-shuffling off` -- `/turn-shuffling`(查看当前状态) +- `/dirigent turn-shuffling on` +- `/dirigent turn-shuffling off` +- `/dirigent turn-shuffling`(查看当前状态) -该状态应与 channel 级 policy / runtime state 做清晰分工: -- 若只是运行时开关,可放 runtime memory -- 若希望重启保留,则需要落盘策略 +当前实现结论: +- `shuffling` 是 **channel 级 runtime state**,存放在 `plugin/core/channel-modes.ts` +- 默认值为 `false` +- 当前版本**不新增**全局 `shuffle default` 配置项 +- 重启后会恢复为默认关闭,如需开启需要再次执行命令 + +这样与现有实现保持一致,也避免把一次性的实验性调度偏好混入全局静态配置。 --- @@ -208,8 +212,9 @@ Multi-Message Mode 与 Shuffle Mode 已经在代码中实现,包括: - Shuffle Mode 实现: - `plugin/core/channel-modes.ts` - 管理 shuffle 状态 - `plugin/turn-manager.ts` - 在每轮结束后根据 shuffle 设置决定是否重洗牌 - - `/turn-shuffling` slash command 实现,支持 `on`/`off`/`status` 操作 + - `/dirigent turn-shuffling` slash command 实现,支持 `on`/`off`/`status` 操作 - 确保上一轮最后发言者不会在下一轮中成为第一位 + - 当前行为是运行时开关,默认关闭,不落盘 ## 7. 验收清单 @@ -224,7 +229,7 @@ Multi-Message Mode 与 Shuffle Mode 已经在代码中实现,包括: - [x] 与 mention override 模式兼容 ### Shuffle Mode 验收 -- [x] `/turn-shuffling on/off` 命令生效 +- [x] `/dirigent turn-shuffling on/off` 命令生效 - [x] shuffling 关闭时 turn order 保持不变 - [x] shuffling 开启时每轮结束后会重洗牌 - [x] 上一轮最后发言者不会在下一轮中成为第一位 diff --git a/plans/TASKLIST.md b/plans/TASKLIST.md index 7d1c018..7e65fc9 100644 --- a/plans/TASKLIST.md +++ b/plans/TASKLIST.md @@ -278,7 +278,7 @@ - [x] 增加 `multiMessageEndMarker` - [x] 增加 `multiMessagePromptMarker` - [x] 为新增配置设置默认值:`↗️` / `↙️` / `⤵️` -- [. ] 评估是否需要增加 shuffle 默认配置项 +- [x] 评估是否需要增加 shuffle 默认配置项 #### B2.2 `plugin/rules.ts` / config 类型 - [x] 为 multi-message mode 相关配置补类型定义 @@ -376,7 +376,7 @@ - [x] 测试 shuffle mode 与 mention override 的边界 ### B11. 文档收尾 -- [. ] 根据最终实现更新 `plans/CHANNEL_MODES_AND_SHUFFLE.md` -- [. ] 为新增配置项补文档 -- [. ] 为 `/turn-shuffling` 补使用说明 -- [. ] 输出 Multi-Message Mode / Shuffle Mode 的验收清单 +- [x] 根据最终实现更新 `plans/CHANNEL_MODES_AND_SHUFFLE.md` +- [x] 为新增配置项补文档 +- [x] 为 `/turn-shuffling` 补使用说明 +- [x] 输出 Multi-Message Mode / Shuffle Mode 的验收清单