fix: 超时设置日志从debug级别改为info级别,初始化时打印汇总日志

This commit is contained in:
thzxx
2026-06-10 09:51:07 +08:00
parent 6390457312
commit 9559390d4d
2 changed files with 4 additions and 3 deletions
+3 -3
View File
@@ -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);
+1
View File
@@ -385,6 +385,7 @@ async function init(): Promise<void> {
(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);