feat(moa): 新增 Mixture of Agents 支持(多模型参考 fan-out + 聚合)#45
Open
guantoubaozi wants to merge 15 commits into
Open
feat(moa): 新增 Mixture of Agents 支持(多模型参考 fan-out + 聚合)#45guantoubaozi wants to merge 15 commits into
guantoubaozi wants to merge 15 commits into
Conversation
Design for porting hermes-agent's Mixture of Agents into cz-cli as a virtual `moa` provider (approach A2): preset selection through the normal model system, reference fan-out + tool-aware context injection in llm.ts, aggregator as the acting model. Classic MoA / variant 1 scope. Co-Authored-By: Claude <noreply@anthropic.com>
The test asserted project config.model overrides the default_llm bridge, but 8fa9e5a made model exclusively owned by profiles.toml. Update the test to reflect current design: profiles.toml model wins. Co-Authored-By: Claude <noreply@anthropic.com>
The model selection dialog built its option list solely from llm_entries (profiles.toml [llm.*]), so the synthesized virtual `moa` provider — though correctly registered on the backend — never appeared in /model. Append the moa provider's presets to the picker options so MoA presets are selectable like any other model. Co-Authored-By: cz-cli <noreply@clickzetta.com>
…i.json Parse a top-level [moa] section from profiles.toml so MoA presets live in the same file as the [llm.*] entries they reference. czcli.json's moa field is now ignored (deleted on load, like model). Downstream provider synthesis and llm-loop consumers are unchanged; they read cfg.moa regardless of source. Co-Authored-By: cz-cli <noreply@clickzetta.com>
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.
概述
为 cz-cli 引入 Mixture of Agents(MoA):多个「参考模型」并行给出建议,再由一个「聚合模型」综合这些建议,作为正常的 acting model 执行工具并产出最终答案。MoA 注册成一个虚拟
moaprovider,每个 preset 就是/model里一个可选的 model——不新增命令,不改动交互流程。profiles.toml的顶层[moa]段,与 preset 引用的[llm.*]entry 同文件。配置示例
改动内容
session/moa.ts— 纯函数:preset 归一化、slot 解析、参考 fan-out、上下文注入/合成provider.ts— 合成虚拟moaprovider(每个 preset 一个 model)session/llm.ts— 在 LLM 循环里做参考 fan-out + 上下文注入config.ts/profiles-llm.ts— MoA 配置从 profiles.toml 的[moa]读取openspec/specs/moa-config/spec.md;设计文档见docs/superpowers/specs/测试计划
test/session/moa.test.ts、moa-integration.test.ts)test/provider/moa-provider.test.ts)test/session/llm.test.ts)test/config/profiles-llm.test.ts)bun typecheck通过moa/glmpreset(deepseek + qwen 参考 + glm-5.2 聚合)通过真实二进制端到端跑通