fix: 修复所有超时设置0=禁用不生效的问题

1. 流式超时: baseTimeout=0时被忽略,仍走动态计算120s-600s 2. HTTP超时: ipc.ts中0>0=false导致setHTTPTimeout未调用 + Math.max(5000,ms)阻止0值 3. MCP超时: 同HTTP模式 + Math.max(10000,ms)阻止0值 4. fetchWithTimeout和web_fetch中直接setTimeout在HTTP_TIMEOUT=0时仍触发abort
This commit is contained in:
thzxx
2026-07-11 15:38:28 +08:00
parent 028cf33dee
commit e2350a784d
4 changed files with 45 additions and 24 deletions
+2 -2
View File
@@ -262,10 +262,10 @@ export async function setupIPC(): Promise<void> {
});
ipcMain.handle('tool:setTimeouts', (_, timeouts: { http?: number; mcp?: number }) => {
if (typeof timeouts.http === 'number' && timeouts.http > 0) {
if (typeof timeouts.http === 'number' && timeouts.http >= 0) {
setHTTPTimeout(timeouts.http);
}
if (typeof timeouts.mcp === 'number' && timeouts.mcp > 0) {
if (typeof timeouts.mcp === 'number' && timeouts.mcp >= 0) {
setMCPTimeout(timeouts.mcp);
}
return { success: true };