Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
50 changes: 48 additions & 2 deletions docs/CONCEPTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,51 @@ Builder → 不能派单(只接单执行)
CIO → 独立运作(必要时与 CoS 同步)
```

### A2A 的两种模式:Delegation 与 Discussion

上面描述的两步触发是 **Delegation(委派)** 模式——一个 Agent 通过 `sessions_send` 把结构化任务交给另一个 Agent。这是 A2A 的基础,所有平台都支持,流程清晰、单向可控。

v2 引入了第二种模式:**Discussion(讨论)**。少数高价值 Agent(如 CoS)拥有独立 Slack App,直接进入其他 Agent 的频道进行实时讨论。 [待 POC 验证]

**核心思路:选择性独立化。** 不需要每个 Agent 都有独立 App——执行层(CTO、Builder、CIO 等)继续共享一个 Slack App。只让 CoS(代表用户推进方向)等需要跨域协作的 Agent 拥有独立 App,然后把它拉进目标频道就能直接对话。

**什么时候用哪个?**

| | Delegation(委派) | Discussion(讨论)[待 POC 验证] |
|--|-------------------|-------------------------------|
| 场景 | "CTO 给 Builder 派一个具体任务" | "CoS 进 #cto 跟 CTO 讨论方案,然后去 #build 跟 Builder 确认可行性" |
| 触发方式 | `sessions_send` | @mention / 直接发消息 |
| 方向性 | 单向,一对一 | 多向,多对多 |
| 平台 | Slack / Discord / Feishu | 仅 Slack(需独立 App) |

两种模式共存,不互相替代。Delegation 是"给任务",Discussion 是"一起想"。

**为什么需要 Discussion?** Delegation 是任务分发:CTO 说做什么,Builder 照做。但真实团队不只是派活——他们讨论。CoS 走进 CTO 的办公室说"这个方向你怎么看?",CTO 说"技术上可以但成本高",CoS 又去问 Builder"你觉得多久能做完?"。Discussion 模式让 Agent 也能这样协作——CoS-Bot 被拉进 #cto 频道,直接在 CTO 的地盘上对话,你可以实时旁观、随时插话。

### 平台能力对比

| 能力 | Slack | Discord | Feishu |
|------|-------|---------|--------|
| Delegation(sessions_send) | ✅ | ✅ | ✅ |
| Discussion(跨 bot 对话)| 待 POC 验证 | 不支持(OpenClaw 代码层 bug) | 不支持(飞书平台限制) |
| Thread / Topic 隔离 | 原生 thread | Thread(自动归档) | groupSessionScope(>= 2026.3.1) |

**为什么 Discord 和 Feishu 不支持 Discussion?**

- **Discord**:平台本身支持跨 bot 消息可见,但 OpenClaw 的 bot 消息过滤代码存在 bug(Issue #11199),把所有已配置的 bot 都当作"自己"并丢弃消息。属于代码层问题,理论上可修复,但修复 PR 均已关闭。
- **Feishu**:飞书的 `im.message.receive_v1` 事件**只投递用户发送的消息**——bot 发的消息对其他 bot 完全不可见。这是飞书平台 API 的设计决策,无法通过配置绕过。

### Discussion 模式的当前状态

坦率地说:Discussion 模式还没有被端到端验证过。

通过 OpenClaw 源码验证(`extensions/slack/src/monitor/message-handler/prepare.ts`),以下机制已确认:
- Self-loop 过滤是 per-account 的(不同 Slack App 不互相过滤)
- `allowBots` 支持三级 fallback(per-channel > per-account > global)
- Per-account channel config 可以给同一频道的不同 bot 设置不同的 `requireMention`

但完整链路——CoS-Bot 在 #cto 发消息,CTO 收到并回复,CoS 看到回复并继续对话——还需要实际 POC 验证。详见 `shared/A2A_PROTOCOL.md` 附录 B。

---

## 5. 结构化产物:Closeout 和 Checkpoint
Expand Down Expand Up @@ -270,8 +315,9 @@ Layer 2: 抽象知识
├─ 任务按 QAPS 分类处理
│ └─ Q 轻量处理,A/P/S 必须 Closeout
├─ Agent 之间通过 A2A 两步触发协作
│ └─ 权限矩阵 + 循环保护
├─ Agent 之间通过 A2A 协作
│ ├─ Delegation:两步触发 + 权限矩阵
│ └─ Discussion:@mention 多 Agent 讨论 [待 POC 验证]
└─ 知识通过三层沉淀积累
└─ 对话 → Closeout → KO 抽象知识
Expand Down
50 changes: 48 additions & 2 deletions docs/en/CONCEPTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,51 @@ Builder -> Cannot assign tasks (receives and executes only)
CIO -> Operates independently (syncs with CoS when needed)
```

### Two A2A Modes: Delegation and Discussion

The two-step trigger described above is the **Delegation** mode -- one Agent hands a structured task to another via `sessions_send`. This is the foundation of A2A, supported on all platforms, with a clear one-directional flow.

v2 introduces a second mode: **Discussion**. A small number of high-value Agents (e.g., CoS) get their own independent Slack App, then join other Agents' channels to collaborate in real-time. [Pending POC Verification]

**Core idea: selective independence.** Not every Agent needs its own App -- execution-layer Agents (CTO, Builder, CIO, etc.) keep sharing one Slack App. Only Agents that need cross-domain collaboration (like CoS, who represents the user and drives strategy) get their own App, then get invited into target channels for direct conversation.

**When to use which?**

| | Delegation | Discussion [Pending POC Verification] |
|--|------------|---------------------------------------|
| Scenario | "CTO assigns a specific task to Builder" | "CoS walks into #cto to discuss the approach with CTO, then checks with Builder in #build" |
| Trigger | `sessions_send` | @mention / direct message |
| Directionality | One-way, one-to-one | Multi-directional, many-to-many |
| Platform | Slack / Discord / Feishu | Slack only (requires independent App) |

The two modes coexist -- they do not replace each other. Delegation is for "assign the work." Discussion is for "think it through together."

**Why Discussion?** Delegation is task distribution: CTO says what to do, Builder executes. But real teams don't just assign tasks -- they discuss. CoS walks into CTO's office and asks "what do you think about this direction?", CTO says "technically feasible but expensive", CoS then asks Builder "how long would this take?". Discussion mode lets Agents work the same way -- CoS-Bot gets invited into #cto and talks directly on CTO's home turf. You can watch in real-time and intervene at any point.

### Platform Capability Comparison

| Capability | Slack | Discord | Feishu |
|------------|-------|---------|--------|
| Delegation (sessions_send) | YES | YES | YES |
| Discussion (cross-bot) | Pending POC Verification | Not supported (OpenClaw code-level bug) | Not supported (platform limitation) |
| Thread / Topic isolation | Native thread | Thread (auto-archive) | groupSessionScope (>= 2026.3.1) |

**Why can't Discord and Feishu support Discussion?**

- **Discord**: The platform itself supports cross-bot message visibility, but OpenClaw's bot message filter (Issue #11199) treats ALL configured bots as "self" and drops their messages. This is a code-level bug, not a platform limitation -- but fix PRs have all been closed.
- **Feishu**: Feishu's `im.message.receive_v1` event **only delivers user-sent messages** -- bot messages are completely invisible to other bots. This is a platform API design decision and cannot be worked around through configuration.

### Current Status of Discussion Mode

To be candid: Discussion mode has not been verified end-to-end.

Through OpenClaw source code verification (`extensions/slack/src/monitor/message-handler/prepare.ts`), the following mechanisms are confirmed:
- Self-loop filtering is per-account (different Slack Apps don't filter each other)
- `allowBots` supports three-tier fallback (per-channel > per-account > global)
- Per-account channel config can give different bots different `requireMention` settings on the same channel

But the complete chain -- CoS-Bot posts in #cto, CTO receives and replies, CoS sees the reply and continues the conversation -- still needs a real POC test. See `shared/A2A_PROTOCOL.md` Appendix B for verification steps.

---

## 5. Structured Artifacts: Closeout and Checkpoint
Expand Down Expand Up @@ -270,8 +315,9 @@ You (decision-maker)
|-- Tasks are classified and handled via QAPS
| +-- Q gets lightweight handling; A/P/S require Closeout
|
|-- Agents collaborate via A2A two-step trigger
| +-- Permission matrix + loop prevention
|-- Agents collaborate via A2A
| |-- Delegation: two-step trigger + permission matrix
| +-- Discussion: @mention multi-agent deliberation [Pending POC Verification]
|
+-- Knowledge accumulates through three-layer distillation
+-- Conversation -> Closeout -> KO abstract knowledge
Expand Down
Loading