From 9559390d4d0a2fa23daf02ebd09ebf1480fcaf1e Mon Sep 17 00:00:00 2001 From: thzxx Date: Wed, 10 Jun 2026 09:51:07 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E8=B6=85=E6=97=B6=E8=AE=BE=E7=BD=AE?= =?UTF-8?q?=E6=97=A5=E5=BF=97=E4=BB=8Edebug=E7=BA=A7=E5=88=AB=E6=94=B9?= =?UTF-8?q?=E4=B8=BAinfo=E7=BA=A7=E5=88=AB=EF=BC=8C=E5=88=9D=E5=A7=8B?= =?UTF-8?q?=E5=8C=96=E6=97=B6=E6=89=93=E5=8D=B0=E6=B1=87=E6=80=BB=E6=97=A5?= =?UTF-8?q?=E5=BF=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/renderer/components/settings-modal.ts | 6 +++--- src/renderer/main.ts | 1 + 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/src/renderer/components/settings-modal.ts b/src/renderer/components/settings-modal.ts index c0eb4d8..3460a7d 100644 --- a/src/renderer/components/settings-modal.ts +++ b/src/renderer/components/settings-modal.ts @@ -80,14 +80,14 @@ export function initSettingsModal(): void { if (bridge?.tool?.setTimeouts) { await bridge.tool.setTimeouts({ http: httpSec > 0 ? httpSec * 1000 : 30_000 }); } - logSetting('HTTP 超时', httpSec > 0 ? `${httpSec}s` : '默认(30s)'); + logInfo('HTTP 超时', httpSec > 0 ? `${httpSec}s` : '默认(30s)'); // 流式超时(秒→毫秒) const streamVal = inputStreamTimeout.value.trim(); const streamSec = streamVal ? parseInt(streamVal) : 0; state.set('streamTimeout', streamSec > 0 ? streamSec * 1000 : 300_000); if (db) await db.saveSetting('streamTimeout', streamSec > 0 ? streamSec : 0); - logSetting('流式超时', streamSec > 0 ? `${streamSec}s` : '默认(300s)'); + logInfo('流式超时', streamSec > 0 ? `${streamSec}s` : '默认(300s)'); // MCP 超时(秒→毫秒) const mcpVal = inputMCPTimeout.value.trim(); @@ -96,7 +96,7 @@ export function initSettingsModal(): void { if (bridge?.tool?.setTimeouts) { await bridge.tool.setTimeouts({ mcp: mcpSec > 0 ? mcpSec * 1000 : 60_000 }); } - logSetting('MCP 超时', mcpSec > 0 ? `${mcpSec}s` : '默认(60s)'); + logInfo('MCP 超时', mcpSec > 0 ? `${mcpSec}s` : '默认(60s)'); }; const saveHttpTimeout = debounce(applyTimeouts, 500); diff --git a/src/renderer/main.ts b/src/renderer/main.ts index bb37e10..101ccd2 100644 --- a/src/renderer/main.ts +++ b/src/renderer/main.ts @@ -385,6 +385,7 @@ async function init(): Promise { (document.querySelector('#inputStreamTimeout') as HTMLInputElement).value = streamTimeout > 0 ? String(streamTimeout) : ''; (document.querySelector('#inputMCPTimeout') as HTMLInputElement).value = mcpTimeout > 0 ? String(mcpTimeout) : ''; } + logInit(`超时设置: HTTP=${httpTimeout||30}s 流式=${streamTimeout||300}s MCP=${mcpTimeout||60}s`); // ── Tool Calling 设置 ── const toolCallingEnabled = await db.getSetting('toolCallingEnabled', true);