feat(collaboration): 支持为协作子会话分配其他渠道的模型(cross-channel model assignment) - #1936
Open
craig-zhang-capsule wants to merge 1 commit into
Open
Conversation
…ated sub-sessions 协作子会话支持跨渠道分配模型(对应 issue:delegate_agent 无法分配 其他渠道的模型): - delegate_agent/delegate_agents 新增可选 channelId;仅传 modelId 时在全部已启用渠道内解析,多渠道命中要求显式消歧 - list_available_agent_models 默认返回全部已启用渠道的分组视图, 传入 channelId 时保持单渠道视图 - 子会话创建时绑定目标渠道,委派记录与运行注入真实的渠道和模型 - 解析核心抽为纯函数 agent-model-target.ts(无 electron 依赖链), 附 9 个 BDD 测试 不传新参数时行为与原先完全一致(继承父会话渠道与模型)。 Made-with: Proma
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.
Closes #1935
解决的问题
如 #1935 所述:协作子会话的可用模型列表与
modelId校验均被限定在父会话渠道内,无法实现"主会话用旗舰模型规划 / Review,子会话用其他渠道的高性价比模型执行"的分层调度。手动切换子会话模型也只能绕行一次,后续委派会回落父会话模型。实现方案
模型标识引入渠道维度(
{channelId, modelId}),默认行为完全不变:delegate_agent/delegate_agents新增可选channelId:channelId + modelId:在指定渠道内校验modelId:在全部已启用渠道内解析;命中多个渠道时抛错要求消歧list_available_agent_models:默认返回全部已启用渠道的分组视图(channels[].models[],带 current 标记);传入channelId时保持单渠道视图createAgentSession/runRegisteredHeadlessAgent绑定目标渠道,委派记录(record.channelId)与工具返回值(effectiveChannelId)记录真实渠道agent-model-target.ts:仅依赖@proma/shared类型、无 electron 依赖链,便于测试与复用;agent-model-selection.ts保留 IO 包装层测试
bun:test):显式渠道+模型、跨渠道唯一命中、多渠道消歧、无命中、仅渠道取第一个启用模型、渠道无启用模型、继承回退、回退模型失效、禁用渠道不参与解析bun testmain/lib:270 pass(5 个失败为预先存在的环境相关用例,与基线一致,见下方说明)bun run typecheck通过真机端到端验证(OSS dev 实例)
GLM 主会话 → 委派子会话并指定 Kimi 渠道
k3:channelId+modelId兼容性
不传新参数时,解析结果与原先完全一致(继承父会话渠道与模型);基线上 5 个环境相关失败用例(OAuth proxy / planning DB / MCP transport)在改动前后表现一致。
Made with Proma · GitHub