设置面板新增子代理默认模型选择器

- 向量记忆引擎下方新增「子代理默认模型」下拉框
- 留空则跟随当前模型,选择后所有 spawn_task 默认使用该模型
- spawn_task 工具仍支持单次指定 model 参数覆盖默认值
This commit is contained in:
thzxx
2026-06-05 10:56:08 +08:00
parent da71020003
commit f4a92fc40f
3 changed files with 50 additions and 1 deletions
+1 -1
View File
@@ -768,7 +768,7 @@ export async function executeTool(toolName: string, args: Record<string, unknown
const { executeSubAgent } = await import('./sub-agent.js');
const task = args.task as string;
const context = args.context as string | undefined;
const model = args.model as string | undefined;
const model = (args.model as string) || state.get<string>('subAgentModel', '') || undefined;
if (!task) return { success: false, error: '缺少 task 参数' };
logInfo(`子代理委派: ${task.slice(0, 80)}${model ? ` (模型: ${model})` : ''}`);
const result = await executeSubAgent(task, context, model ? { model } : {});