feat(core): 移除内置 Agent 的 maxSteps 限制,默认使用 Build 模式

- 移除 build/plan/general/explore 的 maxSteps 配置
- 内置 Agent 不再限制步数(与 OpenCode 保持一致)
- 用户自定义 Agent 仍可按需配置 maxSteps
- 新建 Agent 默认使用 Build 模式
This commit is contained in:
2025-12-15 22:27:42 +08:00
parent df811395f8
commit 013e9a2712
5 changed files with 5 additions and 4 deletions
-1
View File
@@ -21,5 +21,4 @@ export const buildAgent: Omit<AgentInfo, 'name'> = {
- 使用 git 进行版本控制 - 使用 git 进行版本控制
始终保持专注和高效,直接解决问题。`, 始终保持专注和高效,直接解决问题。`,
maxSteps: 30,
}; };
@@ -169,5 +169,4 @@ export const exploreAgent: Omit<AgentInfo, 'name'> = {
dangerous: 'deny', dangerous: 'deny',
}, },
}, },
maxSteps: 20,
}; };
@@ -45,5 +45,4 @@ export const generalAgent: Omit<AgentInfo, 'name'> = {
], ],
noTask: true, // 禁止嵌套调用 Task noTask: true, // 禁止嵌套调用 Task
}, },
maxSteps: 20,
}; };
-1
View File
@@ -189,5 +189,4 @@ export const planAgent: Omit<AgentInfo, 'name'> = {
model: { model: {
temperature: 0.5, temperature: 0.5,
}, },
maxSteps: 30, // 增加探索步数以支持更深入的调研
}; };
+5
View File
@@ -274,6 +274,11 @@ export async function getOrCreateAgent(sessionId: string): Promise<AgentInstance
const agent = new coreModule.Agent(config); const agent = new coreModule.Agent(config);
agent.setRegistry(coreModule.toolRegistry); agent.setRegistry(coreModule.toolRegistry);
// 默认使用 Build 模式
if (agent.setAgentMode) {
agent.setAgentMode('build');
}
// 设置权限回调,通过 WebSocket 请求用户确认 // 设置权限回调,通过 WebSocket 请求用户确认
const permissionManager = coreModule.getPermissionManager(); const permissionManager = coreModule.getPermissionManager();
permissionManager.setAskCallback(createServerPermissionCallback(sessionId)); permissionManager.setAskCallback(createServerPermissionCallback(sessionId));