feat: inter-agent communication (Phase 4 of Agent Teams)#136
Open
LeoLin990405 wants to merge 5 commits intobfly123:mainfrom
Open
feat: inter-agent communication (Phase 4 of Agent Teams)#136LeoLin990405 wants to merge 5 commits intobfly123:mainfrom
LeoLin990405 wants to merge 5 commits intobfly123:mainfrom
Conversation
Add a/b/c/d... shorthand aliases for providers so users can type `ask a "hello"` instead of `ask codex "hello"`. - New lib/aliases.py: 3-layer config (defaults < ~/.ccb/ < .ccb/) - Updated bin/ask: alias resolution before parse_qualified_provider - New test/test_aliases.py: 22 tests covering all paths Relates to bfly123#81
…ly123#81) Add team configuration system allowing named agents with provider, model, role, and skills. Team agent names override aliases. - New lib/team_config.py: team config loading from .ccb/team.json - Updated bin/ask: team agent resolution (priority over aliases) - New test/test_team_config.py: 38 tests covering all paths Example .ccb/team.json: { "name": "dev-team", "strategy": "skill_based", "agents": [ {"name": "researcher", "provider": "gemini", "model": "3f", "role": "research"}, {"name": "coder", "provider": "codex", "model": "o3", "role": "implementation"} ] } Usage: ask researcher "hello" → routes to gemini Relates to bfly123#81
…fly123#81) Add smart task routing that auto-selects the best provider based on message content analysis using keyword matching and team skill matching. - New lib/task_router.py: keyword rules, team skill matching, auto_route - Updated bin/ask: --auto flag for automatic provider selection - New test/test_task_router.py: 46 tests covering all routing paths Usage: ask --auto "帮我写一个 React 前端组件" → gemini (keywords: react, 前端) ask --auto "分析算法复杂度" → codex (keywords: 算法, 复杂度) ask --auto "翻译这段话" → kimi (keywords: 翻译) With team config, team skill matching takes priority over keywords. Relates to bfly123#81
Add inter-agent messaging with three communication patterns: directed messages, task chains, and broadcast. - New lib/agent_comm.py: message wrapping, broadcast, chain parsing - Updated bin/ask: --to and --broadcast flags - New test/test_agent_comm.py: 30 tests covering all comm paths Usage: ask codex --to reviewer "请审查这段代码" ask codex --broadcast "任务完成通知" Relates to bfly123#81
- Add --chain flag for sequential multi-agent pipelines: ask --chain "gemini:research | codex:implement | claude:review" - Fix --broadcast: use stdin pipe instead of position args - Chain passes previous output as [CCB_CONTEXT] to next step - Add 3 chain integration tests Relates to bfly123#81
Open
Owner
|
这个兼容吗 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary / 概述
Phase 4 of Agent Teams (#81): 添加 Agent 间通信,支持定向消息、任务链和广播。
Adds inter-agent communication with directed messages, task chains, and broadcast.
新文件 / New Files
lib/agent_comm.py(196 行) — 消息封装、广播、链式解析、agent 名称解析test/test_agent_comm.py(258 行) — 30 个测试覆盖所有通信路径修改 / Modified
bin/ask— 新增--to和--broadcast标志使用方式 / Usage
1. 定向消息 / Directed Message (
--to)从一个 agent 向另一个发送消息,带发送者元数据:
Send message from one agent to another, with sender metadata:
接收方收到的消息格式 / Receiving agent sees:
2. 广播 / Broadcast (
--broadcast)向所有 team agent 发送通知(需要 team 配置):
Send notification to all team agents (requires team config):
3. 任务链 / Task Chain (lib API)
通过
parse_chain_spec+build_chain_messages构建顺序执行链:Build sequential execution chains via the library API:
消息格式 / Message Format
设计要点 / Design
--to解析--broadcast排除[CCB_FROM]+[CCB_CONTEXT]标签parse_chain_spec("a:t1 | b:t2")→ 步骤列表ask基础设施阶段路线图 / Phased Roadmap
所有 4 个阶段已完成!/ All 4 phases complete! 🎉
Closes #81
测试计划 / Test plan
pytest test/test_agent_comm.py -v— 30/30 passedpytest test/test_task_router.py -v— 46/46 passedpytest test/test_team_config.py -v— 38/38 passedpytest test/test_aliases.py -v— 22/22 passedask codex --to gemini "hello"验证消息封装ask codex --broadcast "通知"验证广播