fix(mcp): inherit agent when creating conversations

This commit is contained in:
shiyue
2026-06-17 15:25:34 +08:00
parent 0812763c75
commit 216f87e3b4
3 changed files with 10 additions and 15 deletions

View File

@@ -3251,7 +3251,9 @@ function createMcpConversation(args = {}, sourceSessionId = '', sourceHopCount =
}
const now = new Date().toISOString();
const created = createPersistentConversationSession(args, {
const createArgs = { ...args };
delete createArgs.agent;
const created = createPersistentConversationSession(createArgs, {
sourceSession,
strict: true,
requireAbsoluteCwd: true,
@@ -6324,15 +6326,10 @@ function codexAppCommunicationDynamicTools() {
{
name: 'ccweb_create_conversation',
namespace: 'ccweb',
description: '创建新的 cc-web 持久对话。只用于需要长期追踪、后续继续对话或跨项目工作区管理的场景;一次性并行研究应使用子代能力。',
description: '创建新的 cc-web 持久对话。Agent 固定继承来源对话,不作为参数指定;只用于需要长期追踪、后续继续对话或跨项目工作区管理的场景;一次性并行研究应使用子代能力。',
inputSchema: {
type: 'object',
properties: {
agent: {
type: 'string',
enum: ['claude', 'codex', 'codexapp'],
description: '可选。新对话 Agent默认继承来源对话。',
},
cwd: {
type: 'string',
description: '可选。新对话工作目录;指定时必须是已存在的绝对路径,默认继承来源对话 cwd。',