feat: 工具执行超时可配置 + 修复硬编码盖过工具自定义超时的 bug
1. 新增 agent.toolExecutionTimeoutMs 配置(默认 120s,范围 10~600s),AgentSettings 加输入框 2. 修复 engine.ts 硬编码 120s 会盖过 delegate-task(5min)/web-search(5min) 等工具自定义 timeoutMs 的 bug:改为取 max(配置值, tool.timeoutMs) 3. main.ts 启动时从 ConfigService 加载;handlers.ts 监听 config:set 即时更新
This commit is contained in:
@@ -228,6 +228,7 @@ async function initialize(): Promise<void> {
|
||||
const agentTimeout = configService.get<number>('agent.totalTimeoutMs');
|
||||
const agentThinkingEnabled = configService.get<boolean>('agent.enableThinking');
|
||||
const agentThinkingEffort = configService.get<string>('agent.thinkingEffort') as 'low' | 'medium' | 'high' | 'max' | null;
|
||||
const toolExecTimeout = configService.get<number>('agent.toolExecutionTimeoutMs');
|
||||
const agentLoop = new AgentLoopEngine(
|
||||
{
|
||||
maxIterations: agentMaxIter ?? 20,
|
||||
@@ -235,6 +236,7 @@ async function initialize(): Promise<void> {
|
||||
contextLength: ollamaNumCtx ?? undefined,
|
||||
thinkingEnabled: agentThinkingEnabled ?? true,
|
||||
thinkingEffort: agentThinkingEffort ?? 'high',
|
||||
toolExecutionTimeoutMs: toolExecTimeout ?? 120_000,
|
||||
},
|
||||
adapter, toolRegistry, preToolHooks, postToolHooks,
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user