feat: A2A protocol v2 — Discussion mode + cross-platform support#38
feat: A2A protocol v2 — Discussion mode + cross-platform support#38
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: a758e72e8f
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
shared/A2A_PROTOCOL.md
Outdated
| > ⚠️ **SessionKey 注意**:不要手打 sessionKey。优先从 `sessions_list` 复制 `deliveryContext=slack` 的 key。 | ||
| > 注意 channel ID 大小写一致性——大小写不一致可能导致 session 被拆分,路由到 webchat 而非 Slack。 | ||
| > 注意 channel ID 大小写一致性——大小写不一致可能导致 session 被拆分,路由到 webchat 而非目标平台。 |
There was a problem hiding this comment.
Use platform-matched deliveryContext when copying keys
Section 2a is now documented as cross-platform (including Discord), but this note still tells operators to copy only deliveryContext=slack keys; in Discord/Feishu runs that can select the wrong session (or no valid one) and route work away from the intended channel/thread, which breaks the visibility/audit guarantees this protocol is enforcing.
Useful? React with 👍 / 👎.
shared/A2A_PROTOCOL.md
Outdated
| A 读取 root message 的 message id(ts),拼出 thread sessionKey: | ||
|
|
||
| - 频道 session:`agent:<B>:slack:channel:<channelId>` | ||
| - 线程 session:`agent:<B>:slack:channel:<channelId>:thread:<root_ts>` | ||
| - Slack 频道 session:`agent:<B>:slack:channel:<channelId>` | ||
| - Slack 线程 session:`agent:<B>:slack:channel:<channelId>:thread:<root_ts>` | ||
| - Discord 频道 session:`agent:<B>:discord:channel:<channelId>` |
There was a problem hiding this comment.
Add Feishu key derivation to Delegation step
This step is labeled “全平台” but still frames session-key construction as a generic message id (ts) flow and only lists Slack/Discord key patterns; Feishu in section 5 uses topic:<root_id>, so readers following Step 2 for Feishu will derive the wrong identifier and fail to target the correct topic session.
Useful? React with 👍 / 👎.
Evolve the A2A protocol based on deep research, source code verification, and architectural analysis: Core architecture change — selective independence: - Only high-value cross-cutting agents (e.g., CoS) get independent Slack Apps. Execution-layer agents (CTO, Builder, CIO) keep sharing one App via channel-based routing (existing proven model) - CoS-Bot joins existing channels (#cto, #build) to collaborate directly — like walking into another agent's office - CoS is the orchestrator (maps to Harness Design's external orchestrator), CTO is a participant/generator Protocol (shared/A2A_PROTOCOL.md — agent-facing): - Delegation mode: preserved unchanged, all platforms - Discussion mode: CoS-Bot enters target channel, @mention-driven conversation with per-account channel config isolation - Platform matrix with honest "why not" for Discord/Feishu - Agent-executable config guide (user sends to their OpenClaw) - POC verification steps (4 tests) - Source-code-verified: self-loop per-account, allowBots 3-tier fallback, per-account channel config (prepare.ts) Concepts (docs/CONCEPTS.md + en — human-facing): - "Selective independence" explained: not every agent needs own App - CoS as orchestrator, execution layer unchanged - Discord: OpenClaw code bug (#11199), not platform limitation - Feishu: platform API limitation (bot messages invisible) All Discussion content marked [待 POC 验证] / [Pending POC Verification]. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
a758e72 to
2db51c0
Compare
Summary
A2A 协议从 v1(单平台 Delegation)演化为 v2(跨平台双模式),基于深度研究、OpenClaw 源码验证和架构分析。
核心架构变化:选择性独立化
不需要每个 Agent 都有独立 Slack App。只让少数高价值横向 Agent(如 CoS)拥有独立 App,拉进现有 Agent 的频道直接协作:
映射到 Anthropic Harness Design:
文件变更
shared/A2A_PROTOCOL.mddocs/CONCEPTS.mddocs/en/CONCEPTS.md源码验证
通过直接读取
openclaw/openclaw源码确认:prepare.ts:message.user === ctx.botUserIdprepare.ts: channel > account > globalresolveMergedAccountConfiginbound-dedupe.ts: key 含 accountId诚实的限制说明
im.message.receive_v1仅投递用户消息sessions_send仍是官方推荐。Discussion 是增强非替代用户配置路径
PR 包含 agent-executable 配置指南(附录 A):
Test plan
🤖 Generated with Claude Code